r14678: - we need to use 127.0.0.2/8 as interface for the server
authorStefan Metzmacher <metze@samba.org>
Thu, 23 Mar 2006 14:55:38 +0000 (14:55 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:15:43 +0000 (11:15 -0500)
  as nmbd skip interfaces with address 127.0.0.1
- add samba3 smbclient -L tests
- add samba3 smbtorture tests

metze
(This used to be commit 835f8f4339f41619ec890e38569b745c5ef5d44e)

source3/script/tests/selftest.sh
source3/script/tests/test_functions.sh
source3/script/tests/test_posix_s3.sh
source3/script/tests/test_smbclient_s3.sh [new file with mode: 0755]
source3/script/tests/test_smbtorture_s3.sh [new file with mode: 0755]
source3/script/tests/tests_all.sh

index caaf1e1df18d1475664f63ad0d8e077cd167fde8..c61cf763801a2986027b6b9ff188be1294fff27d 100755 (executable)
@@ -26,7 +26,8 @@ fi
 ## 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 @@ SCRIPTDIR=$SRCDIR/script/tests
 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 @@ SOCKET_WRAPPER_DIR=$PREFIX/sw
 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 @@ chmod 777 $PREFIX_ABS/tmp
 ##
 
 cat >$COMMONCONFFILE<<EOF
-       netbios name = LOCALHOST
        workgroup = SAMBA-TEST
 
        private dir = $PRIVATEDIR
@@ -91,14 +93,21 @@ cat >$COMMONCONFFILE<<EOF
 
        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]
@@ -133,7 +142,7 @@ export failed
 
 . $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 @@ fi
 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
 
index 265385d0b179549a5876ab28f4ff24b296c48d56..4e3b8ce7db85a58c5d4edbc60a1f776bf7321c48 100644 (file)
@@ -43,7 +43,7 @@ samba3_check_or_start() {
                        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 @@ samba3_check_or_start() {
                        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
index 64e984cb67bd240b4bcde32652acabab21d440d5..bc3060073c1513fbbe4271ba117c2af8cb1a48aa 100755 (executable)
@@ -35,8 +35,6 @@ tests="$tests RAW-EAS RAW-STREAMS RAW-ACLS"
 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
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
new file mode 100755 (executable)
index 0000000..007f383
--- /dev/null
@@ -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
diff --git a/source3/script/tests/test_smbtorture_s3.sh b/source3/script/tests/test_smbtorture_s3.sh
new file mode 100755 (executable)
index 0000000..d0e1534
--- /dev/null
@@ -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
index 6f7a0c3d2d1ad4fbeeb458efc090ac3d92faf2df..64a7065ee97f2c1065fe402a987c9c1dd051effb 100755 (executable)
@@ -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