summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-06-16 20:08:56 +1000
committerDarren Tucker <dtucker@zip.com.au>2004-06-16 20:08:56 +1000
commit4c37ef08abc56fe883e75333f04cf2a7382fce07 (patch)
tree329cf4130304ed7f7b95c1611e771990290d50d7
parenta7ea546f1bec59b045a747f900be1ac67089329b (diff)
- djm@cvs.openbsd.org 2004/04/27 09:47:30
[regress/Makefile regress/test-exec.sh, added regress/envpass.sh] regress test for environment passing, SendEnv & AcceptEnv options; ok markus@
-rw-r--r--ChangeLog8
-rw-r--r--envpass.sh44
-rw-r--r--regress/Makefile3
-rw-r--r--regress/test-exec.sh4
4 files changed, 56 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 024e4f219..1c6382737 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
120040616 120040616
2 - (dtucker) [openbsd-compat/port-aix.c] Expand whitespace -> tabs. No 2 - (dtucker) [openbsd-compat/port-aix.c] Expand whitespace -> tabs. No
3 code changes. 3 code changes.
4 - (dtucker) OpenBSD CVS Sync regress/
5 - djm@cvs.openbsd.org 2004/04/27 09:47:30
6 [Makefile test-exec.sh]
7 regress test for environment passing, SendEnv & AcceptEnv options;
8 ok markus@
9
4 10
520040615 1120040615
6 - (djm) OpenBSD CVS Sync 12 - (djm) OpenBSD CVS Sync
@@ -1226,4 +1232,4 @@
1226 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 1232 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
1227 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 1233 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
1228 1234
1229$Id: ChangeLog,v 1.3388 2004/06/16 02:01:15 dtucker Exp $ 1235$Id: ChangeLog,v 1.3389 2004/06/16 10:08:56 dtucker Exp $
diff --git a/envpass.sh b/envpass.sh
new file mode 100644
index 000000000..67044d421
--- /dev/null
+++ b/envpass.sh
@@ -0,0 +1,44 @@
1# $OpenBSD: envpass.sh,v 1.1 2004/04/27 09:47:30 djm Exp $
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
8trace "pass env, don't accept"
9verbose "test $tid: pass env, don't accept"
10_TEST_ENV=blah ${SSH} -oSendEnv="*" -F $OBJ/ssh_proxy otherhost \
11 '[ -z "$_TEST_ENV" ]'
12r=$?
13if [ $r -ne 0 ]; then
14 fail "environment found"
15fi
16
17trace "don't pass env, accept"
18verbose "test $tid: don't pass env, accept"
19${SSH} -F $OBJ/ssh_proxy otherhost \
20 '[ -z "$_XXX_TEST_A" -a -z "$_XXX_TEST_B" ]'
21r=$?
22if [ $r -ne 0 ]; then
23 fail "environment found"
24fi
25
26trace "pass single env, accept single env"
27verbose "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" ]'
30r=$?
31if [ $r -ne 0 ]; then
32 fail "environment not found"
33fi
34
35trace "pass multiple env, accept multiple env"
36verbose "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" ]'
40r=$?
41if [ $r -ne 0 ]; then
42 fail "environment not found"
43fi
44
diff --git a/regress/Makefile b/regress/Makefile
index cf65b3630..c7e7bb06a 100644
--- a/regress/Makefile
+++ b/regress/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.27 2004/02/17 08:23:20 dtucker Exp $ 1# $OpenBSD: Makefile,v 1.28 2004/04/27 09:47:30 djm Exp $
2 2
3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec 3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec
4tests: $(REGRESS_TARGETS) 4tests: $(REGRESS_TARGETS)
@@ -13,6 +13,7 @@ LTESTS= connect \
13 proto-version \ 13 proto-version \
14 proto-mismatch \ 14 proto-mismatch \
15 exit-status \ 15 exit-status \
16 envpass \
16 transfer \ 17 transfer \
17 banner \ 18 banner \
18 rekey \ 19 rekey \
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index 986d99287..a0df0e957 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: test-exec.sh,v 1.15 2004/02/24 16:56:30 markus Exp $ 1# $OpenBSD: test-exec.sh,v 1.16 2004/04/27 09:47:30 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4PORT=4242 4PORT=4242
@@ -162,6 +162,8 @@ cat << EOF > $OBJ/sshd_config
162 PidFile $PIDFILE 162 PidFile $PIDFILE
163 AuthorizedKeysFile $OBJ/authorized_keys_%u 163 AuthorizedKeysFile $OBJ/authorized_keys_%u
164 LogLevel QUIET 164 LogLevel QUIET
165 AcceptEnv _XXX_TEST_*
166 AcceptEnv _XXX_TEST
165 StrictModes no 167 StrictModes no
166EOF 168EOF
167 169