]> andersk Git - gssapi-openssh.git/blame - openssh/regress/envpass.sh
Import of OpenSSH 4.0p1
[gssapi-openssh.git] / openssh / regress / envpass.sh
CommitLineData
996d5e62 1# $OpenBSD: envpass.sh,v 1.4 2005/03/04 08:48:46 djm Exp $
c9f39d2c 2# Placed in the Public Domain.
3
4tid="environment passing"
5
6# NB accepted env vars are in test-exec.sh (_XXX_TEST_* and _XXX_TEST)
7
996d5e62 8# Prepare a custom config to test for a configuration parsing bug fixed in 4.0
9cat << EOF > $OBJ/ssh_proxy_envpass
10Host test-sendenv-confparse-bug
11 SendEnv *
12EOF
13cat $OBJ/ssh_proxy >> $OBJ/ssh_proxy_envpass
14
c9f39d2c 15trace "pass env, don't accept"
16verbose "test $tid: pass env, don't accept"
996d5e62 17_TEST_ENV=blah ${SSH} -oSendEnv="*" -F $OBJ/ssh_proxy_envpass otherhost \
c9f39d2c 18 sh << 'EOF'
19 test -z "$_TEST_ENV"
20EOF
21r=$?
22if [ $r -ne 0 ]; then
23 fail "environment found"
24fi
25
26trace "don't pass env, accept"
27verbose "test $tid: don't pass env, accept"
996d5e62 28_XXX_TEST_A=1 _XXX_TEST_B=2 ${SSH} -F $OBJ/ssh_proxy_envpass otherhost \
c9f39d2c 29 sh << 'EOF'
30 test -z "$_XXX_TEST_A" && test -z "$_XXX_TEST_B"
31EOF
32r=$?
33if [ $r -ne 0 ]; then
34 fail "environment found"
35fi
36
37trace "pass single env, accept single env"
38verbose "test $tid: pass single env, accept single env"
996d5e62 39_XXX_TEST=blah ${SSH} -oSendEnv="_XXX_TEST" -F $OBJ/ssh_proxy_envpass \
40 otherhost sh << 'EOF'
c9f39d2c 41 test X"$_XXX_TEST" = X"blah"
42EOF
43r=$?
44if [ $r -ne 0 ]; then
45 fail "environment not found"
46fi
47
48trace "pass multiple env, accept multiple env"
49verbose "test $tid: pass multiple env, accept multiple env"
50_XXX_TEST_A=1 _XXX_TEST_B=2 ${SSH} -oSendEnv="_XXX_TEST_*" \
996d5e62 51 -F $OBJ/ssh_proxy_envpass otherhost \
c9f39d2c 52 sh << 'EOF'
53 test X"$_XXX_TEST_A" = X"1" -a X"$_XXX_TEST_B" = X"2"
54EOF
55r=$?
56if [ $r -ne 0 ]; then
57 fail "environment not found"
58fi
996d5e62 59
60rm -f $OBJ/ssh_proxy_envpass
This page took 0.052936 seconds and 5 git commands to generate.