diff options
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r-- | regress/test-exec.sh | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index b6169f157..40d46e3cd 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: test-exec.sh,v 1.62 2018/03/16 09:06:31 dtucker Exp $ | 1 | # $OpenBSD: test-exec.sh,v 1.64 2018/08/10 01:35:49 dtucker Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | #SUDO=sudo | 4 | #SUDO=sudo |
@@ -76,6 +76,9 @@ SFTP=sftp | |||
76 | SFTPSERVER=/usr/libexec/openssh/sftp-server | 76 | SFTPSERVER=/usr/libexec/openssh/sftp-server |
77 | SCP=scp | 77 | SCP=scp |
78 | 78 | ||
79 | # Set by make_tmpdir() on demand (below). | ||
80 | SSH_REGRESS_TMP= | ||
81 | |||
79 | # Interop testing | 82 | # Interop testing |
80 | PLINK=plink | 83 | PLINK=plink |
81 | PUTTYGEN=puttygen | 84 | PUTTYGEN=puttygen |
@@ -163,9 +166,13 @@ if [ "x$USE_VALGRIND" != "x" ]; then | |||
163 | esac | 166 | esac |
164 | 167 | ||
165 | if [ x"$VG_SKIP" = "x" ]; then | 168 | if [ x"$VG_SKIP" = "x" ]; then |
169 | VG_LEAK="--leak-check=no" | ||
170 | if [ x"$VALGRIND_CHECK_LEAKS" != "x" ]; then | ||
171 | VG_LEAK="--leak-check=full" | ||
172 | fi | ||
166 | VG_IGNORE="/bin/*,/sbin/*,/usr/*,/var/*" | 173 | VG_IGNORE="/bin/*,/sbin/*,/usr/*,/var/*" |
167 | VG_LOG="$OBJ/valgrind-out/${VG_TEST}." | 174 | VG_LOG="$OBJ/valgrind-out/${VG_TEST}." |
168 | VG_OPTS="--track-origins=yes --leak-check=full" | 175 | VG_OPTS="--track-origins=yes $VG_LEAK" |
169 | VG_OPTS="$VG_OPTS --trace-children=yes" | 176 | VG_OPTS="$VG_OPTS --trace-children=yes" |
170 | VG_OPTS="$VG_OPTS --trace-children-skip=${VG_IGNORE}" | 177 | VG_OPTS="$VG_OPTS --trace-children-skip=${VG_IGNORE}" |
171 | VG_PATH="valgrind" | 178 | VG_PATH="valgrind" |
@@ -318,6 +325,12 @@ stop_sshd () | |||
318 | fi | 325 | fi |
319 | } | 326 | } |
320 | 327 | ||
328 | make_tmpdir () | ||
329 | { | ||
330 | SSH_REGRESS_TMP="$($OBJ/mkdtemp openssh-XXXXXXXX)" || \ | ||
331 | fatal "failed to create temporary directory" | ||
332 | } | ||
333 | |||
321 | # helper | 334 | # helper |
322 | cleanup () | 335 | cleanup () |
323 | { | 336 | { |
@@ -328,6 +341,9 @@ cleanup () | |||
328 | kill $SSH_PID | 341 | kill $SSH_PID |
329 | fi | 342 | fi |
330 | fi | 343 | fi |
344 | if [ "x$SSH_REGRESS_TMP" != "x" ]; then | ||
345 | rm -rf "$SSH_REGRESS_TMP" | ||
346 | fi | ||
331 | stop_sshd | 347 | stop_sshd |
332 | } | 348 | } |
333 | 349 | ||
@@ -375,7 +391,10 @@ fail () | |||
375 | save_debug_log "FAIL: $@" | 391 | save_debug_log "FAIL: $@" |
376 | RESULT=1 | 392 | RESULT=1 |
377 | echo "$@" | 393 | echo "$@" |
378 | 394 | if test "x$TEST_SSH_FAIL_FATAL" != "x" ; then | |
395 | cleanup | ||
396 | exit $RESULT | ||
397 | fi | ||
379 | } | 398 | } |
380 | 399 | ||
381 | fatal () | 400 | fatal () |
@@ -512,10 +531,13 @@ if test "$REGRESS_INTEROP_PUTTY" = "yes" ; then | |||
512 | >> $OBJ/authorized_keys_$USER | 531 | >> $OBJ/authorized_keys_$USER |
513 | 532 | ||
514 | # Convert rsa2 host key to PuTTY format | 533 | # Convert rsa2 host key to PuTTY format |
515 | ${SRC}/ssh2putty.sh 127.0.0.1 $PORT $OBJ/rsa > \ | 534 | cp $OBJ/rsa $OBJ/rsa_oldfmt |
535 | ${SSHKEYGEN} -p -N '' -m PEM -f $OBJ/rsa_oldfmt >/dev/null | ||
536 | ${SRC}/ssh2putty.sh 127.0.0.1 $PORT $OBJ/rsa_oldfmt > \ | ||
516 | ${OBJ}/.putty/sshhostkeys | 537 | ${OBJ}/.putty/sshhostkeys |
517 | ${SRC}/ssh2putty.sh 127.0.0.1 22 $OBJ/rsa >> \ | 538 | ${SRC}/ssh2putty.sh 127.0.0.1 22 $OBJ/rsa_oldfmt >> \ |
518 | ${OBJ}/.putty/sshhostkeys | 539 | ${OBJ}/.putty/sshhostkeys |
540 | rm -f $OBJ/rsa_oldfmt | ||
519 | 541 | ||
520 | # Setup proxied session | 542 | # Setup proxied session |
521 | mkdir -p ${OBJ}/.putty/sessions | 543 | mkdir -p ${OBJ}/.putty/sessions |