Darren Tucker | 4c37ef0 | 2004-06-16 20:08:56 +1000 | [diff] [blame] | 1 | # $OpenBSD: envpass.sh,v 1.1 2004/04/27 09:47:30 djm Exp $ |
| 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="environment passing" |
| 5 | |
| 6 | # NB accepted env vars are in test-exec.sh (_XXX_TEST_* and _XXX_TEST) |
| 7 | |
| 8 | trace "pass env, don't accept" |
| 9 | verbose "test $tid: pass env, don't accept" |
| 10 | _TEST_ENV=blah ${SSH} -oSendEnv="*" -F $OBJ/ssh_proxy otherhost \ |
| 11 | '[ -z "$_TEST_ENV" ]' |
| 12 | r=$? |
| 13 | if [ $r -ne 0 ]; then |
| 14 | fail "environment found" |
| 15 | fi |
| 16 | |
| 17 | trace "don't pass env, accept" |
| 18 | verbose "test $tid: don't pass env, accept" |
| 19 | ${SSH} -F $OBJ/ssh_proxy otherhost \ |
| 20 | '[ -z "$_XXX_TEST_A" -a -z "$_XXX_TEST_B" ]' |
| 21 | r=$? |
| 22 | if [ $r -ne 0 ]; then |
| 23 | fail "environment found" |
| 24 | fi |
| 25 | |
| 26 | trace "pass single env, accept single env" |
| 27 | verbose "test $tid: pass single env, accept single env" |
| 28 | _XXX_TEST=blah ${SSH} -oSendEnv="_XXX_TEST" -F $OBJ/ssh_proxy otherhost \ |
| 29 | '[ "x$_XXX_TEST" = "xblah" ]' |
| 30 | r=$? |
| 31 | if [ $r -ne 0 ]; then |
| 32 | fail "environment not found" |
| 33 | fi |
| 34 | |
| 35 | trace "pass multiple env, accept multiple env" |
| 36 | verbose "test $tid: pass multiple env, accept multiple env" |
| 37 | _XXX_TEST_A=1 _XXX_TEST_B=2 ${SSH} -oSendEnv="_XXX_TEST_*" \ |
| 38 | -F $OBJ/ssh_proxy otherhost \ |
| 39 | '[ "x$_XXX_TEST_A" = "x1" -a "x$_XXX_TEST_B" = "x2" ]' |
| 40 | r=$? |
| 41 | if [ $r -ne 0 ]; then |
| 42 | fail "environment not found" |
| 43 | fi |
| 44 | |