svn commit: samba r19098 - in branches/SAMBA_4_0/source/script/tests: .

metze at samba.org metze at samba.org
Thu Oct 5 11:46:32 GMT 2006


Author: metze
Date: 2006-10-05 11:46:31 +0000 (Thu, 05 Oct 2006)
New Revision: 19098

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19098

Log:
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
Modified:
   branches/SAMBA_4_0/source/script/tests/test_functions.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/test_functions.sh
===================================================================
--- branches/SAMBA_4_0/source/script/tests/test_functions.sh	2006-10-05 11:39:59 UTC (rev 19097)
+++ branches/SAMBA_4_0/source/script/tests/test_functions.sh	2006-10-05 11:46:31 UTC (rev 19098)
@@ -84,11 +84,18 @@
 	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 @@
 		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 @@
 		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 @@
 		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 "=========================================="



More information about the samba-cvs mailing list