summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xselftest/selftest.pl1
-rw-r--r--selftest/target/Samba3.pm6
-rwxr-xr-xsource3/script/tests/test_net_misc.sh11
-rwxr-xr-xsource3/script/tests/test_net_registry.sh12
-rwxr-xr-xsource3/script/tests/test_net_registry_roundtrip.sh11
-rwxr-xr-xsource3/script/tests/test_ntlm_auth_s3.sh24
-rwxr-xr-xsource3/script/tests/test_posix_s3.sh99
-rwxr-xr-xsource3/script/tests/test_smbclient_auth.sh26
-rwxr-xr-xsource3/script/tests/test_smbclient_s3.sh26
-rwxr-xr-xsource3/script/tests/test_smbtorture_s3.sh39
-rwxr-xr-xsource3/script/tests/test_testparm_s3.sh9
-rwxr-xr-xsource3/script/tests/test_wbinfo_s3.sh45
-rw-r--r--source3/script/tests/tests_smbclient_s3.sh1
-rwxr-xr-xsource3/selftest/s3-selftest.sh8
-rwxr-xr-xsource3/selftest/tests.py196
-rwxr-xr-xsource3/selftest/tests.sh206
-rw-r--r--source3/selftest/wscript2
17 files changed, 300 insertions, 422 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 4f1f1d422c..4b42ec4801 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -421,6 +421,7 @@ $ENV{SRCDIR} = $srcdir;
$ENV{SRCDIR_ABS} = $srcdir_abs;
$ENV{BUILDDIR} = $builddir;
$ENV{BUILDDIR_ABS} = $builddir_abs;
+$ENV{BINDIR} = $bindir_abs;
$ENV{EXEEXT} = $exeext;
my $tls_enabled = not $opt_quick;
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 06f070d65d..4d60a52002 100644
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -134,6 +134,12 @@ sub setup_dc($$)
$self->wait_for_start($vars);
+ $vars->{DC_SERVER} = $vars->{SERVER};
+ $vars->{DC_SERVER_IP} = $vars->{SERVER_IP};
+ $vars->{DC_NETBIOSNAME} = $vars->{NETBIOSNAME};
+ $vars->{DC_USERNAME} = $vars->{USERNAME};
+ $vars->{DC_PASSWORD} = $vars->{PASSWORD};
+
$self->{vars}->{dc} = $vars;
return $vars;
diff --git a/source3/script/tests/test_net_misc.sh b/source3/script/tests/test_net_misc.sh
index 5257830030..015b5026a7 100755
--- a/source3/script/tests/test_net_misc.sh
+++ b/source3/script/tests/test_net_misc.sh
@@ -2,6 +2,17 @@
# various tests for the "net" command
+if [ $# -lt 3 ]; then
+cat <<EOF
+Usage: test_net_misc.sh SCRIPTDIR SERVERCONFFILE CONFIGURATION
+EOF
+exit 1;
+fi
+
+SCRIPTDIR="$1"
+SERVERCONFFILE="$2"
+CONFIGURATION="$3"
+
NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
NETTIME="${NET} time"
diff --git a/source3/script/tests/test_net_registry.sh b/source3/script/tests/test_net_registry.sh
index 45f4dd09cc..21c452d6e1 100755
--- a/source3/script/tests/test_net_registry.sh
+++ b/source3/script/tests/test_net_registry.sh
@@ -7,7 +7,17 @@
#
# rpc tests are chose by specifying "rpc" as commandline parameter.
-RPC="$1"
+if [ $# -lt 3 ]; then
+cat <<EOF
+Usage: test_net_registry.sh SCRIPTDIR SERVERCONFFILE CONFIGURATION RPC
+EOF
+exit 1;
+fi
+
+SCRIPTDIR="$1"
+SERVERCONFFILE="$2"
+CONFIGURATION="$3"
+RPC="$4"
NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
diff --git a/source3/script/tests/test_net_registry_roundtrip.sh b/source3/script/tests/test_net_registry_roundtrip.sh
index 88919ec93c..52ce192af4 100755
--- a/source3/script/tests/test_net_registry_roundtrip.sh
+++ b/source3/script/tests/test_net_registry_roundtrip.sh
@@ -5,6 +5,17 @@
# Copyright (C) 2010 Gregor Beck <gbeck@sernet.de>
# Copyright (C) 2011 Michael Adam <obnox@samba.org>
+if [ $# -lt 3 ]; then
+cat <<EOF
+Usage: test_net_registry_roundtrip.sh SCRIPTDIR SERVERCONFFILE CONFIGURATION
+EOF
+exit 1;
+fi
+
+SCRIPTDIR="$1"
+SERVERCONFFILE="$2"
+CONFIGURATION="$3"
+
NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
diff --git a/source3/script/tests/test_ntlm_auth_s3.sh b/source3/script/tests/test_ntlm_auth_s3.sh
index 17aabef98e..4f84982503 100755
--- a/source3/script/tests/test_ntlm_auth_s3.sh
+++ b/source3/script/tests/test_ntlm_auth_s3.sh
@@ -1,5 +1,17 @@
#!/bin/sh
+if [ $# -lt 2 ]; then
+cat <<EOF
+Usage: test_ntlm_auth_s3.sh PYTHON SRC3DIR
+EOF
+exit 1;
+fi
+
+PYTHON=$1
+SRC3DIR=$2
+shift 2
+ADDARGS="$*"
+
test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
incdir=`dirname $0`/../../../testprogs/blackbox
. $incdir/subunit.sh
@@ -7,17 +19,9 @@ incdir=`dirname $0`/../../../testprogs/blackbox
failed=0
-(/usr/bin/env python --version > /dev/null 2>&1)
-
-if test $? -ne 0;
-then
- echo "Python binary not found in path. Skipping ntlm_auth tests."
- exit 0
-fi
-
-testit "ntlm_auth" $VALGRIND $SRCDIR/torture/test_ntlm_auth.py $BINDIR/ntlm_auth --configfile=$CONFFILE || failed=`expr $failed + 1`
+testit "ntlm_auth" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $BINDIR/ntlm_auth $ADDARGS || failed=`expr $failed + 1`
# This should work even with NTLMv2
-testit "ntlm_auth" $VALGRIND $SRCDIR/torture/test_ntlm_auth.py $BINDIR/ntlm_auth --configfile=$CONFFILE --client-domain=fOo --server-domain=fOo || failed=`expr $failed + 1`
+testit "ntlm_auth" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $BINDIR/ntlm_auth $ADDARGS --client-domain=fOo --server-domain=fOo || failed=`expr $failed + 1`
testok $0 $failed
diff --git a/source3/script/tests/test_posix_s3.sh b/source3/script/tests/test_posix_s3.sh
deleted file mode 100755
index 69c71fd2d4..0000000000
--- a/source3/script/tests/test_posix_s3.sh
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/sh
-
-# this runs the file serving tests that are expected to pass with samba3
-
-if [ $# -lt 3 ]; then
-cat <<EOF
-Usage: test_posix_s3.sh UNC USERNAME PASSWORD <first> <smbtorture args>
-EOF
-exit 1;
-fi
-
-unc="$1"
-username="$2"
-password="$3"
-start="$4"
-shift 4
-ADDARGS="$*"
-
-test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
-incdir=`dirname $0`/../../../testprogs/blackbox
-. $incdir/subunit.sh
-}
-
-base="base.attr base.charset base.chkpath base.defer_open base.delaywrite base.delete"
-base="$base base.deny1 base.deny2 base.deny3 base.denydos base.dir1 base.dir2"
-base="$base base.disconnect base.fdpass base.lock"
-base="$base base.mangle base.negnowait base.ntdeny1"
-base="$base base.ntdeny2 base.open base.openattr base.properties base.rename base.rw1"
-base="$base base.secleak base.tcon base.tcondev base.trans2 base.unlink base.vuid"
-base="$base base.xcopy base.samba3error"
-
-raw="raw.acls raw.chkpath raw.close raw.composite raw.context raw.eas"
-raw="$raw raw.ioctl raw.lock raw.mkdir raw.mux raw.notify raw.open raw.oplock"
-raw="$raw raw.qfileinfo raw.qfsinfo raw.read raw.rename raw.search raw.seek"
-raw="$raw raw.sfileinfo.base raw.sfileinfo.bug raw.streams raw.unlink raw.write"
-raw="$raw raw.samba3hide raw.samba3badpath raw.sfileinfo.rename"
-raw="$raw raw.samba3caseinsensitive raw.samba3posixtimedlock"
-raw="$raw raw.samba3rootdirfid raw.sfileinfo.end.of.file"
-
-smb2="smb2.lock smb2.read smb2.compound smb2.connect smb2.scan smb2.scanfind"
-smb2="$smb2 smb2.bench.oplock"
-
-rpc="rpc.authcontext rpc.samba3.bind rpc.samba3.srvsvc rpc.samba3.sharesec"
-rpc="$rpc rpc.samba3.spoolss rpc.samba3.wkssvc rpc.samba3.winreg"
-rpc="$rpc rpc.samba3.getaliasmembership.0"
-rpc="$rpc rpc.samba3.netlogon rpc.samba3.sessionkey rpc.samba3.getusername"
-rpc="$rpc rpc.svcctl rpc.ntsvcs rpc.winreg rpc.eventlog"
-rpc="$rpc rpc.spoolss.printserver rpc.spoolss.win rpc.spoolss.notify rpc.spoolss.printer"
-rpc="$rpc rpc.spoolss.driver"
-rpc="$rpc rpc.lsa.getuser rpc.lsa.lookupsids rpc.lsa.lookupnames"
-rpc="$rpc rpc.lsa.privileges "
-rpc="$rpc rpc.samr rpc.samr.users rpc.samr.users.privileges rpc.samr.passwords"
-rpc="$rpc rpc.samr.passwords.pwdlastset rpc.samr.large.dc rpc.samr.machine.auth"
-rpc="$rpc rpc.netlogon.s3 rpc.netlogon.admin"
-rpc="$rpc rpc.schannel rpc.schannel2 rpc.bench.schannel1 rpc.join rpc.bind rpc.epmapper"
-
-local="local.nss.wrapper local.ndr"
-
-winbind="winbind.struct winbind.wbclient"
-
-rap="rap.basic rap.rpc rap.printing rap.sam"
-
-unix="unix.info2 unix.whoami"
-
-tests="$base $raw $smb2 $rpc $unix $local $winbind $rap"
-
-if test "x$POSIX_SUBTESTS" != "x" ; then
- tests="$POSIX_SUBTESTS"
-fi
-
-ADDARGS="$ADDARGS --option=torture:sharedelay=100000"
-#ADDARGS="$ADDARGS --option=torture:writetimeupdatedelay=500000"
-
-failed=0
-for t in $tests; do
- if [ ! -z "$start" -a "$start" != $t ]; then
- continue;
- fi
- start=""
- name="$t"
- if [ "$t" = "base.delaywrite" ]; then
- testit "$name" $VALGRIND $SMBTORTURE4 $TORTURE4_OPTIONS --maximum-runtime=900 $ADDARGS $unc -U"$username"%"$password" $t || failed=`expr $failed + 1`
- elif [ "$t" = "unix.whoami" ]; then
- #"Testing with guest-enabled share"
- testit "$name" $VALGRIND $SMBTORTURE4 $TORTURE4_OPTIONS $ADDARGS "$unc"guest -U"$username"%"$password" $t || failed=`expr $failed + 1`
- else
- testit "$name" $VALGRIND $SMBTORTURE4 $TORTURE4_OPTIONS $ADDARGS $unc -U"$username"%"$password" $t || failed=`expr $failed + 1`
- fi
- if [ "$t" = "raw.chkpath" ]; then
- echo "Testing with case sensitive"
- testit "$name" $VALGRIND $SMBTORTURE4 $TORTURE4_OPTIONS $ADDARGS "$unc"case -U"$username"%"$password" $t || failed=`expr $failed + 1`
- fi
- if [ "$t" = "unix.whoami" ]; then
- echo "Testing with guest-enabled share"
- testit "$name" $VALGRIND $SMBTORTURE4 $TORTURE4_OPTIONS $ADDARGS "$unc"guest -U"$username"%"$password" $t || failed=`expr $failed + 1`
- fi
-done
-
-testok $0 $failed
diff --git a/source3/script/tests/test_smbclient_auth.sh b/source3/script/tests/test_smbclient_auth.sh
index dab914a61c..7ee60b03c2 100755
--- a/source3/script/tests/test_smbclient_auth.sh
+++ b/source3/script/tests/test_smbclient_auth.sh
@@ -2,9 +2,9 @@
# this runs the file serving tests that are expected to pass with samba3 against shares with various options
-if [ $# -lt 5 ]; then
+if [ $# -lt 4 ]; then
cat <<EOF
-Usage: test_smbclient_s3.sh SERVER SERVER_IP USERNAME PASSWORD USERID LOCAL_PATH
+Usage: test_smbclient_s3.sh SERVER SERVER_IP USERNAME PASSWORD <smbclient arguments>
EOF
exit 1;
fi
@@ -13,10 +13,8 @@ SERVER="$1"
SERVER_IP="$2"
USERNAME="$3"
PASSWORD="$4"
-USERID="$5"
-SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION"
-WBINFO="$VALGRIND ${WBINFO:-$BINDIR/wbinfo}"
-shift 5
+SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient}"
+shift 4
ADDARGS="$*"
test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
@@ -26,13 +24,13 @@ incdir=`dirname $0`/../../../testprogs/blackbox
failed=0
-testit "smbclient //$SERVER/guestonly" $SMBCLIENT //$SERVER/guestonly $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
-testit "smbclient //$SERVER/guestonly as anon" $SMBCLIENT //$SERVER/guestonly $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
-testit "smbclient //$SERVER/tmpguest" $SMBCLIENT //$SERVER/tmpguest $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
-testit "smbclient //$SERVER/tmpguest as anon" $SMBCLIENT //$SERVER/tmpguest $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
-testit "smbclient //$SERVER/forceuser" $SMBCLIENT //$SERVER/forceuser $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
-testit "smbclient //$SERVER/forceuser as anon" $SMBCLIENT //$SERVER/forceuser $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
-testit "smbclient //$SERVER/forcegroup" $SMBCLIENT //$SERVER/forcegroup $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
-testit "smbclient //$SERVER/forcegroup as anon" $SMBCLIENT //$SERVER/forcegroup $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
+testit "smbclient //$SERVER/guestonly" $SMBCLIENT //$SERVER/guestonly $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit $ADDARGS|| failed=`expr $failed + 1`
+testit "smbclient //$SERVER/guestonly as anon" $SMBCLIENT //$SERVER/guestonly $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit $ADDARGS|| failed=`expr $failed + 1`
+testit "smbclient //$SERVER/tmpguest" $SMBCLIENT //$SERVER/tmpguest $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit $ADDARGS|| failed=`expr $failed + 1`
+testit "smbclient //$SERVER/tmpguest as anon" $SMBCLIENT //$SERVER/tmpguest $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit $ADDARGS|| failed=`expr $failed + 1`
+testit "smbclient //$SERVER/forceuser" $SMBCLIENT //$SERVER/forceuser $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit $ADDARGS|| failed=`expr $failed + 1`
+testit "smbclient //$SERVER/forceuser as anon" $SMBCLIENT //$SERVER/forceuser $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit $ADDARGS|| failed=`expr $failed + 1`
+testit "smbclient //$SERVER/forcegroup" $SMBCLIENT //$SERVER/forcegroup $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit $ADDARGS|| failed=`expr $failed + 1`
+testit "smbclient //$SERVER/forcegroup as anon" $SMBCLIENT //$SERVER/forcegroup $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit $ADDARGS|| failed=`expr $failed + 1`
testok $0 $failed
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 1335a37cef..8ae8ef2514 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -16,7 +16,7 @@ PASSWORD="$4"
USERID="$5"
LOCAL_PATH="$6"
PREFIX="$7"
-SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION"
+SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient}"
WBINFO="$VALGRIND ${WBINFO:-$BINDIR/wbinfo}"
shift 7
ADDARGS="$*"
@@ -33,7 +33,7 @@ test_noninteractive_no_prompt()
{
prompt="smb"
- cmd='echo du | $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS 2>&1'
+ cmd='echo du | $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS 2>&1'
eval echo "$cmd"
out=`eval $cmd`
@@ -66,7 +66,7 @@ du
quit
EOF
- cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
eval echo "$cmd"
out=`eval $cmd`
ret=$?
@@ -104,7 +104,7 @@ posix_unlink newname
quit
EOF
- cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
eval echo "$cmd"
out=`eval $cmd`
ret=$?
@@ -144,7 +144,7 @@ del slink
quit
EOF
- cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
eval echo "$cmd"
out=`eval $cmd`
ret=$?
@@ -210,7 +210,7 @@ mkdir a_test_dir
quit
EOF
- cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT $CONFIGURATION "$@" -U% //$SERVER/ro-tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U% //$SERVER/ro-tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
eval echo "$cmd"
out=`eval $cmd`
ret=$?
@@ -267,7 +267,7 @@ get unreadable_file
quit
EOF
- cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT $CONFIGURATION "$@" -U% //$SERVER/ro-tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U% //$SERVER/ro-tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
eval echo "$cmd"
out=`eval $cmd`
ret=$?
@@ -306,7 +306,7 @@ ls msdfs-target
quit
EOF
- cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/msdfs-share -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/msdfs-share -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
eval echo "$cmd"
out=`eval $cmd`
ret=$?
@@ -335,7 +335,7 @@ ls msdfs-target
quit
EOF
- cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/msdfs-share -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/msdfs-share -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
eval echo "$cmd"
out=`eval $cmd`
ret=$?
@@ -366,7 +366,7 @@ EOF
test_ccache_access()
{
$WBINFO --ccache-save="${USERNAME}%${PASSWORD}"
- $SMBCLIENT $CONFIGURATION //$SERVER_IP/tmp -C -U "${USERNAME}%" \
+ $SMBCLIENT //$SERVER_IP/tmp -C -U "${USERNAME}%" \
-c quit 2>&1
ret=$?
@@ -377,7 +377,7 @@ test_ccache_access()
fi
$WBINFO --ccache-save="${USERNAME}%GarBage"
- $SMBCLIENT $CONFIGURATION //$SERVER_IP/tmp -C -U "${USERNAME}%" \
+ $SMBCLIENT //$SERVER_IP/tmp -C -U "${USERNAME}%" \
-c quit 2>&1
ret=$?
@@ -402,8 +402,8 @@ done
LOGDIR=$(mktemp -d --tmpdir=$PREFIX ${LOGDIR_PREFIX}_XXXX)
-testit "smbclient -L $SERVER_IP" $SMBCLIENT $CONFIGURATION -L $SERVER_IP -N -p 139 || failed=`expr $failed + 1`
-testit "smbclient -L $SERVER -I $SERVER_IP" $SMBCLIENT $CONFIGURATION -L $SERVER -I $SERVER_IP -N -p 139 -c quit || failed=`expr $failed + 1`
+testit "smbclient -L $SERVER_IP" $SMBCLIENT -L $SERVER_IP -N -p 139 || failed=`expr $failed + 1`
+testit "smbclient -L $SERVER -I $SERVER_IP" $SMBCLIENT -L $SERVER -I $SERVER_IP -N -p 139 -c quit || failed=`expr $failed + 1`
testit "noninteractive smbclient does not prompt" \
test_noninteractive_no_prompt || \
diff --git a/source3/script/tests/test_smbtorture_s3.sh b/source3/script/tests/test_smbtorture_s3.sh
index c9466e921d..ca64fa283d 100755
--- a/source3/script/tests/test_smbtorture_s3.sh
+++ b/source3/script/tests/test_smbtorture_s3.sh
@@ -2,17 +2,17 @@
# this runs the file serving tests that are expected to pass with samba3
-if [ $# -lt 3 ]; then
+if [ $# -lt 4 ]; then
cat <<EOF
-Usage: test_smbtorture_s3.sh UNC USERNAME PASSWORD <first> <smbtorture args>
+Usage: test_smbtorture_s3.sh TEST UNC USERNAME PASSWORD <smbtorture args>
EOF
exit 1;
fi
-unc="$1"
-username="$2"
-password="$3"
-start="$4"
+t="$1"
+unc="$2"
+username="$3"
+password="$4"
shift 4
ADDARGS="$*"
@@ -21,32 +21,9 @@ incdir=`dirname $0`/../../../testprogs/blackbox
. $incdir/subunit.sh
}
-SMB_CONF_PATH="$CONFFILE"
-export SMB_CONF_PATH
-
-tests="FDPASS LOCK1 LOCK2 LOCK3 LOCK4 LOCK5 LOCK6 LOCK7 LOCK9"
-#tests="$tests UNLINK BROWSE ATTR TRANS2 MAXFID TORTURE "
-tests="$tests UNLINK BROWSE ATTR TRANS2 TORTURE "
-tests="$tests OPLOCK1 OPLOCK2 OPLOCK3 OPLOCK4 STREAMERROR"
-tests="$tests DIR DIR1 DIR-CREATETIME TCON TCONDEV RW1 RW2 RW3 RW-SIGNING"
-tests="$tests OPEN XCOPY RENAME DELETE DELETE-LN PROPERTIES W2K"
-tests="$tests TCON2 IOCTL CHKPATH FDSESS LOCAL-SUBSTITUTE CHAIN1"
-tests="$tests GETADDRINFO POSIX UID-REGRESSION-TEST SHORTNAME-TEST"
-tests="$tests LOCAL-BASE64 LOCAL-GENCACHE POSIX-APPEND"
-tests="$tests LOCAL-string_to_sid"
-
-if test "x$SMBTORTURE_S3_SUBTESTS" != "x" ; then
- tests="$SMBTORTURE_S3_SUBTESTS"
-fi
+
failed=0
-for t in $tests; do
- if [ ! -z "$start" -a "$start" != $t ]; then
- continue;
- fi
- start=""
- name="$t"
- testit "$name" $VALGRIND $BINDIR/smbtorture $unc -U"$username"%"$password" $ADDARGS $t || failed=`expr $failed + 1`
-done
+testit "smbtorture" $VALGRIND $BINDIR/smbtorture $unc -U"$username"%"$password" $ADDARGS $t || failed=`expr $failed + 1`
testok $0 $failed
diff --git a/source3/script/tests/test_testparm_s3.sh b/source3/script/tests/test_testparm_s3.sh
index 0fd1a57c2b..bced6e7e19 100755
--- a/source3/script/tests/test_testparm_s3.sh
+++ b/source3/script/tests/test_testparm_s3.sh
@@ -5,6 +5,15 @@
# The main purpose (for now) is to test all the special handlers
# and the macro expansions.
+if [ $# -lt 1 ]; then
+cat <<EOF
+Usage: test_net_registry_roundtrip.sh LOCAL_PATH
+EOF
+exit 1;
+fi
+
+LOCAL_PATH="$1"
+
TEMP_CONFFILE=${LOCAL_PATH}/smb.conf.tmp
TESTPARM="$VALGRIND ${TESTPARM:-$BINDIR/testparm} --suppress-prompt --skip-logic-checks"
diff --git a/source3/script/tests/test_wbinfo_s3.sh b/source3/script/tests/test_wbinfo_s3.sh
index a63bcba794..860e7c5afc 100755
--- a/source3/script/tests/test_wbinfo_s3.sh
+++ b/source3/script/tests/test_wbinfo_s3.sh
@@ -1,17 +1,12 @@
#!/bin/sh
-if [ $# -lt 4 ]; then
+if [ $# -lt 1 ]; then
cat <<EOF
-Usage: test_wbinfo_s3.sh DOMAIN SERVER USERNAME PASSWORD <wbinfo args>
+Usage: test_wbinfo_s3.sh <wbinfo args>
EOF
exit 1;
fi
-domain="$1"
-server="$2"
-username="$3"
-password="$4"
-shift 4
ADDARGS="$*"
test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
@@ -19,40 +14,6 @@ incdir=`dirname $0`/../../../testprogs/blackbox
. $incdir/subunit.sh
}
-OLDIFS=$IFS;
-
-tests="--ping"
-tests="$tests:--separator"
-tests="$tests:--own-domain"
-tests="$tests:--all-domains"
-tests="$tests:--trusted-domains"
-tests="$tests:--domain-info=BUILTIN"
-tests="$tests:--domain-info=$domain"
-tests="$tests:--online-status"
-tests="$tests:--online-status --domain=BUILTIN"
-tests="$tests:--online-status --domain=$domain"
-tests="$tests:--check-secret --domain=$domain"
-tests="$tests:--change-secret --domain=$domain"
-tests="$tests:--check-secret --domain=$domain"
-tests="$tests:--online-status --domain=$domain"
-#Didn't pass yet# tests="$tests:--domain-users"
-tests="$tests:--domain-groups"
-tests="$tests:--name-to-sid=$username"
-#Didn't pass yet# tests="$tests:--user-info=$username"
-tests="$tests:--user-groups=$username"
-tests="$tests:--allocate-uid"
-tests="$tests:--allocate-gid"
-
-failed=0
-
-OLDIFS=$IFS
-NEWIFS=$':'
-IFS=$NEWIFS
-for t in $tests; do
- IFS=$OLDIFS
- testit "wbinfo $t" $VALGRIND $BINDIR/wbinfo $ADDARGS $t || failed=`expr $failed + 1`
- IFS=$NEWIFS
-done
-IFS=$OLDIFS
+testit "wbinfo" $VALGRIND $BINDIR/wbinfo $ADDARGS || failed=`expr $failed + 1`
testok $0 $failed
diff --git a/source3/script/tests/tests_smbclient_s3.sh b/source3/script/tests/tests_smbclient_s3.sh
deleted file mode 100644
index 5dbcd436f5..0000000000
--- a/source3/script/tests/tests_smbclient_s3.sh
+++ /dev/null
@@ -1 +0,0 @@
-. $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP $USERNAME $PASSWORD $USERID $LOCAL_PATH
diff --git a/source3/selftest/s3-selftest.sh b/source3/selftest/s3-selftest.sh
index 6105ff4660..67b2de9407 100755
--- a/source3/selftest/s3-selftest.sh
+++ b/source3/selftest/s3-selftest.sh
@@ -20,8 +20,8 @@ st_test_done() {
if [ "x${RUN_FROM_BUILD_FARM}" = "xyes" ]; then
( rm -f ${SELFTESTPREFIX}/st_done && \
${PERL} ${SELFTESTDIR}/selftest.pl \
- --prefix=${SELFTESTPREFIX} --target=samba3 \
- --testlist="${SOURCEDIR}/selftest/tests.sh|" \
+ --builddir=. --prefix=${SELFTESTPREFIX} --target=samba3 \
+ --testlist="${PYTHON} ${SOURCEDIR}/selftest/tests.py|" \
--exclude=${SOURCEDIR}/selftest/skip \
--socket-wrapper ${TESTS} \
&& touch ${SELFTESTPREFIX}/st_done ) | \
@@ -32,8 +32,8 @@ if [ "x${RUN_FROM_BUILD_FARM}" = "xyes" ]; then
else
( rm -f ${SELFTESTPREFIX}/st_done && \
${PERL} ${SELFTESTDIR}/selftest.pl \
- --prefix=${SELFTESTPREFIX} --target=samba3 \
- --testlist="${SOURCEDIR}/selftest/tests.sh|" \
+ --builddir=. --prefix=${SELFTESTPREFIX} --target=samba3 \
+ --testlist="${PYTHON} ${SOURCEDIR}/selftest/tests.py|" \
--exclude=${SOURCEDIR}/selftest/skip \
--socket-wrapper ${TESTS} \
&& touch ${SELFTESTPREFIX}/st_done ) | \
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
new file mode 100755
index 0000000000..3917e572eb
--- /dev/null
+++ b/source3/selftest/tests.py
@@ -0,0 +1,196 @@
+#!/usr/bin/python
+# This script generates a list of testsuites that should be run as part of
+# the Samba 3 test suite.
+
+# The output of this script is parsed by selftest.pl, which then decides
+# which of the tests to actually run. It will, for example, skip all tests
+# listed in selftest/skip or only run a subset during "make quicktest".
+
+# The idea is that this script outputs all of the tests of Samba 3, not
+# just those that are known to pass, and list those that should be skipped
+# or are known to fail in selftest/skip or selftest/samba4-knownfail. This makes it
+# very easy to see what functionality is still missing in Samba 3 and makes
+# it possible to run the testsuite against other servers, such as Samba 4 or
+# Windows that have a different set of features.
+
+# The syntax for a testsuite is "-- TEST --" on a single line, followed
+# by the name of the test, the environment it needs and the command to run, all
+# three separated by newlines. All other lines in the output are considered
+# comments.
+
+import os, sys
+sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), "../../selftest")))
+from selftesthelpers import *
+import subprocess
+
+smb4torture = binpath("smbtorture4")
+samba3srcdir = srcdir() + "/source3"
+configuration = "--configfile=$SMB_CONF_PATH"
+scriptdir=os.path.join(samba3srcdir, "../script/tests")
+
+torture_options = [configuration, "--maximum-runtime=$SELFTEST_MAXTIME",
+ "--target=$SELFTEST_TARGET", "--basedir=$SELFTEST_TMPDIR",
+ '--option="torture:winbindd_netbios_name=$SERVER"',
+ '--option="torture:winbindd_netbios_domain=$DOMAIN"',
+ '--option=torture:sharedelay=100000']
+
+if not os.getenv("SELFTEST_VERBOSE"):
+ torture_options.append("--option=torture:progress=no")
+torture_options.append("--format=subunit")
+if os.getenv("SELFTEST_QUICK"):
+ torture_options.append("--option=torture:quick=yes")
+smb4torture += " " + " ".join(torture_options)
+
+def plansmbtorturetestsuite(name, env, options):
+ modname = "samba3.posix_s3.%s" % name
+ cmdline = "%s $LISTOPT %s %s" % (valgrindify(smb4torture), options, name)
+ plantestsuite_loadlist(modname, env, cmdline)
+
+plantestsuite("samba3.blackbox.success", "dc:local", [os.path.join(samba3srcdir, "script/tests/test_success.sh")])
+plantestsuite("samba3.blackbox.failure", "dc:local", [os.path.join(samba3srcdir, "script/tests/test_failure.sh")])
+
+plantestsuite("samba3.local_s3", "dc:local", [os.path.join(samba3srcdir, "script/tests/test_local_s3.sh")])
+
+tests=[ "FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", "LOCK5", "LOCK6", "LOCK7", "LOCK9",
+ "UNLINK", "BROWSE", "ATTR", "TRANS2", "TORTURE",
+ "OPLOCK1", "OPLOCK2", "OPLOCK3", "OPLOCK4", "STREAMERROR",
+ "DIR", "DIR1", "DIR-CREATETIME", "TCON", "TCONDEV", "RW1", "RW2", "RW3", "RW-SIGNING",
+ "OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "PROPERTIES", "W2K",
+ "TCON2", "IOCTL", "CHKPATH", "FDSESS", "LOCAL-SUBSTITUTE", "CHAIN1",
+ "GETADDRINFO", "POSIX", "UID-REGRESSION-TEST", "SHORTNAME-TEST",
+ "LOCAL-BASE64", "LOCAL-GENCACHE", "POSIX-APPEND",
+ "LOCAL-string_to_sid" ]
+
+for t in tests:
+ plantestsuite("samba3.smbtorture_s3.plain(dc).%s" % t, "dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', "", "-l $LOCAL_PATH"])
+ plantestsuite("samba3.smbtorture_s3.crypt(dc).%s" % t, "dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//$SERVER_IP/tmp', '$USERNAME', '$PASSWORD', "-e", "-l $LOCAL_PATH"])
+
+tests=["--ping", "--separator",
+ "--own-domain",
+ "--all-domains",
+ "--trusted-domains",
+ "--domain-info=BUILTIN",
+ "--domain-info=$DOMAIN",
+ "--online-status",
+ "--online-status --domain=BUILTIN",
+ "--online-status --domain=$DOMAIN",
+ "--check-secret --domain=$DOMAIN",
+ "--change-secret --domain=$DOMAIN",
+ "--check-secret --domain=$DOMAIN",
+ "--online-status --domain=$DOMAIN",
+ #Didn't pass yet# "--domain-users",
+ "--domain-groups",
+ "--name-to-sid=$USERNAME",
+ "--name-to-sid=$DOMAIN\\\\$USERNAME",
+ #Didn't pass yet# "--user-info=$USERNAME",
+ "--user-groups=$DOMAIN\\\\$USERNAME",
+ "--allocate-uid",
+ "--allocate-gid"]
+
+for t in tests:
+ plantestsuite("samba3.wbinfo_s3.(dc:local).%s" % t, "dc:local", [os.path.join(samba3srcdir, "script/tests/test_wbinfo_s3.sh"), t])
+ plantestsuite("samba3.wbinfo_s3.(member:local).%s" % t, "member:local", [os.path.join(samba3srcdir, "script/tests/test_wbinfo_s3.sh"), t])
+
+plantestsuite("samba3.ntlm_auth.(dc:local)", "dc:local", [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_s3.sh"), valgrindify(python), samba3srcdir, configuration])
+
+for env in ["dc", "member"]:
+ plantestsuite("samba3.blackbox.smbclient_auth.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', configuration])
+
+for env in ["member"]:
+ plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$SERVER\\\\$USERNAME', '$PASSWORD', configuration])
+
+for env in ["secshare"]:
+ plantestsuite("samba3.blackbox.smbclient_auth.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', configuration])
+
+# plain
+for env in ["dc"]:
+ plantestsuite("samba3.blackbox.smbclient_s3.plain (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', configuration])
+
+for env in ["member"]:
+ plantestsuite("samba3.blackbox.smbclient_s3.plain (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER\\\\$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', configuration])
+
+for env in ["dc"]:
+ plantestsuite("samba3.blackbox.smbclient_s3.sign (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', configuration, "--signing=required"])
+
+for env in ["member"]:
+ plantestsuite("samba3.blackbox.smbclient_s3.sign (%s) member creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$SERVER\\\\$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', configuration, "--signing=required"])
+
+# encrypted
+for env in ["dc"]:
+ plantestsuite("samba3.blackbox.smbclient_s3.crypt (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_s3.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', '$USERID', '$LOCAL_PATH', '$PREFIX', configuration, "-e"])
+
+#TODO encrypted against member, with member creds, and with DC creds
+plantestsuite("samba3.blackbox.net.misc", "dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_misc.sh"),
+ scriptdir, "$SMB_CONF_PATH", configuration])
+plantestsuite("samba3.blackbox.net.local.registry", "dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
+ scriptdir, "$SMB_CONF_PATH", configuration])
+plantestsuite("samba3.blackbox.net.rpc.registry", "dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_registry.sh"),
+ scriptdir, "$SMB_CONF_PATH", configuration, 'rpc'])
+
+plantestsuite("samba3.blackbox.net.local.registry.roundtrip", "dc:local", [os.path.join(samba3srcdir, "script/tests/test_net_registry_roundtrip.sh"),
+ scriptdir, "$SMB_CONF_PATH", configuration])
+plantestsuite("samba3.blackbox.testparm", "dc:local", [os.path.join(samba3srcdir, "script/tests/test_testparm_s3.sh"),
+ "$LOCAL_PATH"])
+
+
+#smbtorture4 tests
+
+base = ["base.attr", "base.charset", "base.chkpath", "base.defer_open", "base.delaywrite", "base.delete",
+ "base.deny1", "base.deny2", "base.deny3", "base.denydos", "base.dir1", "base.dir2",
+ "base.disconnect", "base.fdpass", "base.lock",
+ "base.mangle", "base.negnowait", "base.ntdeny1",
+ "base.ntdeny2", "base.open", "base.openattr", "base.properties", "base.rename", "base.rw1",
+ "base.secleak", "base.tcon", "base.tcondev", "base.trans2", "base.unlink", "base.vuid",
+ "base.xcopy", "base.samba3error"]
+
+raw = ["raw.acls", "raw.chkpath", "raw.close", "raw.composite", "raw.context", "raw.eas",
+ "raw.ioctl", "raw.lock", "raw.mkdir", "raw.mux", "raw.notify", "raw.open", "raw.oplock"
+ "raw.qfileinfo", "raw.qfsinfo", "raw.read", "raw.rename", "raw.search", "raw.seek",
+ "raw.sfileinfo.base", "raw.sfileinfo.bug", "raw.streams", "raw.unlink", "raw.write",
+ "raw.samba3hide", "raw.samba3badpath", "raw.sfileinfo.rename",
+ "raw.samba3caseinsensitive", "raw.samba3posixtimedlock",
+ "raw.samba3rootdirfid", "raw.sfileinfo.end-of-file"]
+
+smb2 = ["smb2.lock", "smb2.read", "smb2.compound", "smb2.connect", "smb2.scan", "smb2.scanfind",
+ "smb2.bench-oplock"]
+
+rpc = ["rpc.authcontext", "rpc.samba3.bind", "rpc.samba3.srvsvc", "rpc.samba3.sharesec",
+ "rpc.samba3.spoolss", "rpc.samba3.wkssvc", "rpc.samba3.winreg",
+ "rpc.samba3.getaliasmembership-0",
+ "rpc.samba3.netlogon", "rpc.samba3.sessionkey", "rpc.samba3.getusername",
+ "rpc.svcctl", "rpc.ntsvcs", "rpc.winreg", "rpc.eventlog",
+ "rpc.spoolss.printserver", "rpc.spoolss.win", "rpc.spoolss.notify", "rpc.spoolss.printer",
+ "rpc.spoolss.driver",
+ "rpc.lsa-getuser", "rpc.lsa.lookupsids", "rpc.lsa.lookupnames",
+ "rpc.lsa.privileges",
+ "rpc.samr", "rpc.samr.users", "rpc.samr.users.privileges", "rpc.samr.passwords",
+ "rpc.samr.passwords.pwdlastset", "rpc.samr.large-dc", "rpc.samr.machine.auth",
+ "rpc.samba3.netlogon", "rpc.netlogon.admin",
+ "rpc.schannel", "rpc.schannel2", "rpc.bench-schannel1", "rpc.join", "rpc.bind", "rpc.epmapper"]
+
+local = ["local.nss-wrapper", "local.ndr"]
+
+winbind = ["winbind.struct", "winbind.wbclient"]
+
+rap = ["rap.basic", "rap.rpc", "rap.printing", "rap.sam"]
+
+unix = ["unix.info2", "unix.whoami"]
+
+tests= base + raw + smb2 + rpc + unix + local + winbind + rap
+
+sub = subprocess.Popen("%s --version 2> /dev/null" % smb4torture, stdout=subprocess.PIPE, stdin=subprocess.PIPE, shell=True)
+sub.communicate("")
+
+if sub.returncode == 0:
+ for t in tests:
+ if t == "base.delaywrite":
+ plansmbtorturetestsuite(t, "dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --maximum-runtime=900')
+ elif t == "unix.whoami":
+ plansmbtorturetestsuite(t, "dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD')
+ elif t == "raw.samba3posixtimedlock":
+ plansmbtorturetestsuite(t, "dc", '//$SERVER_IP/tmpguest -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/dc/share')
+ else:
+ plansmbtorturetestsuite(t, "dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
+
+ if t == "raw.chkpath":
+ plansmbtorturetestsuite(t, "dc", '//$SERVER_IP/tmpcase -U$USERNAME%$PASSWORD')
diff --git a/source3/selftest/tests.sh b/source3/selftest/tests.sh
deleted file mode 100755
index 202e842473..0000000000
--- a/source3/selftest/tests.sh
+++ /dev/null
@@ -1,206 +0,0 @@
-#!/bin/bash
-### ^^^FIXME -> sh ... breaks testing on *BSD etc. ... see FIXME's below
-# This script generates a list of testsuites that should be run as part of
-# the Samba 3 test suite.
-
-# The output of this script is parsed by selftest.pl, which then decides
-# which of the tests to actually run. It will, for example, skip all tests
-# listed in selftest/skip or only run a subset during "make quicktest".
-
-# The idea is that this script outputs all of the tests of Samba 3, not
-# just those that are known to pass, and list those that should be skipped
-# or are known to fail in selftest/skip or selftest/samba4-knownfail. This makes it
-# very easy to see what functionality is still missing in Samba 3 and makes
-# it possible to run the testsuite against other servers, such as Samba 4 or
-# Windows that have a different set of features.
-
-# The syntax for a testsuite is "-- TEST --" on a single line, followed
-# by the name of the test, the environment it needs and the command to run, all
-# three separated by newlines. All other lines in the output are considered
-# comments.
-
-if [ ! -n "$PERL" ]
-then
- PERL=perl
-fi
-
-plantest() {
- name=$1
- env=$2
- shift 2
- cmdline="$*"
- echo "-- TEST --"
- if [ "$env" = "none" ]; then
- fullname="samba3.$name"
- else
- fullname="samba3.$name ($env)"
- fi
- echo $fullname
- echo $env
- echo $cmdline "2>&1" "| ../selftest/filter-subunit --prefix \"$fullname.\""
-}
-
-TEST_FUNCTIONS_SH="INCLUDED"
-testit() {
- name=$1
- shift 1
- cmdline="$*"
-
- plantest "$testitprefix$name" $testitenv $cmdline
- return
-}
-
-testok() {
- true
- return
-}
-
-BINDIR=`dirname $0`/../bin
-export BINDIR
-
-SCRIPTDIR=`dirname $0`/../script/tests
-export SCRIPTDIR
-
-CONFIGURATION="--configfile \$SMB_CONF_PATH"
-export CONFIGURATION
-
-CONFFILE="\$SMB_CONF_PATH"
-export CONFFILE
-
-SERVER="\$SERVER"
-export SERVER
-
-USERNAME="\$USERNAME"
-export USERNAME
-
-PASSWORD="\$PASSWORD"
-export PASSWORD
-
-LOCAL_PATH="\$LOCAL_PATH"
-export LOCAL_PATH
-
-plantest "blackbox.success" dc:local LOCAL_PATH="$LOCAL_PATH" BINDIR="$BINDIR" SCRIPTDIR="$SCRIPTDIR" SERVERCONFFILE="\$SMB_CONF_PATH" script/tests/test_success.sh
-plantest "blackbox.failure" dc:local LOCAL_PATH="$LOCAL_PATH" BINDIR="$BINDIR" SCRIPTDIR="$SCRIPTDIR" SERVERCONFFILE="\$SMB_CONF_PATH" script/tests/test_failure.sh
-
-(
- shift $#
- testitprefix="local_s3."
- testitenv="none"
- . $SCRIPTDIR/test_local_s3.sh
-)
-
-(
- shift $#
- testitprefix="smbtorture_s3.plain."
- testitenv="dc"
-#FIXME: shell sourcing with ARGS is just supported by bash but bash isn't everywhere.
- . $SCRIPTDIR/test_smbtorture_s3.sh //\$SERVER_IP/tmp \$USERNAME \$PASSWORD "" "" "-l \$LOCAL_PATH"
-)
-
-(
- shift $#
- testitprefix="smbtorture_s3.crypt."
- testitenv="dc"
-#FIXME: shell sourcing with ARGS is just supported by bash but bash isn't everywhere.
- . $SCRIPTDIR/test_smbtorture_s3.sh //\$SERVER_IP/tmp \$USERNAME \$PASSWORD "" "-e" "-l \$LOCAL_PATH"
-)
-
-(
- shift $#
- testitprefix="wbinfo_s3."
- testitenv="dc:local"
-#FIXME: shell sourcing with ARGS is just supported by bash but bash isn't everywhere.
- . $SCRIPTDIR/test_wbinfo_s3.sh \$DOMAIN \$SERVER \$USERNAME \$PASSWORD
-)
-
-(
- shift $#
- testitprefix="wbinfo_s3."
- testitenv="dc:local"
-#FIXME: shell sourcing with ARGS is just supported by bash but bash isn't everywhere.
- . $SCRIPTDIR/test_wbinfo_s3.sh \$DOMAIN \$SERVER \$DOMAIN\\\\\$USERNAME \$PASSWORD
-)
-
-(
- shift $#
- testitprefix="wbinfo_s3."
- testitenv="member:local"
-#FIXME: shell sourcing with ARGS is just supported by bash but bash isn't everywhere.
- . $SCRIPTDIR/test_wbinfo_s3.sh \$DOMAIN \$SERVER \$DOMAIN\\\\\$USERNAME \$PASSWORD
-)
-
-(
- shift $#
- testitprefix="ntlm_auth_s3."
- testitenv="dc:local"
- . $SCRIPTDIR/test_ntlm_auth_s3.sh
-)
-
-# plain
-plantest "blackbox.smbclient_auth.plain" dc BINDIR="$BINDIR" script/tests/test_smbclient_auth.sh \$SERVER \$SERVER_IP \$USERNAME \$PASSWORD \$USERID
-plantest "blackbox.smbclient_auth.plain sec share" secshare BINDIR="$BINDIR" script/tests/test_smbclient_auth.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD \$USERID
-plantest "blackbox.smbclient_auth.plain member creds" member BINDIR="$BINDIR" script/tests/test_smbclient_auth.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD \$USERID
-
-plantest "blackbox.smbclient_s3.plain" dc BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$USERNAME \$PASSWORD \$USERID \$LOCAL_PATH \$PREFIX
-plantest "blackbox.smbclient_s3.plain member creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD \$USERID \$LOCAL_PATH \$PREFIX
-#plantest "blackbox.smbclient_s3.plain domain creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$DOMAIN\\\\\$DC_USERNAME \$DC_PASSWORD \$USERID \$LOCAL_PATH \$PREFIX
-
-# sign, only the member server allows signing
-plantest "blackbox.smbclient_s3.sign member creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD \$USERID \$LOCAL_PATH \$PREFIX "--signing=required"
-#plantest "blackbox.smbclient_s3.sign domain creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$DOMAIN\\\\\$DC_USERNAME \$DC_PASSWORD \$USERID \$LOCAL_PATH \$PREFIX "--signing=required"
-
-# encrypted
-plantest "blackbox.smbclient_s3.crypt" dc BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$USERNAME \$PASSWORD \$USERID \$LOCAL_PATH \$PREFIX "-e"
-
-# these don't work yet
-#plantest "blackbox.smbclient_s3.crypt member creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$SERVER\\\\\$USERNAME \$PASSWORD "-e"
-#plantest "blackbox.smbclient_s3.crypt domain creds" member BINDIR="$BINDIR" script/tests/test_smbclient_s3.sh \$SERVER \$SERVER_IP \$DOMAIN\\\\\$DC_USERNAME \$DC_PASSWORD "-e"
-
-plantest "blackbox.net.misc" dc:local BINDIR="$BINDIR" SCRIPTDIR="$SCRIPTDIR" SERVERCONFFILE="\$SMB_CONF_PATH" script/tests/test_net_misc.sh
-plantest "blackbox.net.local.registry" dc:local BINDIR="$BINDIR" SCRIPTDIR="$SCRIPTDIR" SERVERCONFFILE="\$SMB_CONF_PATH" script/tests/test_net_registry.sh
-plantest "blackbox.net.rpc.registry" dc BINDIR="$BINDIR" SCRIPTDIR="$SCRIPTDIR" SERVERCONFFILE="\$SMB_CONF_PATH" script/tests/test_net_registry.sh rpc
-plantest "blackbox.net.local.registry.roundtrip" dc:local BINDIR="$BINDIR" SCRIPTDIR="$SCRIPTDIR" SERVERCONFFILE="\$SMB_CONF_PATH" script/tests/test_net_registry_roundtrip.sh
-plantest "blackbox.testparm" dc:local LOCAL_PATH="$LOCAL_PATH" BINDIR="$BINDIR" SCRIPTDIR="$SCRIPTDIR" SERVERCONFFILE="\$SMB_CONF_PATH" script/tests/test_testparm_s3.sh
-
-(
- shift $#
- testitprefix="posix_s3."
- testitenv="dc"
-
- SMBTORTURE4BINARY=$SMBTORTURE4
- TORTURE4_OPTIONS=""
- TORTURE4_OPTIONS="$TORTURE4_OPTIONS --configfile=\$SMB_CONF_PATH"
- TORTURE4_OPTIONS="$TORTURE4_OPTIONS --maximum-runtime=$SELFTEST_MAXTIME"
- TORTURE4_OPTIONS="$TORTURE4_OPTIONS --target=$SELFTEST_TARGET"
- TORTURE4_OPTIONS="$TORTURE4_OPTIONS --basedir=$SELFTEST_PREFIX"
- TORTURE4_OPTIONS="$TORTURE4_OPTIONS --option=\"torture:winbindd_netbios_name=\$SERVER\""
- TORTURE4_OPTIONS="$TORTURE4_OPTIONS --option=\"torture:winbindd_netbios_domain=\$DOMAIN\""
- if [ -n "$SELFTEST_VERBOSE" ]; then
- TORTURE4_OPTIONS="$TORTURE4_OPTIONS --option=torture:progress=no"
- fi
- TORTURE4_OPTIONS="$TORTURE4_OPTIONS --format=subunit"
- if [ -n "$SELFTEST_QUICK" ]; then
- TORTURE4_OPTIONS="$TORTURE4_OPTIONS --option=torture:quick=yes"
- fi
-
- # This is an ugly hack...
- TORTURE4_OPTIONS="$TORTURE4_OPTIONS --option=torture:localdir=$SELFTEST_PREFIX/dc/share"
-
- if [ -x "$SMBTORTURE4" ]; then
- LIB_PATH_VAR_VAR="\$`echo $LIB_PATH_VAR`"
- S4_LIB_PREFIX=`eval echo "$LIB_PATH_VAR=\"$SAMBA4SHAREDDIR:$LIB_PATH_VAR_VAR\""`
- SMBTORTURE4="$S4_LIB_PREFIX $SMBTORTURE4"
- SMBTORTURE4VERSION=`eval $SMBTORTURE4 --version`
- fi
- if [ -n "$SMBTORTURE4" -a -n "$SMBTORTURE4VERSION" ];then
- echo "Using SMBTORTURE4: $SMBTORTURE4BINARY"
- echo "Version: $SMBTORTURE4VERSION"
-#FIXME: shell sourcing with ARGS is just supported by bash but bash isn't everywhere.
- . $SCRIPTDIR/test_posix_s3.sh //\$SERVER_IP/tmp \$USERNAME \$PASSWORD "" ""
- else
- echo "Skip Tests with Samba4's smbtorture"
- echo "Try to compile with --with-smbtorture4-path=PATH to enable"
- fi
-
-)
-
diff --git a/source3/selftest/wscript b/source3/selftest/wscript
index 0e44f07c43..9a9cf90e95 100644
--- a/source3/selftest/wscript
+++ b/source3/selftest/wscript
@@ -163,7 +163,7 @@ def cmd_testonly(opt):
os.makedirs(env.SELFTEST_PREFIX, int('755', 8))
# We use the full path rather than relative path because it cause problems on some plateforms (ie. solaris 8).
- cmd = '(${PERL} ${srcdir}/selftest/selftest.pl --target=samba3 --prefix=${SELFTEST_PREFIX} --builddir=. --srcdir=${srcdir} --exclude=${srcdir}/source3/selftest/skip --testlist="${srcdir}/source3/selftest/tests.sh|" ${OPTIONS} --socket-wrapper ${TESTS} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS} | tee ${SELFTEST_PREFIX}/subunit'
+ cmd = '(${PERL} ${srcdir}/selftest/selftest.pl --target=samba3 --prefix=${SELFTEST_PREFIX} --builddir=. --srcdir=${srcdir} --exclude=${srcdir}/source3/selftest/skip --testlist="${srcdir}/source3/selftest/tests.py|" ${OPTIONS} --socket-wrapper ${TESTS} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS} | tee ${SELFTEST_PREFIX}/subunit'
if os.environ.get('RUN_FROM_BUILD_FARM') is None and not Options.options.FILTERED_SUBUNIT:
cmd += ' | ${FORMAT_TEST_OUTPUT}'
else: