diff options
Diffstat (limited to 'source4/script/tests')
-rwxr-xr-x | source4/script/tests/test_functions.sh | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source4/script/tests/test_functions.sh b/source4/script/tests/test_functions.sh index 29b03faf42..b68b16edc3 100755 --- a/source4/script/tests/test_functions.sh +++ b/source4/script/tests/test_functions.sh @@ -84,11 +84,18 @@ testit() { fi name=$1 shift 1 - SMBD_IS_UP="no" - TEST_LOG="$PREFIX/test_log.$$" - trap "rm -f $TEST_LOG" EXIT cmdline="$*" + SMBD_IS_UP="no" + + shname=`echo $name | \ + sed -e 's%[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\-]%_%g'` + + UNIQUE_PID=`/bin/sh -c 'echo $$'` + TEST_LOG="$PREFIX/test_log.${UNIQUE_PID}" + TEST_PCAP="$PREFIX/test_${shname}_${UNIQUE_PID}.pcap" + trap "rm -f $TEST_LOG $TEST_PCAP" EXIT + if [ -z "$smbd_log_size" ]; then smbd_log_size=`wc -l < $SMBD_TEST_LOG`; fi @@ -120,7 +127,12 @@ testit() { fi return 1 fi - + + if [ x"$MAKE_TEST_ENABLE_PCAP" = x"yes" ];then + SOCKET_WRAPPER_PCAP_FILE=$TEST_PCAP + export SOCKET_WRAPPER_PCAP_FILE + fi + ( $cmdline > $TEST_LOG 2>&1 ) status=$? # show any additional output from smbd that has happened in this test @@ -137,6 +149,9 @@ testit() { echo "TEST OUTPUT:" cat $TEST_LOG; rm -f $TEST_LOG; + if [ x"$MAKE_TEST_ENABLE_PCAP" = x"yes" ];then + echo "TEST PCAP: $TEST_PCAP" + fi if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then echo "==========================================" echo "TEST FAILED: $name (status $status)" @@ -146,7 +161,7 @@ testit() { fi return 1; fi - rm -f $TEST_LOG; + rm -f $TEST_LOG $TEST_PCAP; if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then echo "ALL OK: $cmdline" echo "==========================================" |