diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-06-16 20:08:56 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-06-16 20:08:56 +1000 |
commit | 4c37ef08abc56fe883e75333f04cf2a7382fce07 (patch) | |
tree | 329cf4130304ed7f7b95c1611e771990290d50d7 | |
parent | a7ea546f1bec59b045a747f900be1ac67089329b (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-- | ChangeLog | 8 | ||||
-rw-r--r-- | envpass.sh | 44 | ||||
-rw-r--r-- | regress/Makefile | 3 | ||||
-rw-r--r-- | regress/test-exec.sh | 4 |
4 files changed, 56 insertions, 3 deletions
@@ -1,6 +1,12 @@ | |||
1 | 20040616 | 1 | 20040616 |
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 | ||
5 | 20040615 | 11 | 20040615 |
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 | |||
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 | |||
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 | ||
3 | REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec | 3 | REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec |
4 | tests: $(REGRESS_TARGETS) | 4 | tests: $(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 | ||
4 | PORT=4242 | 4 | PORT=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 |
166 | EOF | 168 | EOF |
167 | 169 | ||