summaryrefslogtreecommitdiff
path: root/regress/test-exec.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r--regress/test-exec.sh51
1 files changed, 43 insertions, 8 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index b8e2009de..508b93284 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: test-exec.sh,v 1.65 2019/01/27 06:30:53 dtucker Exp $ 1# $OpenBSD: test-exec.sh,v 1.66 2019/07/05 04:12:46 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4#SUDO=sudo 4#SUDO=sudo
@@ -152,13 +152,22 @@ SFTPSERVER_BIN=${SFTPSERVER}
152SCP_BIN=${SCP} 152SCP_BIN=${SCP}
153 153
154if [ "x$USE_VALGRIND" != "x" ]; then 154if [ "x$USE_VALGRIND" != "x" ]; then
155 mkdir -p $OBJ/valgrind-out 155 rm -rf $OBJ/valgrind-out $OBJ/valgrind-vgdb
156 mkdir -p $OBJ/valgrind-out $OBJ/valgrind-vgdb
157 # When using sudo ensure low-priv tests can write pipes and logs.
158 if [ "x$SUDO" != "x" ]; then
159 chmod 777 $OBJ/valgrind-out $OBJ/valgrind-vgdb
160 fi
156 VG_TEST=`basename $SCRIPT .sh` 161 VG_TEST=`basename $SCRIPT .sh`
157 162
158 # Some tests are difficult to fix. 163 # Some tests are difficult to fix.
159 case "$VG_TEST" in 164 case "$VG_TEST" in
160 connect-privsep|reexec) 165 reexec)
161 VG_SKIP=1 ;; 166 VG_SKIP=1 ;;
167 sftp-chroot)
168 if [ "x${SUDO}" != "x" ]; then
169 VG_SKIP=1
170 fi ;;
162 esac 171 esac
163 172
164 if [ x"$VG_SKIP" = "x" ]; then 173 if [ x"$VG_SKIP" = "x" ]; then
@@ -171,6 +180,7 @@ if [ "x$USE_VALGRIND" != "x" ]; then
171 VG_OPTS="--track-origins=yes $VG_LEAK" 180 VG_OPTS="--track-origins=yes $VG_LEAK"
172 VG_OPTS="$VG_OPTS --trace-children=yes" 181 VG_OPTS="$VG_OPTS --trace-children=yes"
173 VG_OPTS="$VG_OPTS --trace-children-skip=${VG_IGNORE}" 182 VG_OPTS="$VG_OPTS --trace-children-skip=${VG_IGNORE}"
183 VG_OPTS="$VG_OPTS --vgdb-prefix=$OBJ/valgrind-vgdb/"
174 VG_PATH="valgrind" 184 VG_PATH="valgrind"
175 if [ "x$VALGRIND_PATH" != "x" ]; then 185 if [ "x$VALGRIND_PATH" != "x" ]; then
176 VG_PATH="$VALGRIND_PATH" 186 VG_PATH="$VALGRIND_PATH"
@@ -527,13 +537,13 @@ if test "$REGRESS_INTEROP_PUTTY" = "yes" ; then
527 >> $OBJ/authorized_keys_$USER 537 >> $OBJ/authorized_keys_$USER
528 538
529 # Convert rsa2 host key to PuTTY format 539 # Convert rsa2 host key to PuTTY format
530 cp $OBJ/rsa $OBJ/rsa_oldfmt 540 cp $OBJ/ssh-rsa $OBJ/ssh-rsa_oldfmt
531 ${SSHKEYGEN} -p -N '' -m PEM -f $OBJ/rsa_oldfmt >/dev/null 541 ${SSHKEYGEN} -p -N '' -m PEM -f $OBJ/ssh-rsa_oldfmt >/dev/null
532 ${SRC}/ssh2putty.sh 127.0.0.1 $PORT $OBJ/rsa_oldfmt > \ 542 ${SRC}/ssh2putty.sh 127.0.0.1 $PORT $OBJ/ssh-rsa_oldfmt > \
533 ${OBJ}/.putty/sshhostkeys 543 ${OBJ}/.putty/sshhostkeys
534 ${SRC}/ssh2putty.sh 127.0.0.1 22 $OBJ/rsa_oldfmt >> \ 544 ${SRC}/ssh2putty.sh 127.0.0.1 22 $OBJ/ssh-rsa_oldfmt >> \
535 ${OBJ}/.putty/sshhostkeys 545 ${OBJ}/.putty/sshhostkeys
536 rm -f $OBJ/rsa_oldfmt 546 rm -f $OBJ/ssh-rsa_oldfmt
537 547
538 # Setup proxied session 548 # Setup proxied session
539 mkdir -p ${OBJ}/.putty/sessions 549 mkdir -p ${OBJ}/.putty/sessions
@@ -581,6 +591,31 @@ start_sshd ()
581 591
582# kill sshd 592# kill sshd
583cleanup 593cleanup
594
595if [ "x$USE_VALGRIND" != "x" ]; then
596 # wait for any running process to complete
597 wait; sleep 1
598 VG_RESULTS=$(find $OBJ/valgrind-out -type f -print)
599 VG_RESULT_COUNT=0
600 VG_FAIL_COUNT=0
601 for i in $VG_RESULTS; do
602 if grep "ERROR SUMMARY" $i >/dev/null; then
603 VG_RESULT_COUNT=$(($VG_RESULT_COUNT + 1))
604 if ! grep "ERROR SUMMARY: 0 errors" $i >/dev/null; then
605 VG_FAIL_COUNT=$(($VG_FAIL_COUNT + 1))
606 RESULT=1
607 verbose valgrind failure $i
608 cat $i
609 fi
610 fi
611 done
612 if [ x"$VG_SKIP" != "x" ]; then
613 verbose valgrind skipped
614 else
615 verbose valgrind results $VG_RESULT_COUNT failures $VG_FAIL_COUNT
616 fi
617fi
618
584if [ $RESULT -eq 0 ]; then 619if [ $RESULT -eq 0 ]; then
585 verbose ok $tid 620 verbose ok $tid
586else 621else