svn commit: samba r14679 - in trunk/source/script/tests: .

metze at samba.org metze at samba.org
Thu Mar 23 14:56:00 GMT 2006


Author: metze
Date: 2006-03-23 14:55:59 +0000 (Thu, 23 Mar 2006)
New Revision: 14679

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

Log:
- we need to use 127.0.0.2/8 as interface for the server
  as nmbd skip interfaces with address 127.0.0.1
- add samba3 smbclient -L tests
- add samba3 smbtorture tests

metze
Added:
   trunk/source/script/tests/test_smbclient_s3.sh
   trunk/source/script/tests/test_smbtorture_s3.sh
Modified:
   trunk/source/script/tests/selftest.sh
   trunk/source/script/tests/test_functions.sh
   trunk/source/script/tests/test_posix_s3.sh
   trunk/source/script/tests/tests_all.sh


Changeset:
Modified: trunk/source/script/tests/selftest.sh
===================================================================
--- trunk/source/script/tests/selftest.sh	2006-03-23 14:55:38 UTC (rev 14678)
+++ trunk/source/script/tests/selftest.sh	2006-03-23 14:55:59 UTC (rev 14679)
@@ -26,7 +26,8 @@
 ## setup the various environment variables we need
 ##
 
-SERVER=localhost
+SERVER=localhost2
+SERVER_IP=127.0.0.2
 USERNAME=`whoami`
 PASSWORD=test
 
@@ -35,7 +36,8 @@
 SHRDIR=$PREFIX_ABS/tmp
 LIBDIR=$PREFIX_ABS/lib
 PIDDIR=$PREFIX_ABS/pid
-CONFFILE=$LIBDIR/smb.conf
+CONFFILE=$LIBDIR/client.conf
+SERVERCONFFILE=$LIBDIR/server.conf
 COMMONCONFFILE=$LIBDIR/common.conf
 PRIVATEDIR=$PREFIX_ABS/private
 LOCKDIR=$PREFIX_ABS/lockdir
@@ -44,10 +46,11 @@
 CONFIGURATION="-s $CONFFILE"
 
 export PREFIX_ABS CONFIGURATION CONFFILE PATH SOCKET_WRAPPER_DIR DOMAIN
-export PRIVATEDIR LIBDIR PIDDIR LOCKDIR LOGDIR
+export PRIVATEDIR LIBDIR PIDDIR LOCKDIR LOGDIR SERVERCONFFILE
 export SRCDIR SCRIPTDIR
 export USERNAME PASSWORD
 export SMBTORTURE4
+export SERVER SERVER_IP
 
 PATH=bin:$PATH
 export PATH
@@ -78,7 +81,6 @@
 ##
 
 cat >$COMMONCONFFILE<<EOF
-	netbios name = LOCALHOST
 	workgroup = SAMBA-TEST
 
 	private dir = $PRIVATEDIR
@@ -91,16 +93,23 @@
 
 	name resolve order = bcast
 
-	interfaces = 127.0.0.1/8
-	bind interfaces only = yes
-
 	panic action = $SCRIPTDIR/gdb_backtrace %d
 EOF
 
 cat >$CONFFILE<<EOF
 [global]
+	netbios name = TORTURE26
+	interfaces = 127.0.0.26/8
 	include = $COMMONCONFFILE
+EOF
 
+cat >$SERVERCONFFILE<<EOF
+[global]
+	netbios name = $SERVER
+	interfaces = $SERVER_IP/8
+	bind interfaces only = yes
+	include = $COMMONCONFFILE
+
 [tmp]
 	path = $PREFIX_ABS/tmp
 	read only = no
@@ -133,7 +142,7 @@
 
 . $SCRIPTDIR/test_functions.sh
 
-SOCKET_WRAPPER_DEFAULT_IFACE=1
+SOCKET_WRAPPER_DEFAULT_IFACE=2
 export SOCKET_WRAPPER_DEFAULT_IFACE
 samba3_check_or_start
 
