From e7d0583f36d060d199c44cbd16b367b0b9907333 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 16 Jun 2004 20:22:22 +1000 Subject: - djm@cvs.openbsd.org 2004/06/13 15:04:08 [regress/Makefile regress/test-exec.sh, added regress/multiplex.sh] regress test for client multiplexing; ok markus@ --- regress/multiplex.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 regress/multiplex.sh (limited to 'regress/multiplex.sh') diff --git a/regress/multiplex.sh b/regress/multiplex.sh new file mode 100644 index 000000000..70a4e677f --- /dev/null +++ b/regress/multiplex.sh @@ -0,0 +1,55 @@ +# $OpenBSD: multiplex.sh,v 1.1 2004/06/13 15:04:08 djm Exp $ +# Placed in the Public Domain. + +CTL=$OBJ/ctl-sock + +tid="connection multiplexing" + +start_sshd + +trace "start master, fork to background" +${SSH} -2 -MS$CTL -F $OBJ/ssh_config -f somehost sleep 60 + +trace "ssh transfer over multiplexed connection and check result" +${SSH} -S$CTL otherhost cat /bin/ls > $OBJ/ls.copy +test -f $OBJ/ls.copy || fail "failed copy /bin/ls" +cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" + +trace "ssh transfer over multiplexed connection and check result" +${SSH} -S $CTL otherhost cat /bin/ls > $OBJ/ls.copy +test -f $OBJ/ls.copy || fail "failed copy /bin/ls" +cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" + +rm -f $OBJ/ls.copy +trace "sftp transfer over multiplexed connection and check result" +echo "get /bin/ls $OBJ/ls.copy" | \ + ${SFTP} -oControlPath=$CTL otherhost +test -f $OBJ/ls.copy || fail "failed copy /bin/ls" +cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" + +rm -f $OBJ/ls.copy +trace "scp transfer over multiplexed connection and check result" +${SCP} -oControlPath=$CTL otherhost:/bin/ls $OBJ/ls.copy +test -f $OBJ/ls.copy || fail "failed copy /bin/ls" +cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" + +for s in 0 1 4 5 44; do + trace "exit status $s over multiplexed connection" + verbose "test $tid: status $s" + ${SSH} -S $CTL otherhost exit $s + r=$? + if [ $r -ne $s ]; then + fail "exit code mismatch for protocol $p: $r != $s" + fi + + # same with early close of stdout/err + trace "exit status $s with early close over multiplexed connection" + ${SSH} -S $CTL -n otherhost \ + exec sh -c \'"sleep 2; exec > /dev/null 2>&1; sleep 3; exit $s"\' + r=$? + if [ $r -ne $s ]; then + fail "exit code (with sleep) mismatch for protocol $p: $r != $s" + fi +done + +sleep 30 # early close test sleeps 5 seconds per test -- cgit v1.2.3 From 5711dca4a6c631b1a5a4d77688c3567a520cdac0 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 16 Jun 2004 23:23:50 +1000 Subject: - dtucker@cvs.openbsd.org 2004/06/16 13:16:40 [multiplex.sh] Silence multiplex sftp and scp tests. ok markus@ --- ChangeLog | 5 ++++- regress/multiplex.sh | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 9630ed6da..9f29f6aaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,9 @@ - dtucker@cvs.openbsd.org 2004/06/16 13:15:09 [regress/scp.sh] Make scp -r tests use diff -rN not cmp (which won't do dirs. ok markus@ + - dtucker@cvs.openbsd.org 2004/06/16 13:16:40 + [multiplex.sh] + Silence multiplex sftp and scp tests. ok markus@ - (dtucker) [regress/test-exec.sh] Move Portable-only StrictModes to top of list to make syncs easier. - (dtucker) [regress/README.regress] @@ -1248,4 +1251,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3396 2004/06/16 13:22:37 dtucker Exp $ +$Id: ChangeLog,v 1.3397 2004/06/16 13:23:50 dtucker Exp $ diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 70a4e677f..9940f15cb 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,4 +1,4 @@ -# $OpenBSD: multiplex.sh,v 1.1 2004/06/13 15:04:08 djm Exp $ +# $OpenBSD: multiplex.sh,v 1.2 2004/06/16 13:16:40 dtucker Exp $ # Placed in the Public Domain. CTL=$OBJ/ctl-sock @@ -23,13 +23,13 @@ cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" rm -f $OBJ/ls.copy trace "sftp transfer over multiplexed connection and check result" echo "get /bin/ls $OBJ/ls.copy" | \ - ${SFTP} -oControlPath=$CTL otherhost + ${SFTP} -oControlPath=$CTL otherhost >/dev/null 2>&1 test -f $OBJ/ls.copy || fail "failed copy /bin/ls" cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" rm -f $OBJ/ls.copy trace "scp transfer over multiplexed connection and check result" -${SCP} -oControlPath=$CTL otherhost:/bin/ls $OBJ/ls.copy +${SCP} -oControlPath=$CTL otherhost:/bin/ls $OBJ/ls.copy >/dev/null 2>&1 test -f $OBJ/ls.copy || fail "failed copy /bin/ls" cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" -- cgit v1.2.3 From ddea13d74ddaba7951c61d50a798f1c345d677c2 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 17 Jun 2004 16:27:43 +1000 Subject: - dtucker@cvs.openbsd.org 2004/06/17 05:51:59 [regress/multiplex.sh] Remove datafile between and after tests, kill sshd rather than wait; ok djm@ --- ChangeLog | 7 ++++++- regress/multiplex.sh | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index acb0e26dd..823a94123 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ 20040617 - (dtucker) [regress/scp.sh] diff -N is not portable (but needed for some platforms), so test if diff understands it. Pointed out by tim@, ok djm@ + - (dtucker) OpenBSD CVS Sync regress/ + - dtucker@cvs.openbsd.org 2004/06/17 05:51:59 + [regress/multiplex.sh] + Remove datafile between and after tests, kill sshd rather than wait; + ok djm@ 20040616 - (dtucker) [openbsd-compat/port-aix.c] Expand whitespace -> tabs. No @@ -1255,4 +1260,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3399 2004/06/17 05:18:32 dtucker Exp $ +$Id: ChangeLog,v 1.3400 2004/06/17 06:27:43 dtucker Exp $ diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 9940f15cb..fb4927e62 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,4 +1,4 @@ -# $OpenBSD: multiplex.sh,v 1.2 2004/06/16 13:16:40 dtucker Exp $ +# $OpenBSD: multiplex.sh,v 1.3 2004/06/17 05:51:59 dtucker Exp $ # Placed in the Public Domain. CTL=$OBJ/ctl-sock @@ -10,11 +10,13 @@ start_sshd trace "start master, fork to background" ${SSH} -2 -MS$CTL -F $OBJ/ssh_config -f somehost sleep 60 +rm -f $OBJ/ls.copy trace "ssh transfer over multiplexed connection and check result" ${SSH} -S$CTL otherhost cat /bin/ls > $OBJ/ls.copy test -f $OBJ/ls.copy || fail "failed copy /bin/ls" cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" +rm -f $OBJ/ls.copy trace "ssh transfer over multiplexed connection and check result" ${SSH} -S $CTL otherhost cat /bin/ls > $OBJ/ls.copy test -f $OBJ/ls.copy || fail "failed copy /bin/ls" @@ -33,6 +35,8 @@ ${SCP} -oControlPath=$CTL otherhost:/bin/ls $OBJ/ls.copy >/dev/null 2>&1 test -f $OBJ/ls.copy || fail "failed copy /bin/ls" cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" +rm -f $OBJ/ls.copy + for s in 0 1 4 5 44; do trace "exit status $s over multiplexed connection" verbose "test $tid: status $s" @@ -52,4 +56,6 @@ for s in 0 1 4 5 44; do fi done -sleep 30 # early close test sleeps 5 seconds per test +# kill master, remove control socket. ssh -MS will exit when sleep exits +$SUDO kill `cat $PIDFILE` +rm -f $CTL -- cgit v1.2.3 From ffaa6a5f01483d5b43c9165176713d730ec8a2c7 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 17 Jun 2004 16:32:45 +1000 Subject: - dtucker@cvs.openbsd.org 2004/06/17 06:00:05 [regress/multiplex.sh] Use DATA and COPY for test data rather than hard-coded paths; ok djm@ --- ChangeLog | 5 ++++- regress/multiplex.sh | 39 +++++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 19 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 823a94123..b6617d7ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ [regress/multiplex.sh] Remove datafile between and after tests, kill sshd rather than wait; ok djm@ + - dtucker@cvs.openbsd.org 2004/06/17 06:00:05 + [regress/multiplex.sh] + Use DATA and COPY for test data rather than hard-coded paths; ok djm@ 20040616 - (dtucker) [openbsd-compat/port-aix.c] Expand whitespace -> tabs. No @@ -1260,4 +1263,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3400 2004/06/17 06:27:43 dtucker Exp $ +$Id: ChangeLog,v 1.3401 2004/06/17 06:32:45 dtucker Exp $ diff --git a/regress/multiplex.sh b/regress/multiplex.sh index fb4927e62..9fea117bd 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,41 +1,44 @@ -# $OpenBSD: multiplex.sh,v 1.3 2004/06/17 05:51:59 dtucker Exp $ +# $OpenBSD: multiplex.sh,v 1.4 2004/06/17 06:00:05 dtucker Exp $ # Placed in the Public Domain. CTL=$OBJ/ctl-sock tid="connection multiplexing" +DATA=/bin/ls +COPY=$OBJ/ls.copy + start_sshd trace "start master, fork to background" ${SSH} -2 -MS$CTL -F $OBJ/ssh_config -f somehost sleep 60 -rm -f $OBJ/ls.copy +rm -f ${COPY} trace "ssh transfer over multiplexed connection and check result" -${SSH} -S$CTL otherhost cat /bin/ls > $OBJ/ls.copy -test -f $OBJ/ls.copy || fail "failed copy /bin/ls" -cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" +${SSH} -S$CTL otherhost cat ${DATA} > ${COPY} +test -f ${COPY} || fail "failed copy ${DATA}" +cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" -rm -f $OBJ/ls.copy +rm -f ${COPY} trace "ssh transfer over multiplexed connection and check result" -${SSH} -S $CTL otherhost cat /bin/ls > $OBJ/ls.copy -test -f $OBJ/ls.copy || fail "failed copy /bin/ls" -cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" +${SSH} -S $CTL otherhost cat ${DATA} > ${COPY} +test -f ${COPY} || fail "failed copy ${DATA}" +cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" -rm -f $OBJ/ls.copy +rm -f ${COPY} trace "sftp transfer over multiplexed connection and check result" -echo "get /bin/ls $OBJ/ls.copy" | \ +echo "get ${DATA} ${COPY}" | \ ${SFTP} -oControlPath=$CTL otherhost >/dev/null 2>&1 -test -f $OBJ/ls.copy || fail "failed copy /bin/ls" -cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" +test -f ${COPY} || fail "failed copy ${DATA}" +cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" -rm -f $OBJ/ls.copy +rm -f ${COPY} trace "scp transfer over multiplexed connection and check result" -${SCP} -oControlPath=$CTL otherhost:/bin/ls $OBJ/ls.copy >/dev/null 2>&1 -test -f $OBJ/ls.copy || fail "failed copy /bin/ls" -cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" +${SCP} -oControlPath=$CTL otherhost:${DATA} ${COPY} >/dev/null 2>&1 +test -f ${COPY} || fail "failed copy ${DATA}" +cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" -rm -f $OBJ/ls.copy +rm -f ${COPY} for s in 0 1 4 5 44; do trace "exit status $s over multiplexed connection" -- cgit v1.2.3 From 3e86fc4e992cec58461d6170816d03b36ad8f783 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 17 Jun 2004 16:34:02 +1000 Subject: - dtucker@cvs.openbsd.org 2004/06/17 06:19:06 [regress/multiplex.sh] Add small description of failing test to failure message; ok djm@ --- ChangeLog | 5 ++++- regress/multiplex.sh | 18 +++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index b6617d7ee..39f4e45d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ - dtucker@cvs.openbsd.org 2004/06/17 06:00:05 [regress/multiplex.sh] Use DATA and COPY for test data rather than hard-coded paths; ok djm@ + - dtucker@cvs.openbsd.org 2004/06/17 06:19:06 + [regress/multiplex.sh] + Add small description of failing test to failure message; ok djm@ 20040616 - (dtucker) [openbsd-compat/port-aix.c] Expand whitespace -> tabs. No @@ -1263,4 +1266,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3401 2004/06/17 06:32:45 dtucker Exp $ +$Id: ChangeLog,v 1.3402 2004/06/17 06:34:02 dtucker Exp $ diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 9fea117bd..b70a99c01 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,4 +1,4 @@ -# $OpenBSD: multiplex.sh,v 1.4 2004/06/17 06:00:05 dtucker Exp $ +# $OpenBSD: multiplex.sh,v 1.5 2004/06/17 06:19:06 dtucker Exp $ # Placed in the Public Domain. CTL=$OBJ/ctl-sock @@ -16,27 +16,27 @@ ${SSH} -2 -MS$CTL -F $OBJ/ssh_config -f somehost sleep 60 rm -f ${COPY} trace "ssh transfer over multiplexed connection and check result" ${SSH} -S$CTL otherhost cat ${DATA} > ${COPY} -test -f ${COPY} || fail "failed copy ${DATA}" -cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" +test -f ${COPY} || fail "ssh -Sctl: failed copy ${DATA}" +cmp ${DATA} ${COPY} || fail "ssh -Sctl: corrupted copy of ${DATA}" rm -f ${COPY} trace "ssh transfer over multiplexed connection and check result" ${SSH} -S $CTL otherhost cat ${DATA} > ${COPY} -test -f ${COPY} || fail "failed copy ${DATA}" -cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" +test -f ${COPY} || fail "ssh -S ctl: failed copy ${DATA}" +cmp ${DATA} ${COPY} || fail "ssh -S ctl: corrupted copy of ${DATA}" rm -f ${COPY} trace "sftp transfer over multiplexed connection and check result" echo "get ${DATA} ${COPY}" | \ ${SFTP} -oControlPath=$CTL otherhost >/dev/null 2>&1 -test -f ${COPY} || fail "failed copy ${DATA}" -cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" +test -f ${COPY} || fail "sftp: failed copy ${DATA}" +cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}" rm -f ${COPY} trace "scp transfer over multiplexed connection and check result" ${SCP} -oControlPath=$CTL otherhost:${DATA} ${COPY} >/dev/null 2>&1 -test -f ${COPY} || fail "failed copy ${DATA}" -cmp ${DATA} ${COPY} || fail "corrupted copy of ${DATA}" +test -f ${COPY} || fail "scp: failed copy ${DATA}" +cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" rm -f ${COPY} -- cgit v1.2.3 From 10e7f1929b54dcdd91fea2fe03e9450abdd8b31c Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 17 Jun 2004 16:36:27 +1000 Subject: - (dtucker) [regress/multiplex.sh] add EXEEXT for those platforms that need it. --- ChangeLog | 4 +++- regress/multiplex.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 39f4e45d2..04086429e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ - dtucker@cvs.openbsd.org 2004/06/17 06:19:06 [regress/multiplex.sh] Add small description of failing test to failure message; ok djm@ + - (dtucker) [regress/multiplex.sh] add EXEEXT for those platforms that need + it. 20040616 - (dtucker) [openbsd-compat/port-aix.c] Expand whitespace -> tabs. No @@ -1266,4 +1268,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3402 2004/06/17 06:34:02 dtucker Exp $ +$Id: ChangeLog,v 1.3403 2004/06/17 06:36:27 dtucker Exp $ diff --git a/regress/multiplex.sh b/regress/multiplex.sh index b70a99c01..654aae5e6 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -5,7 +5,7 @@ CTL=$OBJ/ctl-sock tid="connection multiplexing" -DATA=/bin/ls +DATA=/bin/ls${EXEEXT} COPY=$OBJ/ls.copy start_sshd -- cgit v1.2.3 From a9972e19e941f9f711103b50dd57f6bc0c1aad53 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 17 Jun 2004 17:01:21 +1000 Subject: - (dtucker) [regress/multiplex.sh] Increase sleep time to 120 sec (60 is not enough for slow systems, especially if they don't have a kernel RNG). --- ChangeLog | 4 +++- regress/multiplex.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 04086429e..95b583e3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,8 @@ Add small description of failing test to failure message; ok djm@ - (dtucker) [regress/multiplex.sh] add EXEEXT for those platforms that need it. + - (dtucker) [regress/multiplex.sh] Increase sleep time to 120 sec (60 is not + enough for slow systems, especially if they don't have a kernel RNG). 20040616 - (dtucker) [openbsd-compat/port-aix.c] Expand whitespace -> tabs. No @@ -1268,4 +1270,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3403 2004/06/17 06:36:27 dtucker Exp $ +$Id: ChangeLog,v 1.3404 2004/06/17 07:01:21 dtucker Exp $ diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 654aae5e6..8605d5e0b 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -11,7 +11,7 @@ COPY=$OBJ/ls.copy start_sshd trace "start master, fork to background" -${SSH} -2 -MS$CTL -F $OBJ/ssh_config -f somehost sleep 60 +${SSH} -2 -MS$CTL -F $OBJ/ssh_config -f somehost sleep 120 rm -f ${COPY} trace "ssh transfer over multiplexed connection and check result" -- cgit v1.2.3 From e826a8c9d9ea8de6696ca95825d69cf02e1954d6 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 18 Jun 2004 01:23:03 +1000 Subject: - djm@cvs.openbsd.org 2004/06/17 14:53:27 [regress/multiplex.sh] shared connection env passing regress test --- ChangeLog | 5 ++++- regress/multiplex.sh | 13 +++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 7b74a0bf7..53882b05d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,9 @@ [clientloop.c misc.h readconf.c readpass.c ssh.c ssh_config.5] Add option for confirmation (ControlMaster=ask) via ssh-askpass before opening shared connections; ok markus@ + - djm@cvs.openbsd.org 2004/06/17 14:53:27 + [regress/multiplex.sh] + shared connection env passing regress test 20040617 - (dtucker) [regress/scp.sh] diff -N is not portable (but needed for some @@ -1280,4 +1283,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3406 2004/06/17 15:19:03 djm Exp $ +$Id: ChangeLog,v 1.3407 2004/06/17 15:23:03 djm Exp $ diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 8605d5e0b..c19c0fe17 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,4 +1,4 @@ -# $OpenBSD: multiplex.sh,v 1.5 2004/06/17 06:19:06 dtucker Exp $ +# $OpenBSD: multiplex.sh,v 1.6 2004/06/17 14:53:27 djm Exp $ # Placed in the Public Domain. CTL=$OBJ/ctl-sock @@ -11,8 +11,17 @@ COPY=$OBJ/ls.copy start_sshd trace "start master, fork to background" -${SSH} -2 -MS$CTL -F $OBJ/ssh_config -f somehost sleep 120 +${SSH} -2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" -f somehost \ + sleep 120 +verbose "test $tid: envpass" +trace "env passing over multiplexed connection" +_XXX_TEST=blah ${SSH} -S$CTL otherhost '[ "x$_XXX_TEST" = "xblah" ]' +if [ $? -ne 0 ]; then + fail "environment not found" +fi + +verbose "test $tid: transfer" rm -f ${COPY} trace "ssh transfer over multiplexed connection and check result" ${SSH} -S$CTL otherhost cat ${DATA} > ${COPY} -- cgit v1.2.3 From 6288dc14fcce8f88216506ac3226849c3e43cfa7 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 18 Jun 2004 16:25:35 +1000 Subject: - dtucker@cvs.openbsd.org 2004/06/18 06:15:51 [multiplex.sh] Use -S for scp/sftp to force the use of the ssh being tested. ok djm@,markus@ --- ChangeLog | 6 +++++- regress/multiplex.sh | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 56c49b6ce..cd2fc1951 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,10 @@ - dtucker@cvs.openbsd.org 2004/06/18 06:13:25 [sftp.c] Use execvp instead of execv so sftp -S ssh works. "makes sense" markus@ + - dtucker@cvs.openbsd.org 2004/06/18 06:15:51 + [multiplex.sh] + Use -S for scp/sftp to force the use of the ssh being tested. + ok djm@,markus@ 20040617 - (dtucker) [regress/scp.sh] diff -N is not portable (but needed for some @@ -1292,4 +1296,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3410 2004/06/18 06:23:43 dtucker Exp $ +$Id: ChangeLog,v 1.3411 2004/06/18 06:25:35 dtucker Exp $ diff --git a/regress/multiplex.sh b/regress/multiplex.sh index c19c0fe17..c167b9632 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,4 +1,4 @@ -# $OpenBSD: multiplex.sh,v 1.6 2004/06/17 14:53:27 djm Exp $ +# $OpenBSD: multiplex.sh,v 1.7 2004/06/18 06:15:51 dtucker Exp $ # Placed in the Public Domain. CTL=$OBJ/ctl-sock @@ -37,13 +37,13 @@ cmp ${DATA} ${COPY} || fail "ssh -S ctl: corrupted copy of ${DATA}" rm -f ${COPY} trace "sftp transfer over multiplexed connection and check result" echo "get ${DATA} ${COPY}" | \ - ${SFTP} -oControlPath=$CTL otherhost >/dev/null 2>&1 + ${SFTP} -S ${SSH} -oControlPath=$CTL otherhost >/dev/null 2>&1 test -f ${COPY} || fail "sftp: failed copy ${DATA}" cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}" rm -f ${COPY} trace "scp transfer over multiplexed connection and check result" -${SCP} -oControlPath=$CTL otherhost:${DATA} ${COPY} >/dev/null 2>&1 +${SCP} -S ${SSH} -oControlPath=$CTL otherhost:${DATA} ${COPY} >/dev/null 2>&1 test -f ${COPY} || fail "scp: failed copy ${DATA}" cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" -- cgit v1.2.3 From 430c6a1552e25a1163e6fa1bade9a276791679a6 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 22 Jun 2004 13:38:56 +1000 Subject: - markus@cvs.openbsd.org 2004/06/22 03:12:13 [regress/envpass.sh regress/multiplex.sh] more portable env passing tests --- ChangeLog | 5 ++++- regress/envpass.sh | 19 +++++++++++++------ regress/multiplex.sh | 9 +++++---- 3 files changed, 22 insertions(+), 11 deletions(-) (limited to 'regress/multiplex.sh') diff --git a/ChangeLog b/ChangeLog index 00864980a..f5a1b14c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,6 +38,9 @@ [sftp.c] don't show .files by default in ls, add -a option to turn them back on; ok markus + - markus@cvs.openbsd.org 2004/06/22 03:12:13 + [regress/envpass.sh regress/multiplex.sh] + more portable env passing tests - (dtucker) [monitor.c] Fix Portable-specific -Wshadow warnings on "socket". - (dtucker) [defines.h] Define __dead if not already defined. @@ -1362,4 +1365,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3430 2004/06/22 03:37:11 mouring Exp $ +$Id: ChangeLog,v 1.3431 2004/06/22 03:38:56 dtucker Exp $ diff --git a/regress/envpass.sh b/regress/envpass.sh index 67044d421..a5bae06dd 100644 --- a/regress/envpass.sh +++ b/regress/envpass.sh @@ -1,4 +1,4 @@ -# $OpenBSD: envpass.sh,v 1.1 2004/04/27 09:47:30 djm Exp $ +# $OpenBSD: envpass.sh,v 1.2 2004/06/22 03:12:13 markus Exp $ # Placed in the Public Domain. tid="environment passing" @@ -8,7 +8,9 @@ tid="environment passing" trace "pass env, don't accept" verbose "test $tid: pass env, don't accept" _TEST_ENV=blah ${SSH} -oSendEnv="*" -F $OBJ/ssh_proxy otherhost \ - '[ -z "$_TEST_ENV" ]' + sh << 'EOF' + test -z $_TEST_ENV +EOF r=$? if [ $r -ne 0 ]; then fail "environment found" @@ -17,7 +19,9 @@ fi trace "don't pass env, accept" verbose "test $tid: don't pass env, accept" ${SSH} -F $OBJ/ssh_proxy otherhost \ - '[ -z "$_XXX_TEST_A" -a -z "$_XXX_TEST_B" ]' + sh << 'EOF' + test -z $_XXX_TEST_A && test -z $_XXX_TEST_B +EOF r=$? if [ $r -ne 0 ]; then fail "environment found" @@ -26,7 +30,9 @@ fi trace "pass single env, accept single env" verbose "test $tid: pass single env, accept single env" _XXX_TEST=blah ${SSH} -oSendEnv="_XXX_TEST" -F $OBJ/ssh_proxy otherhost \ - '[ "x$_XXX_TEST" = "xblah" ]' + sh << 'EOF' + test X"$_XXX_TEST" = X"blah" +EOF r=$? if [ $r -ne 0 ]; then fail "environment not found" @@ -36,9 +42,10 @@ trace "pass multiple env, accept multiple env" verbose "test $tid: pass multiple env, accept multiple env" _XXX_TEST_A=1 _XXX_TEST_B=2 ${SSH} -oSendEnv="_XXX_TEST_*" \ -F $OBJ/ssh_proxy otherhost \ - '[ "x$_XXX_TEST_A" = "x1" -a "x$_XXX_TEST_B" = "x2" ]' + sh << 'EOF' + test X"$_XXX_TEST_A" = X"1" -a X"$_XXX_TEST_B" = X"2" +EOF r=$? if [ $r -ne 0 ]; then fail "environment not found" fi - diff --git a/regress/multiplex.sh b/regress/multiplex.sh index c167b9632..dbf2025be 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh @@ -1,4 +1,4 @@ -# $OpenBSD: multiplex.sh,v 1.7 2004/06/18 06:15:51 dtucker Exp $ +# $OpenBSD: multiplex.sh,v 1.8 2004/06/22 03:12:13 markus Exp $ # Placed in the Public Domain. CTL=$OBJ/ctl-sock @@ -11,12 +11,13 @@ COPY=$OBJ/ls.copy start_sshd trace "start master, fork to background" -${SSH} -2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" -f somehost \ - sleep 120 +${SSH} -2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" -f somehost sleep 120 verbose "test $tid: envpass" trace "env passing over multiplexed connection" -_XXX_TEST=blah ${SSH} -S$CTL otherhost '[ "x$_XXX_TEST" = "xblah" ]' +_XXX_TEST=blah ${SSH} -oSendEnv="_XXX_TEST" -S$CTL otherhost sh << 'EOF' + test X"$_XXX_TEST" = X"blah" +EOF if [ $? -ne 0 ]; then fail "environment not found" fi -- cgit v1.2.3