summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-05 11:46:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:35 -0500
commit4b35dc53fe2530fd51427fe40dfb3c1dc2c4bc9b (patch)
tree519a917c11de44021ef0eb12735ecf212e191afd /source4
parente6f16b74212832790b97998c1b1bdf6b74adc4e3 (diff)
downloadsamba-4b35dc53fe2530fd51427fe40dfb3c1dc2c4bc9b.tar.gz
samba-4b35dc53fe2530fd51427fe40dfb3c1dc2c4bc9b.tar.bz2
samba-4b35dc53fe2530fd51427fe40dfb3c1dc2c4bc9b.zip
r19098: with
export MAKE_TEST_ENABLE_PCAP=yes make test will use SOCKET_WRAPPER_PCAP_FILE support and will run each test with a different file the capture will be removed unless the test fails. the TEST PCAP: line will show the location of the file metze (This used to be commit 5095783cdf01db9d28392ba0d88186c1a4df654b)
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/script/tests/test_functions.sh25
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 "=========================================="