@@ -156,12 +165,18 @@
 START=`date`
 (
  # give time for nbt server to register its names
- echo delaying for nbt name registration
+ echo "delaying for nbt name registration"
  sleep 4
  # This will return quickly when things are up, but be slow if we need to wait for (eg) SSL init 
- bin/nmblookup $CONFIGURATION -U $SERVER $SERVER
- bin/nmblookup $CONFIGURATION -U $SERVER $SERVER
- bin/nmblookup $CONFIGURATION -U $SERVER $SERVER
+ bin/nmblookup $CONFIGURATION -U $SERVER_IP __SAMBA__
+ bin/nmblookup $CONFIGURATION __SAMBA__
+ bin/nmblookup $CONFIGURATION -U 127.255.255.255 __SAMBA__
+ bin/nmblookup $CONFIGURATION -U $SERVER_IP $SERVER
+ bin/nmblookup $CONFIGURATION $SERVER
+ # make sure smbd is also up set
+ echo "wait for smbd"
+ bin/smbclient $CONFIGURATION -L $SERVER_IP -N -p 139 | head -2
+ bin/smbclient $CONFIGURATION -L $SERVER_IP -N -p 139 | head -2
 
  failed=0
 

Modified: trunk/source/script/tests/test_functions.sh
===================================================================
--- trunk/source/script/tests/test_functions.sh	2006-03-23 14:55:38 UTC (rev 14678)
+++ trunk/source/script/tests/test_functions.sh	2006-03-23 14:55:59 UTC (rev 14679)
@@ -43,7 +43,7 @@
 			if [ -z "$NMBD_MAXTIME" ]; then
 			    NMBD_MAXTIME=2700
 			fi
-			timelimit $NMBD_MAXTIME $SMBD_VALGRIND $SRCDIR/bin/nmbd -F -S --no-process-group -d1 -s $CONFFILE > $NMBD_TEST_LOG 2>&1 &
+			timelimit $NMBD_MAXTIME $NMBD_VALGRIND $SRCDIR/bin/nmbd -F -S --no-process-group -d0 -s $SERVERCONFFILE > $NMBD_TEST_LOG 2>&1 &
 			TIMELIMIT_NMBD_PID=$!
 			echo $TIMELIMIT_NMBD_PID > $PIDDIR/timelimit.nmbd.pid
 			wait $TIMELIMIT_NMBD_PID
@@ -65,14 +65,14 @@
 			exit $ret;
 		) || exit $? &) 2>/dev/null || exit $?
 		echo  "DONE"
