summaryrefslogtreecommitdiff
path: root/regress/envpass.sh
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/envpass.sh
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/envpass.sh')
-rw-r--r--regress/envpass.sh19
1 files changed, 13 insertions, 6 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