diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/login-timeout.sh | 4 | ||||
-rw-r--r-- | regress/reexec.sh | 11 | ||||
-rw-r--r-- | regress/test-exec.sh | 25 |
3 files changed, 21 insertions, 19 deletions
diff --git a/regress/login-timeout.sh b/regress/login-timeout.sh index eb76f554b..12207fd99 100644 --- a/regress/login-timeout.sh +++ b/regress/login-timeout.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: login-timeout.sh,v 1.7 2014/03/13 20:44:49 djm Exp $ | 1 | # $OpenBSD: login-timeout.sh,v 1.8 2016/12/16 01:06:27 dtucker Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="connect after login grace timeout" | 4 | tid="connect after login grace timeout" |
@@ -17,7 +17,7 @@ if [ $? -ne 0 ]; then | |||
17 | fail "ssh connect after login grace timeout failed with privsep" | 17 | fail "ssh connect after login grace timeout failed with privsep" |
18 | fi | 18 | fi |
19 | 19 | ||
20 | $SUDO kill `$SUDO cat $PIDFILE` | 20 | stop_sshd |
21 | 21 | ||
22 | trace "test login grace without privsep" | 22 | trace "test login grace without privsep" |
23 | echo "UsePrivilegeSeparation no" >> $OBJ/sshd_config | 23 | echo "UsePrivilegeSeparation no" >> $OBJ/sshd_config |
diff --git a/regress/reexec.sh b/regress/reexec.sh index 6ac648fd3..72957d4cd 100644 --- a/regress/reexec.sh +++ b/regress/reexec.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: reexec.sh,v 1.9 2016/12/15 23:50:37 dtucker Exp $ | 1 | # $OpenBSD: reexec.sh,v 1.10 2016/12/16 01:06:27 dtucker Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="reexec tests" | 4 | tid="reexec tests" |
@@ -39,8 +39,7 @@ echo "InvalidXXX=no" >> $OBJ/sshd_config | |||
39 | 39 | ||
40 | copy_tests | 40 | copy_tests |
41 | 41 | ||
42 | $SUDO kill `$SUDO cat $PIDFILE` | 42 | stop_sshd |
43 | rm -f $PIDFILE | ||
44 | 43 | ||
45 | cp $OBJ/sshd_config.orig $OBJ/sshd_config | 44 | cp $OBJ/sshd_config.orig $OBJ/sshd_config |
46 | 45 | ||
@@ -54,8 +53,7 @@ rm -f $SSHD_COPY | |||
54 | 53 | ||
55 | copy_tests | 54 | copy_tests |
56 | 55 | ||
57 | $SUDO kill `$SUDO cat $PIDFILE` | 56 | stop_sshd |
58 | rm -f $PIDFILE | ||
59 | 57 | ||
60 | verbose "test reexec fallback without privsep" | 58 | verbose "test reexec fallback without privsep" |
61 | 59 | ||
@@ -67,7 +65,6 @@ rm -f $SSHD_COPY | |||
67 | 65 | ||
68 | copy_tests | 66 | copy_tests |
69 | 67 | ||
70 | $SUDO kill `$SUDO cat $PIDFILE` | 68 | stop_sshd |
71 | rm -f $PIDFILE | ||
72 | 69 | ||
73 | fi | 70 | fi |
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index 5d48706d4..bfa48803b 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: test-exec.sh,v 1.57 2016/11/25 03:02:01 dtucker Exp $ | 1 | # $OpenBSD: test-exec.sh,v 1.58 2016/12/16 01:06:27 dtucker Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | #SUDO=sudo | 4 | #SUDO=sudo |
@@ -293,16 +293,8 @@ md5 () { | |||
293 | } | 293 | } |
294 | # End of portable specific functions | 294 | # End of portable specific functions |
295 | 295 | ||
296 | # helper | 296 | stop_sshd () |
297 | cleanup () | ||
298 | { | 297 | { |
299 | if [ "x$SSH_PID" != "x" ]; then | ||
300 | if [ $SSH_PID -lt 2 ]; then | ||
301 | echo bad pid for ssh: $SSH_PID | ||
302 | else | ||
303 | kill $SSH_PID | ||
304 | fi | ||
305 | fi | ||
306 | if [ -f $PIDFILE ]; then | 298 | if [ -f $PIDFILE ]; then |
307 | pid=`$SUDO cat $PIDFILE` | 299 | pid=`$SUDO cat $PIDFILE` |
308 | if [ "X$pid" = "X" ]; then | 300 | if [ "X$pid" = "X" ]; then |
@@ -325,6 +317,19 @@ cleanup () | |||
325 | fi | 317 | fi |
326 | } | 318 | } |
327 | 319 | ||
320 | # helper | ||
321 | cleanup () | ||
322 | { | ||
323 | if [ "x$SSH_PID" != "x" ]; then | ||
324 | if [ $SSH_PID -lt 2 ]; then | ||
325 | echo bad pid for ssh: $SSH_PID | ||
326 | else | ||
327 | kill $SSH_PID | ||
328 | fi | ||
329 | fi | ||
330 | stop_sshd | ||
331 | } | ||
332 | |||
328 | start_debug_log () | 333 | start_debug_log () |
329 | { | 334 | { |
330 | echo "trace: $@" >$TEST_REGRESS_LOGFILE | 335 | echo "trace: $@" >$TEST_REGRESS_LOGFILE |