diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-04-15 16:39:53 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-04-16 11:43:04 +0200 |
commit | 1870d254956ec56b8116a923adc38f8aae675963 (patch) | |
tree | 052f3b9f9966b143563678066d3f2c63d3975d77 | |
parent | 48bb69ef001be8270ddf145fa4884a2c5ddc2645 (diff) | |
download | samba-1870d254956ec56b8116a923adc38f8aae675963.tar.gz samba-1870d254956ec56b8116a923adc38f8aae675963.tar.bz2 samba-1870d254956ec56b8116a923adc38f8aae675963.zip |
selftest Add binary mappings for samba3 selftest
This will help us have a top level 'make test', working around the
fact that the --eanble-s3build has different names for some of these
binaries, without fixing the names forever (we can just change the
mapping later).
Andrew Bartlett
-rw-r--r-- | selftest/target/Samba3.pm | 12 | ||||
-rwxr-xr-x | source3/script/tests/test_ntlm_auth_s3.sh | 9 | ||||
-rwxr-xr-x | source3/script/tests/test_smbclient_auth.sh | 7 | ||||
-rwxr-xr-x | source3/script/tests/test_smbclient_s3.sh | 7 | ||||
-rwxr-xr-x | source3/script/tests/test_smbtorture_s3.sh | 7 | ||||
-rwxr-xr-x | source3/selftest/s3-selftest.sh | 2 | ||||
-rwxr-xr-x | source3/selftest/tests.py | 24 | ||||
-rw-r--r-- | source3/selftest/wscript | 7 |
8 files changed, 43 insertions, 32 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 75ede8739a..088acfdcc6 100644 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -863,11 +863,11 @@ sub wait_for_start($$) print "delaying for nbt name registration\n"; sleep(10); # This will return quickly when things are up, but be slow if we need to wait for (eg) SSL init - system($self->{bindir_path}->($self, "nmblookup") ." $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} __SAMBA__"); - system($self->{bindir_path}->($self, "nmblookup") ." $envvars->{CONFIGURATION} __SAMBA__"); - system($self->{bindir_path}->($self, "nmblookup") ." $envvars->{CONFIGURATION} -U 127.255.255.255 __SAMBA__"); - system($self->{bindir_path}->($self, "nmblookup") ." $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} $envvars->{SERVER}"); - system($self->{bindir_path}->($self, "nmblookup") ." $envvars->{CONFIGURATION} $envvars->{SERVER}"); + system($self->{bindir_path}->($self, "nmblookup3") ." $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} __SAMBA__"); + system($self->{bindir_path}->($self, "nmblookup3") ." $envvars->{CONFIGURATION} __SAMBA__"); + system($self->{bindir_path}->($self, "nmblookup3") ." $envvars->{CONFIGURATION} -U 127.255.255.255 __SAMBA__"); + system($self->{bindir_path}->($self, "nmblookup3") ." $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} $envvars->{SERVER}"); + system($self->{bindir_path}->($self, "nmblookup3") ." $envvars->{CONFIGURATION} $envvars->{SERVER}"); # make sure smbd is also up set print "wait for smbd\n"; @@ -875,7 +875,7 @@ sub wait_for_start($$) my $count = 0; my $ret; do { - $ret = system($self->{bindir_path}->($self, "smbclient") ." $envvars->{CONFIGURATION} -L $envvars->{SERVER} -U% -p 139"); + $ret = system($self->{bindir_path}->($self, "smbclient3") ." $envvars->{CONFIGURATION} -L $envvars->{SERVER} -U% -p 139"); if ($ret != 0) { sleep(2); } diff --git a/source3/script/tests/test_ntlm_auth_s3.sh b/source3/script/tests/test_ntlm_auth_s3.sh index 99b2ab3f14..783ac03209 100755 --- a/source3/script/tests/test_ntlm_auth_s3.sh +++ b/source3/script/tests/test_ntlm_auth_s3.sh @@ -2,14 +2,15 @@ if [ $# -lt 2 ]; then cat <<EOF -Usage: test_ntlm_auth_s3.sh PYTHON SRC3DIR +Usage: test_ntlm_auth_s3.sh PYTHON SRC3DIR NTLM_AUTH EOF exit 1; fi PYTHON=$1 SRC3DIR=$2 -shift 2 +NTLM_AUTH=$3 +shift 3 ADDARGS="$*" incdir=`dirname $0`/../../../testprogs/blackbox @@ -17,9 +18,9 @@ incdir=`dirname $0`/../../../testprogs/blackbox failed=0 -testit "ntlm_auth" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $BINDIR/ntlm_auth $ADDARGS || failed=`expr $failed + 1` +testit "ntlm_auth" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $NTLM_AUTH $ADDARGS || failed=`expr $failed + 1` # This should work even with NTLMv2 -testit "ntlm_auth" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $BINDIR/ntlm_auth $ADDARGS --client-domain=fOo --server-domain=fOo || failed=`expr $failed + 1` +testit "ntlm_auth" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $NTLM_AUTH $ADDARGS --client-domain=fOo --server-domain=fOo || failed=`expr $failed + 1` testok $0 $failed diff --git a/source3/script/tests/test_smbclient_auth.sh b/source3/script/tests/test_smbclient_auth.sh index f2f3ad3371..b90334f0cd 100755 --- a/source3/script/tests/test_smbclient_auth.sh +++ b/source3/script/tests/test_smbclient_auth.sh @@ -4,7 +4,7 @@ if [ $# -lt 4 ]; then cat <<EOF -Usage: test_smbclient_s3.sh SERVER SERVER_IP USERNAME PASSWORD <smbclient arguments> +Usage: test_smbclient_s3.sh SERVER SERVER_IP USERNAME PASSWORD SMBCLIENT <smbclient arguments> EOF exit 1; fi @@ -13,8 +13,9 @@ SERVER="$1" SERVER_IP="$2" USERNAME="$3" PASSWORD="$4" -SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient}" -shift 4 +SMBCLIENT="$5" +SMBCLIENT="$VALGRIND ${SMBCLIENT}" +shift 5 ADDARGS="$*" incdir=`dirname $0`/../../../testprogs/blackbox diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index 972f68f42b..0395f3e12c 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -4,7 +4,7 @@ if [ $# -lt 7 ]; then cat <<EOF -Usage: test_smbclient_s3.sh SERVER SERVER_IP USERNAME PASSWORD USERID LOCAL_PATH PREFIX +Usage: test_smbclient_s3.sh SERVER SERVER_IP USERNAME PASSWORD USERID LOCAL_PATH PREFIX SMBCLIENT EOF exit 1; fi @@ -16,9 +16,10 @@ PASSWORD="$4" USERID="$5" LOCAL_PATH="$6" PREFIX="$7" -SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient}" +SMBCLIENT="$8" +SMBCLIENT="$VALGRIND ${SMBCLIENT}" WBINFO="$VALGRIND ${WBINFO:-$BINDIR/wbinfo}" -shift 7 +shift 8 ADDARGS="$*" incdir=`dirname $0`/../../../testprogs/blackbox diff --git a/source3/script/tests/test_smbtorture_s3.sh b/source3/script/tests/test_smbtorture_s3.sh index 65c98a58ec..07d940faa1 100755 --- a/source3/script/tests/test_smbtorture_s3.sh +++ b/source3/script/tests/test_smbtorture_s3.sh @@ -4,7 +4,7 @@ if [ $# -lt 4 ]; then cat <<EOF -Usage: test_smbtorture_s3.sh TEST UNC USERNAME PASSWORD <smbtorture args> +Usage: test_smbtorture_s3.sh TEST UNC USERNAME PASSWORD SMBTORTURE <smbtorture args> EOF exit 1; fi @@ -13,7 +13,8 @@ t="$1" unc="$2" username="$3" password="$4" -shift 4 +SMBTORTURE="$5" +shift 5 ADDARGS="$*" incdir=`dirname $0`/../../../testprogs/blackbox @@ -22,6 +23,6 @@ incdir=`dirname $0`/../../../testprogs/blackbox failed=0 -testit "smbtorture" $VALGRIND $BINDIR/smbtorture $unc -U"$username"%"$password" $ADDARGS $t || failed=`expr $failed + 1` +testit "smbtorture" $VALGRIND $SMBTORTURE $unc -U"$username"%"$password" $ADDARGS $t || failed=`expr $failed + 1` testok $0 $failed diff --git a/source3/selftest/s3-selftest.sh b/source3/selftest/s3-selftest.sh index 00ed0c49ee..a9ff875da2 100755 --- a/source3/selftest/s3-selftest.sh +++ b/source3/selftest/s3-selftest.sh @@ -20,6 +20,7 @@ st_test_done() { if [ "x${RUN_FROM_BUILD_FARM}" = "xyes" ]; then ( rm -f ${SELFTESTPREFIX}/st_done && \ ${PERL} ${SELFTESTDIR}/selftest.pl \ + --binary-mapping=smbtorture3:smbtorture,nmblookup3:nmblookup,smbclient3:smbclient,ntlm_auth3:ntlm_auth \ --prefix=${SELFTESTPREFIX} --target=samba3 \ --testlist="${PYTHON} ${SOURCEDIR}/selftest/tests.py|" \ --exclude=${SOURCEDIR}/selftest/skip \ @@ -33,6 +34,7 @@ if [ "x${RUN_FROM_BUILD_FARM}" = "xyes" ]; then else ( rm -f ${SELFTESTPREFIX}/st_done && \ ${PERL} ${SELFTESTDIR}/selftest.pl \ + --binary-mapping=smbtorture3:smbtorture,nmblookup3:nmblookup,smbclient3:smbclient,ntlm_auth3:ntlm_auth \ --prefix=${SELFTESTPREFIX} --target=samba3 \ --testlist="${PYTHON} ${SOURCEDIR}/selftest/tests.py|" \ --exclude=${SOURCEDIR}/selftest/skip \ diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index a21e151ec7..2655f45a17 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -63,8 +63,8 @@ tests=[ "FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", "LOCK5", "LOCK6", "LOCK7", "LOCAL-string_to_sid", "LOCAL-CONVERT-STRING" ] 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"]) + 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', binpath('smbtorture3'), "", "-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', binpath('smbtorture3'), "-e", "-l $LOCAL_PATH"]) tests=["--ping", "--separator", "--own-domain", @@ -96,36 +96,36 @@ plantestsuite( "samba3.wbinfo_sids2xids.(member:local)", "member:local", [os.path.join(samba3srcdir, "script/tests/test_wbinfo_sids2xids.sh")]) -plantestsuite("samba3.ntlm_auth.(dc:local)", "dc:local", [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_s3.sh"), valgrindify(python), samba3srcdir, configuration]) +plantestsuite("samba3.ntlm_auth.(dc:local)", "dc:local", [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_s3.sh"), valgrindify(python), samba3srcdir, binpath('ntlm_auth3'), 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]) + 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', binpath('smbclient3'), configuration]) for env in ["secserver"]: - plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) domain creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN\\\\$DC_USERNAME', '$DC_PASSWORD', configuration + " --option=clientntlmv2auth=no"]) + plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) domain creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN\\\\$DC_USERNAME', '$DC_PASSWORD', binpath('smbclient3'), configuration + " --option=clientntlmv2auth=no"]) 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]) + 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', binpath('smbclient3'), configuration]) for env in ["secshare", "secserver"]: - plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) local creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', configuration + " --option=clientntlmv2auth=no --option=clientlanmanauth=yes"]) + plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) local creds" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', binpath('smbclient3'), configuration + " --option=clientntlmv2auth=no --option=clientlanmanauth=yes"]) # 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]) + 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', binpath('smbclient3'), 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]) + 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', binpath('smbclient3'), 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"]) + 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', binpath('smbclient3'), 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"]) + 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', binpath('smbclient3'), 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"]) + 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', binpath('smbclient3'), 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"), diff --git a/source3/selftest/wscript b/source3/selftest/wscript index db9233049f..1a266880c8 100644 --- a/source3/selftest/wscript +++ b/source3/selftest/wscript @@ -103,7 +103,12 @@ def cmd_testonly(opt): if o[0:1] != '_': os.environ['TESTENV_%s' % o.upper()] = str(getattr(Options.options, o, '')) - env.OPTIONS = '' + binary_mappings = ('smbtorture3:smbtorture,' + + 'nmblookup3:nmblookup,' + + 'smbclient3:smbclient,' + + 'ntlm_auth3:ntlm_auth') + + env.OPTIONS = '--binary-mapping=' + binary_mappings if not Options.options.SLOWTEST: env.OPTIONS += ' --exclude=${srcdir}/source3/selftest/slow' if Options.options.QUICKTEST: |