1 # $OpenBSD: envpass.sh,v 1.4 2005/03/04 08:48:46 djm Exp $
2 # Placed in the Public Domain.
4 tid
="environment passing"
6 # NB accepted env vars are in test-exec.sh (_XXX_TEST_* and _XXX_TEST)
8 # Prepare a custom config to test for a configuration parsing bug fixed in 4.0
9 cat << EOF > $OBJ/ssh_proxy_envpass
10 Host test-sendenv-confparse-bug
13 cat $OBJ/ssh_proxy
>> $OBJ/ssh_proxy_envpass
15 trace
"pass env, don't accept"
16 verbose
"test $tid: pass env, don't accept"
17 _TEST_ENV
=blah
${SSH} -oSendEnv="*" -F $OBJ/ssh_proxy_envpass otherhost \
23 fail
"environment found"
26 trace
"don't pass env, accept"
27 verbose
"test $tid: don't pass env, accept"
28 _XXX_TEST_A
=1 _XXX_TEST_B
=2 ${SSH} -F $OBJ/ssh_proxy_envpass otherhost \
30 test -z "$_XXX_TEST_A" && test -z "$_XXX_TEST_B"
34 fail
"environment found"
37 trace
"pass single env, accept single env"
38 verbose
"test $tid: pass single env, accept single env"
39 _XXX_TEST
=blah
${SSH} -oSendEnv="_XXX_TEST" -F $OBJ/ssh_proxy_envpass \
41 test X
"$_XXX_TEST" = X
"blah"
45 fail
"environment not found"
48 trace
"pass multiple env, accept multiple env"
49 verbose
"test $tid: pass multiple env, accept multiple env"
50 _XXX_TEST_A
=1 _XXX_TEST_B
=2 ${SSH} -oSendEnv="_XXX_TEST_*" \
51 -F $OBJ/ssh_proxy_envpass otherhost \
53 test X
"$_XXX_TEST_A" = X
"1" -a X
"$_XXX_TEST_B" = X
"2"
57 fail
"environment not found"
60 rm -f $OBJ/ssh_proxy_envpass