summaryrefslogtreecommitdiff
path: root/source3/script
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-05 11:52:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:12 -0500
commit4366ca702dbb1566ee5dc8ffca95a36cf83032a5 (patch)
tree23dceda7efa404d2a15f717ba83256cb347c1574 /source3/script
parentf9449b752f7ebab56361f0aa75de4f424217dfec (diff)
downloadsamba-4366ca702dbb1566ee5dc8ffca95a36cf83032a5.tar.gz
samba-4366ca702dbb1566ee5dc8ffca95a36cf83032a5.tar.bz2
samba-4366ca702dbb1566ee5dc8ffca95a36cf83032a5.zip
r19100: merge from samba4:
export MAKE_TEST_ENABLE_PCAP=yes enables SOCKET_WRAPPER_PCAP_FILE support in make test metze (This used to be commit 5faf816885b7a1bca5a25ab1ef5151d4e364cbda)
Diffstat (limited to 'source3/script')
-rw-r--r--source3/script/tests/test_functions.sh25
1 files changed, 20 insertions, 5 deletions
diff --git a/source3/script/tests/test_functions.sh b/source3/script/tests/test_functions.sh
index 06c77c89d5..badbdd5b8e 100644
--- a/source3/script/tests/test_functions.sh
+++ b/source3/script/tests/test_functions.sh
@@ -133,11 +133,18 @@ testit() {
fi
name=$1
shift 1
- SERVERS_ARE_UP="no"
- TEST_LOG="$PREFIX/test_log.$$"
- trap "rm -f $TEST_LOG" EXIT
cmdline="$*"
+ SERVERS_ARE_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 [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
echo "--==--==--==--==--==--==--==--==--==--==--"
echo "Running test $name (level 0 stdout)"
@@ -160,7 +167,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=$?
if [ x"$status" != x"0" ]; then
@@ -171,6 +183,9 @@ testit() {
samba3_smbd_test_log && echo "SMBD OUTPUT:";
samba3_smbd_test_log && cat $SMBD_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)"
@@ -180,7 +195,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 "=========================================="