summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsource3/script/tests/selftest.sh39
-rw-r--r--source3/script/tests/test_functions.sh6
-rwxr-xr-xsource3/script/tests/test_posix_s3.sh2
-rwxr-xr-xsource3/script/tests/test_smbclient_s3.sh23
-rwxr-xr-xsource3/script/tests/test_smbtorture_s3.sh47
-rwxr-xr-xsource3/script/tests/tests_all.sh5
6 files changed, 104 insertions, 18 deletions
diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh
index caaf1e1df1..c61cf76380 100755
--- a/source3/script/tests/selftest.sh
+++ b/source3/script/tests/selftest.sh
@@ -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
diff --git a/source3/script/tests/test_functions.sh b/source3/script/tests/test_functions.sh
index 265385d0b1..4e3b8ce7db 100644
--- a/source3/script/tests/test_functions.sh
+++ b/source3/script/tests/test_functions.sh
@@ -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
diff --git a/source3/script/tests/test_posix_s3.sh b/source3/script/tests/test_posix_s3.sh
index 64e984cb67..bc3060073c 100755
--- a/source3/script/tests/test_posix_s3.sh
+++ b/source3/script/tests/test_posix_s3.sh
@@ -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
index 0000000000..007f3839f7
--- /dev/null
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -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
index 0000000000..d0e15345df
--- /dev/null
+++ b/source3/script/tests/test_smbtorture_s3.sh
@@ -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
diff --git a/source3/script/tests/tests_all.sh b/source3/script/tests/tests_all.sh
index 6f7a0c3d2d..64a7065ee9 100755
--- a/source3/script/tests/tests_all.sh
+++ b/source3/script/tests/tests_all.sh
@@ -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