s3-selftest convert tests.sh to python
[bbaumbach/samba-autobuild/.git] / source3 / script / tests / test_smbtorture_s3.sh
index 21c0fca4457e4ea36546b326e24c24fcb6590e26..ca64fa283ddd9e1bc6d120ab23e21a1b4498e520 100755 (executable)
@@ -2,20 +2,28 @@
 
 # this runs the file serving tests that are expected to pass with samba3
 
+if [ $# -lt 4 ]; then
+cat <<EOF
+Usage: test_smbtorture_s3.sh TEST UNC USERNAME PASSWORD <smbtorture args>
+EOF
+exit 1;
+fi
+
+t="$1"
+unc="$2"
+username="$3"
+password="$4"
+shift 4
 ADDARGS="$*"
 
-incdir=`dirname $0`
-. $incdir/test_functions.sh
+test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+}
+
 
-BINDIR=$incdir/../../bin
 
-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 TCON2 IOCTL CHKPATH FDSESS LOCAL-SUBSTITUTE"
+failed=0
+testit "smbtorture" $VALGRIND $BINDIR/smbtorture $unc -U"$username"%"$password" $ADDARGS $t || failed=`expr $failed + 1`
 
-for t in $tests; do
-    plantest "SAMBA3-$t" dc $VALGRIND $BINDIR/smbtorture $ADDARGS //\$SERVER_IP/tmp -U"\$USERNAME"%"\$PASSWORD" $t
-done
+testok $0 $failed