diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2019-10-06 11:49:50 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2019-10-07 13:08:57 +1100 |
commit | b1e79ea8fae9c252399677a28707661d85c7d00c (patch) | |
tree | e394ab88e4b0af4fe87ecc727656c0889a3f585f /regress/dhgex.sh | |
parent | 8dc7d6b75a7f746fdd056acd41dffc0a13557a4c (diff) |
upstream: Instead of running sed over the whole log to remove CRs,
remove them only where it's needed (and confuses test(1) on at least OS X in
portable).
OpenBSD-Regress-ID: a6ab9b4bd1d33770feaf01b2dfb96f9e4189d2d0
Diffstat (limited to 'regress/dhgex.sh')
-rw-r--r-- | regress/dhgex.sh | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/regress/dhgex.sh b/regress/dhgex.sh index ceb3b5d23..ae64a9fb6 100644 --- a/regress/dhgex.sh +++ b/regress/dhgex.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: dhgex.sh,v 1.5 2019/09/27 05:25:12 dtucker Exp $ | 1 | # $OpenBSD: dhgex.sh,v 1.6 2019/10/06 11:49:50 dtucker Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="dhgex" | 4 | tid="dhgex" |
@@ -28,9 +28,6 @@ ssh_test_dhgex() | |||
28 | if [ $? -ne 0 ]; then | 28 | if [ $? -ne 0 ]; then |
29 | fail "ssh failed ($@)" | 29 | fail "ssh failed ($@)" |
30 | fi | 30 | fi |
31 | # Remove CRs. | ||
32 | sed 's/\r//' ${LOG} >${LOG}.new | ||
33 | mv ${LOG}.new ${LOG} | ||
34 | # check what we request | 31 | # check what we request |
35 | grep "SSH2_MSG_KEX_DH_GEX_REQUEST($groupsz) sent" ${LOG} >/dev/null | 32 | grep "SSH2_MSG_KEX_DH_GEX_REQUEST($groupsz) sent" ${LOG} >/dev/null |
36 | if [ $? != 0 ]; then | 33 | if [ $? != 0 ]; then |
@@ -38,7 +35,8 @@ ssh_test_dhgex() | |||
38 | fail "$tid unexpected GEX sizes, expected $groupsz, got $got" | 35 | fail "$tid unexpected GEX sizes, expected $groupsz, got $got" |
39 | fi | 36 | fi |
40 | # check what we got. | 37 | # check what we got. |
41 | gotbits="`awk '/bits set:/{print $4}' ${LOG} | head -1 | cut -f2 -d/`" | 38 | gotbits="`awk 'BEGIN{FS="/"}/bits set:/{print $2}' ${LOG} | |
39 | head -1 | tr -d '\r\n'`" | ||
42 | trace "expected '$bits' got '$gotbits'" | 40 | trace "expected '$bits' got '$gotbits'" |
43 | if [ -z "$gotbits" ] || [ "$gotbits" -lt "$bits" ]; then | 41 | if [ -z "$gotbits" ] || [ "$gotbits" -lt "$bits" ]; then |
44 | fatal "$tid expected $bits bit group, got $gotbits" | 42 | fatal "$tid expected $bits bit group, got $gotbits" |