[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
[samba.git] / source / script / tests / selftest.sh
index ccbc90bda99db786cf851bcd2df60fce6130c793..8de6420b10abf4bfdef62b2644e8e55ec13ee97d 100755 (executable)
@@ -39,6 +39,7 @@ SHRDIR=$PREFIX_ABS/tmp
 LIBDIR=$PREFIX_ABS/lib
 PIDDIR=$PREFIX_ABS/pid
 CONFFILE=$LIBDIR/client.conf
+SAMBA4CONFFILE=$LIBDIR/samba4client.conf
 SERVERCONFFILE=$LIBDIR/server.conf
 COMMONCONFFILE=$LIBDIR/common.conf
 PRIVATEDIR=$PREFIX_ABS/private
@@ -46,8 +47,11 @@ LOCKDIR=$PREFIX_ABS/lockdir
 LOGDIR=$PREFIX_ABS/logs
 SOCKET_WRAPPER_DIR=$PREFIX/sw
 CONFIGURATION="-s $CONFFILE"
+SAMBA4CONFIGURATION="-s $SAMBA4CONFFILE"
 
-export PREFIX PREFIX_ABS CONFIGURATION CONFFILE PATH SOCKET_WRAPPER_DIR DOMAIN
+export PREFIX PREFIX_ABS
+export CONFIGURATION CONFFILE SAMBA4CONFIGURATION SAMBA4CONFFILE
+export PATH SOCKET_WRAPPER_DIR DOMAIN
 export PRIVATEDIR LIBDIR PIDDIR LOCKDIR LOGDIR SERVERCONFFILE
 export SRCDIR SCRIPTDIR BINDIR
 export USERNAME PASSWORD
@@ -91,17 +95,26 @@ cat >$COMMONCONFFILE<<EOF
        log file = $LOGDIR/log.%m
        log level = 0
 
-       passdb backend = tdbsam
-
        name resolve order = bcast
-
-       panic action = $SCRIPTDIR/gdb_backtrace %d
 EOF
 
+TORTURE_INTERFACES='127.0.0.6/8,127.0.0.7/8,127.0.0.8/8,127.0.0.9/8,127.0.0.10/8,127.0.0.11/8'
+
 cat >$CONFFILE<<EOF
 [global]
-       netbios name = TORTURE26
-       interfaces = 127.0.0.26/8
+       netbios name = TORTURE_6
+       interfaces = $TORTURE_INTERFACES
+       panic action = $SCRIPTDIR/gdb_backtrace %d %\$(MAKE_TEST_BINARY)
+       include = $COMMONCONFFILE
+
+       passdb backend = tdbsam
+EOF
+
+cat >$SAMBA4CONFFILE<<EOF
+[global]
+       netbios name = TORTURE_6
+       interfaces = $TORTURE_INTERFACES
+       panic action = $SCRIPTDIR/gdb_backtrace %PID% %PROG%
        include = $COMMONCONFFILE
 EOF
 
@@ -110,14 +123,19 @@ cat >$SERVERCONFFILE<<EOF
        netbios name = $SERVER
        interfaces = $SERVER_IP/8
        bind interfaces only = yes
+       panic action = $SCRIPTDIR/gdb_backtrace %d %\$(MAKE_TEST_BINARY)
        include = $COMMONCONFFILE
 
+       passdb backend = tdbsam
+
        ; Necessary to add the build farm hacks
        add user script = /bin/false
        add machine script = /bin/false
 
        kernel oplocks = no
+       kernel change notify = no
 
+       syslog = no
        printing = bsd
        printcap name = /dev/null
 
@@ -125,15 +143,27 @@ cat >$SERVERCONFFILE<<EOF
        path = $PREFIX_ABS/tmp
        read only = no
        smbd:sharedelay = 100000
+       map hidden = yes
+       map system = yes
+       create mask = 755
 [hideunread]
        copy = tmp
        hide unreadable = yes
 [hideunwrite]
        copy = tmp
        hide unwriteable files = yes
+[print1]
+       copy = tmp
+       printable = yes
+       printing = test
+[print2]
+       copy = print1
+[print3]
+       copy = print1
+[print4]
+       copy = print1
 EOF
 
-
 ##
 ## create a test account
 ##
@@ -143,10 +173,6 @@ EOF
 
 echo "DONE";
 
-if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
-       CONFIGURATION="$CONFIGURATION --option=\"torture:progress=no\""
-fi
-
 SERVER_TEST_FIFO="$PREFIX/server_test.fifo"
 export SERVER_TEST_FIFO
 NMBD_TEST_LOG="$PREFIX/nmbd_test.log"
@@ -154,6 +180,9 @@ export NMBD_TEST_LOG
 SMBD_TEST_LOG="$PREFIX/smbd_test.log"
 export SMBD_TEST_LOG
 
+MAKE_TEST_BINARY=""
+export MAKE_TEST_BINARY
+
 # start off with 0 failures
 failed=0
 export failed
@@ -165,18 +194,19 @@ export SOCKET_WRAPPER_DEFAULT_IFACE
 samba3_check_or_start
 
 # ensure any one smbtorture call doesn't run too long
-# and smbtorture will use 127.0.0.26 as source address by default
-SOCKET_WRAPPER_DEFAULT_IFACE=26
+# and smbtorture will use 127.0.0.6 as source address by default
+SOCKET_WRAPPER_DEFAULT_IFACE=6
 export SOCKET_WRAPPER_DEFAULT_IFACE
-TORTURE4_INTERFACES='127.0.0.26/8,127.0.0.27/8,127.0.0.28/8,127.0.0.29/8,127.0.0.30/8,127.0.0.31/8'
-TORTURE4_OPTIONS="--maximum-runtime=$TORTURE_MAXTIME --option=interfaces=$TORTURE4_INTERFACES $CONFIGURATION"
+TORTURE4_OPTIONS="$SAMBA4CONFIGURATION"
+TORTURE4_OPTIONS="$TORTURE4_OPTIONS --maximum-runtime=$TORTURE_MAXTIME"
+TORTURE4_OPTIONS="$TORTURE4_OPTIONS --target=samba3"
+TORTURE4_OPTIONS="$TORTURE4_OPTIONS --option=torture:localdir=$PREFIX_ABS/tmp"
 export TORTURE4_OPTIONS
 
 if [ x"$RUN_FROM_BUILD_FARM" = x"yes" ];then
        TORTURE4_OPTIONS="$TORTURE4_OPTIONS --option=torture:progress=no"
 fi
 
-TORTURE4_OPTIONS="$TORTURE4_OPTIONS --option=target:samba3=yes"
 
 ##
 ## ready to go...now loop through the tests
@@ -186,7 +216,7 @@ START=`date`
 (
  # give time for nbt server to register its names
  echo "delaying for nbt name registration"
- sleep 4
+ sleep 10
  # 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_IP __SAMBA__
  bin/nmblookup $CONFIGURATION __SAMBA__