summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-06-22 13:38:56 +1000
committerDarren Tucker <dtucker@zip.com.au>2004-06-22 13:38:56 +1000
commit430c6a1552e25a1163e6fa1bade9a276791679a6 (patch)
treeb9186fd4ca4d89aaeabcaa81b059e6df7346f66c /regress
parente35bf12eebca0c3ca248dca4c04bff83b9c475a1 (diff)
- markus@cvs.openbsd.org 2004/06/22 03:12:13
[regress/envpass.sh regress/multiplex.sh] more portable env passing tests
Diffstat (limited to 'regress')
-rw-r--r--regress/envpass.sh19
-rw-r--r--regress/multiplex.sh9
2 files changed, 18 insertions, 10 deletions
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 @@
1# $OpenBSD: envpass.sh,v 1.1 2004/04/27 09:47:30 djm Exp $ 1# $OpenBSD: envpass.sh,v 1.2 2004/06/22 03:12:13 markus Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="environment passing" 4tid="environment passing"
@@ -8,7 +8,9 @@ tid="environment passing"
8trace "pass env, don't accept" 8trace "pass env, don't accept"
9verbose "test $tid: pass env, don't accept" 9verbose "test $tid: pass env, don't accept"
10_TEST_ENV=blah ${SSH} -oSendEnv="*" -F $OBJ/ssh_proxy otherhost \ 10_TEST_ENV=blah ${SSH} -oSendEnv="*" -F $OBJ/ssh_proxy otherhost \
11 '[ -z "$_TEST_ENV" ]' 11 sh << 'EOF'
12 test -z $_TEST_ENV
13EOF
12r=$? 14r=$?
13if [ $r -ne 0 ]; then 15if [ $r -ne 0 ]; then
14 fail "environment found" 16 fail "environment found"
@@ -17,7 +19,9 @@ fi
17trace "don't pass env, accept" 19trace "don't pass env, accept"
18verbose "test $tid: don't pass env, accept" 20verbose "test $tid: don't pass env, accept"
19${SSH} -F $OBJ/ssh_proxy otherhost \ 21${SSH} -F $OBJ/ssh_proxy otherhost \
20 '[ -z "$_XXX_TEST_A" -a -z "$_XXX_TEST_B" ]' 22 sh << 'EOF'
23 test -z $_XXX_TEST_A && test -z $_XXX_TEST_B
24EOF
21r=$? 25r=$?
22if [ $r -ne 0 ]; then 26if [ $r -ne 0 ]; then
23 fail "environment found" 27 fail "environment found"
@@ -26,7 +30,9 @@ fi
26trace "pass single env, accept single env" 30trace "pass single env, accept single env"
27verbose "test $tid: pass single env, accept single env" 31verbose "test $tid: pass single env, accept single env"
28_XXX_TEST=blah ${SSH} -oSendEnv="_XXX_TEST" -F $OBJ/ssh_proxy otherhost \ 32_XXX_TEST=blah ${SSH} -oSendEnv="_XXX_TEST" -F $OBJ/ssh_proxy otherhost \
29 '[ "x$_XXX_TEST" = "xblah" ]' 33 sh << 'EOF'
34 test X"$_XXX_TEST" = X"blah"
35EOF
30r=$? 36r=$?
31if [ $r -ne 0 ]; then 37if [ $r -ne 0 ]; then
32 fail "environment not found" 38 fail "environment not found"
@@ -36,9 +42,10 @@ trace "pass multiple env, accept multiple env"
36verbose "test $tid: pass multiple env, accept multiple env" 42verbose "test $tid: pass multiple env, accept multiple env"
37_XXX_TEST_A=1 _XXX_TEST_B=2 ${SSH} -oSendEnv="_XXX_TEST_*" \ 43_XXX_TEST_A=1 _XXX_TEST_B=2 ${SSH} -oSendEnv="_XXX_TEST_*" \
38 -F $OBJ/ssh_proxy otherhost \ 44 -F $OBJ/ssh_proxy otherhost \
39 '[ "x$_XXX_TEST_A" = "x1" -a "x$_XXX_TEST_B" = "x2" ]' 45 sh << 'EOF'
46 test X"$_XXX_TEST_A" = X"1" -a X"$_XXX_TEST_B" = X"2"
47EOF
40r=$? 48r=$?
41if [ $r -ne 0 ]; then 49if [ $r -ne 0 ]; then
42 fail "environment not found" 50 fail "environment not found"
43fi 51fi
44
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 @@
1# $OpenBSD: multiplex.sh,v 1.7 2004/06/18 06:15:51 dtucker Exp $ 1# $OpenBSD: multiplex.sh,v 1.8 2004/06/22 03:12:13 markus Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4CTL=$OBJ/ctl-sock 4CTL=$OBJ/ctl-sock
@@ -11,12 +11,13 @@ COPY=$OBJ/ls.copy
11start_sshd 11start_sshd
12 12
13trace "start master, fork to background" 13trace "start master, fork to background"
14${SSH} -2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" -f somehost \ 14${SSH} -2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" -f somehost sleep 120
15 sleep 120
16 15
17verbose "test $tid: envpass" 16verbose "test $tid: envpass"
18trace "env passing over multiplexed connection" 17trace "env passing over multiplexed connection"
19_XXX_TEST=blah ${SSH} -S$CTL otherhost '[ "x$_XXX_TEST" = "xblah" ]' 18_XXX_TEST=blah ${SSH} -oSendEnv="_XXX_TEST" -S$CTL otherhost sh << 'EOF'
19 test X"$_XXX_TEST" = X"blah"
20EOF
20if [ $? -ne 0 ]; then 21if [ $? -ne 0 ]; then
21 fail "environment not found" 22 fail "environment not found"
22fi 23fi