[regress/envpass.sh regress/multiplex.sh]
     more portable env passing tests
This commit is contained in:
Darren Tucker 2004-06-22 13:38:56 +10:00
parent e35bf12eeb
commit 430c6a1552
3 changed files with 22 additions and 11 deletions

View File

@ -38,6 +38,9 @@
[sftp.c] [sftp.c]
don't show .files by default in ls, add -a option to turn them back on; don't show .files by default in ls, add -a option to turn them back on;
ok markus 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) [monitor.c] Fix Portable-specific -Wshadow warnings on "socket".
- (dtucker) [defines.h] Define __dead if not already defined. - (dtucker) [defines.h] Define __dead if not already defined.
@ -1362,4 +1365,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu - (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 $

View File

@ -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. # Placed in the Public Domain.
tid="environment passing" tid="environment passing"
@ -8,7 +8,9 @@ tid="environment passing"
trace "pass env, don't accept" trace "pass env, don't accept"
verbose "test $tid: pass env, don't accept" verbose "test $tid: pass env, don't accept"
_TEST_ENV=blah ${SSH} -oSendEnv="*" -F $OBJ/ssh_proxy otherhost \ _TEST_ENV=blah ${SSH} -oSendEnv="*" -F $OBJ/ssh_proxy otherhost \
'[ -z "$_TEST_ENV" ]' sh << 'EOF'
test -z $_TEST_ENV
EOF
r=$? r=$?
if [ $r -ne 0 ]; then if [ $r -ne 0 ]; then
fail "environment found" fail "environment found"
@ -17,7 +19,9 @@ fi
trace "don't pass env, accept" trace "don't pass env, accept"
verbose "test $tid: don't pass env, accept" verbose "test $tid: don't pass env, accept"
${SSH} -F $OBJ/ssh_proxy otherhost \ ${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=$? r=$?
if [ $r -ne 0 ]; then if [ $r -ne 0 ]; then
fail "environment found" fail "environment found"
@ -26,7 +30,9 @@ fi
trace "pass single env, accept single env" trace "pass single env, accept single env"
verbose "test $tid: 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 \ _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=$? r=$?
if [ $r -ne 0 ]; then if [ $r -ne 0 ]; then
fail "environment not found" fail "environment not found"
@ -36,9 +42,10 @@ trace "pass multiple env, accept multiple env"
verbose "test $tid: 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_*" \ _XXX_TEST_A=1 _XXX_TEST_B=2 ${SSH} -oSendEnv="_XXX_TEST_*" \
-F $OBJ/ssh_proxy otherhost \ -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=$? r=$?
if [ $r -ne 0 ]; then if [ $r -ne 0 ]; then
fail "environment not found" fail "environment not found"
fi fi

View File

@ -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. # Placed in the Public Domain.
CTL=$OBJ/ctl-sock CTL=$OBJ/ctl-sock
@ -11,12 +11,13 @@ COPY=$OBJ/ls.copy
start_sshd start_sshd
trace "start master, fork to background" trace "start master, fork to background"
${SSH} -2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" -f somehost \ ${SSH} -2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" -f somehost sleep 120
sleep 120
verbose "test $tid: envpass" verbose "test $tid: envpass"
trace "env passing over multiplexed connection" 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 if [ $? -ne 0 ]; then
fail "environment not found" fail "environment not found"
fi fi