-	
+
 		rm -f $SMBD_TEST_LOG
 		echo -n "STARTING SMBD..."
 		((
 			if [ -z "$SMBD_MAXTIME" ]; then
 			    SMBD_MAXTIME=2700
 			fi
-			timelimit $SMBD_MAXTIME $SMBD_VALGRIND $SRCDIR/bin/smbd -F -S --no-process-group -d1 -s $CONFFILE > $SMBD_TEST_LOG 2>&1 &
+			timelimit $SMBD_MAXTIME $SMBD_VALGRIND $SRCDIR/bin/smbd -F -S --no-process-group -d0 -s $SERVERCONFFILE > $SMBD_TEST_LOG 2>&1 &
 			TIMELIMIT_SMBD_PID=$!
 			echo $TIMELIMIT_SMBD_PID > $PIDDIR/timelimit.smbd.pid
 			wait $TIMELIMIT_SMBD_PID

Modified: trunk/source/script/tests/test_posix_s3.sh
===================================================================
--- trunk/source/script/tests/test_posix_s3.sh	2006-03-23 14:55:38 UTC (rev 14678)
+++ trunk/source/script/tests/test_posix_s3.sh	2006-03-23 14:55:59 UTC (rev 14679)
@@ -35,8 +35,6 @@
 soon="BASE-CHARSET RAW-OPLOCK RAW-NOTIFY BASE-DELAYWRITE"
 #echo "WARNING: Skipping tests $soon"
 
-#testit "my first samba3 test" $SRCDIR/bin/smbclient $CONFIGURATION -L 127.0.0.1 -N -p 139 || failed=`expr $failed + 1`
-
 tests="BASE-FDPASS BASE-VUID BASE-UNLINK BASE-ATTR BASE-DIR2 BASE-TCON BASE-OPEN BASE-CHKPATH"
 
 failed=0

Added: trunk/source/script/tests/test_smbclient_s3.sh
===================================================================
--- trunk/source/script/tests/test_smbclient_s3.sh	2006-03-23 14:55:38 UTC (rev 14678)
+++ trunk/source/script/tests/test_smbclient_s3.sh	2006-03-23 14:55:59 UTC (rev 14679)
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# this runs the file serving tests that are expected to pass with samba3
+
+if [ $# != 2 ]; then
+cat <<EOF
+Usage: test_smbclient_s3.sh SERVER SERVER_IP
+EOF
+exit 1;
+fi
+
+SERVER="$1"
+SERVER_IP="$2"
+
+incdir=`dirname $0`
+. $incdir/test_functions.sh
+
+failed=0
+
+testit "smbclient -L $SERVER_IP" $VALGRIND $SRCDIR/bin/smbclient $CONFIGURATION -L $SERVER_IP -N -p 139 || failed=`expr $failed + 1`
+testit "smbclient -L $SERVER" $VALGRIND $SRCDIR/bin/smbclient $CONFIGURATION -L $SERVER -N -p 139 || failed=`expr $failed + 1`
+
+testok $0 $failed

Added: trunk/source/script/tests/test_smbtorture_s3.sh
===================================================================
--- trunk/source/script/tests/test_smbtorture_s3.sh	2006-03-23 14:55:38 UTC (rev 14678)
+++ trunk/source/script/tests/test_smbtorture_s3.sh	2006-03-23 14:55:59 UTC (rev 14679)
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# this runs the file serving tests that are expected to pass with samba3
+
+if [ $# -lt 3 ]; then
+cat <<EOF
+Usage: test_smbtorture_s3.sh UNC USERNAME PASSWORD <first> <smbtorture args>
+EOF
+exit 1;
+fi
+
+unc="$1"
+username="$2"
+password="$3"
+start="$4"
+shift 4
+ADDARGS="$*"
+
+incdir=`dirname $0`
+. $incdir/test_functions.sh
+
+tests="FDPASS LOCK1 LOCK2 LOCK3 LOCK4 LOCK5 LOCK6 LOCK7"
+tests="$tests UNLINK BROWSE ATTR TRANS2 MAXFID TORTURE "
+tests="$tests OPLOCK1 OPLOCK2 OPLOCK3"
+tests="$tests DIR DIR1 TCON TCONDEV RW1 RW2 RW3"
+tests="$tests OPEN XCOPY RENAME DELETE PROPERTIES W2K"
+tests="$tests PIPE_NUMBER TCON2 IOCTL CHKPATH FDSESS"
+
+skipped1="RANDOMIPC NEGNOWAIT NBENCH ERRMAPEXTRACT TRANS2SCAN NTTRANSSCAN"
+skipped2="DENY1 DENY2 OPENATTR CASETABLE EATEST"
+skipped3="MANGLE UTABLE"
+echo "Skipping the following tests:"
+echo "$skipped1"
+echo "$skipped2"
+echo "$skipped3"
+
+failed=0
+for t in $tests; do
+    if [ ! -z "$start" -a "$start" != $t ]; then
+	continue;
+    fi
+    start=""
+    name="$t"
+    testit "$name" $VALGRIND $SRCDIR/bin/smbtorture $ADDARGS $unc -U"$username"%"$password" $t || failed=`expr $failed + 1`
+done
+
+testok $0 $failed

Modified: trunk/source/script/tests/tests_all.sh
===================================================================
--- trunk/source/script/tests/tests_all.sh	2006-03-23 14:55:38 UTC (rev 14678)
+++ trunk/source/script/tests/tests_all.sh	2006-03-23 14:55:59 UTC (rev 14679)
@@ -1,8 +1,11 @@
 
+$SCRIPTDIR/test_smbtorture_s3.sh //$SERVER_IP/tmp $USERNAME $PASSWORD "" || failed=`expr $failed + $?`
+$SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP || failed=`expr $failed + $?`
+
 if [ -n "$SMBTORTURE4" ];then
 	echo "Running Tests with Samba4's smbtorture"
 	$SMBTORTURE4 --version
-	$SCRIPTDIR/test_posix_s3.sh //$SERVER/tmp $USERNAME $PASSWORD "" || failed=`expr $failed + $?`
+	$SCRIPTDIR/test_posix_s3.sh //$SERVER_IP/tmp $USERNAME $PASSWORD "" || failed=`expr $failed + $?`
 else
 	echo "Skip Tests with Samba4's smbtorture"
 fi



More information about the samba-cvs mailing list