From aa583e5912866069f1f79e0b675e9e7927c64fbe Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 23 Mar 2006 14:55:38 +0000 Subject: r14678: - 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 (This used to be commit 835f8f4339f41619ec890e38569b745c5ef5d44e) --- source3/script/tests/selftest.sh | 39 +++++++++++++++++-------- source3/script/tests/test_functions.sh | 6 ++-- source3/script/tests/test_posix_s3.sh | 2 -- source3/script/tests/test_smbclient_s3.sh | 23 +++++++++++++++ source3/script/tests/test_smbtorture_s3.sh | 47 ++++++++++++++++++++++++++++++ source3/script/tests/tests_all.sh | 5 +++- 6 files changed, 104 insertions(+), 18 deletions(-) create mode 100755 source3/script/tests/test_smbclient_s3.sh create mode 100755 source3/script/tests/test_smbtorture_s3.sh (limited to 'source3/script') 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<$COMMONCONFFILE<$CONFFILE<$SERVERCONFFILE< $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 +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 -- cgit