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.sh41
1 files changed, 38 insertions, 3 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index 83c7d02e6..5e48bfbe3 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"
@@ -593,6 +603,31 @@ start_sshd ()
593 603
594# kill sshd 604# kill sshd
595cleanup 605cleanup
606
607if [ "x$USE_VALGRIND" != "x" ]; then
608 # wait for any running process to complete
609 wait; sleep 1
610 VG_RESULTS=$(find $OBJ/valgrind-out -type f -print)
611 VG_RESULT_COUNT=0
612 VG_FAIL_COUNT=0
613 for i in $VG_RESULTS; do
614 if grep "ERROR SUMMARY" $i >/dev/null; then
615 VG_RESULT_COUNT=$(($VG_RESULT_COUNT + 1))
616 if ! grep "ERROR SUMMARY: 0 errors" $i >/dev/null; then
617 VG_FAIL_COUNT=$(($VG_FAIL_COUNT + 1))
618 RESULT=1
619 verbose valgrind failure $i
620 cat $i
621 fi
622 fi
623 done
624 if [ x"$VG_SKIP" != "x" ]; then
625 verbose valgrind skipped
626 else
627 verbose valgrind results $VG_RESULT_COUNT failures $VG_FAIL_COUNT
628 fi
629fi
630
596if [ $RESULT -eq 0 ]; then 631if [ $RESULT -eq 0 ]; then
597 verbose ok $tid 632 verbose ok $tid
598else 633else