summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-02-24 12:12:48 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-02-24 12:12:48 +1100
commitb947d84c88d1fcc3bdd75f3002bb38b673cbecd3 (patch)
tree3064a55c38017f63f6fa536fb5ed4c9fb54e1b3b /source3
parent111d9f3eb20ad0c3e3b6a7a01f7c997111c660d9 (diff)
downloadsamba-b947d84c88d1fcc3bdd75f3002bb38b673cbecd3.tar.gz
samba-b947d84c88d1fcc3bdd75f3002bb38b673cbecd3.tar.bz2
samba-b947d84c88d1fcc3bdd75f3002bb38b673cbecd3.zip
s3-selftest: run ntlm_auth against winbindd in make test
Diffstat (limited to 'source3')
-rwxr-xr-xsource3/script/tests/test_ntlm_auth_s3.sh8
-rwxr-xr-xsource3/selftest/tests.py2
-rwxr-xr-xsource3/torture/test_ntlm_auth.py11
3 files changed, 15 insertions, 6 deletions
diff --git a/source3/script/tests/test_ntlm_auth_s3.sh b/source3/script/tests/test_ntlm_auth_s3.sh
index 783ac03209..1655d7518b 100755
--- a/source3/script/tests/test_ntlm_auth_s3.sh
+++ b/source3/script/tests/test_ntlm_auth_s3.sh
@@ -10,7 +10,10 @@ fi
PYTHON=$1
SRC3DIR=$2
NTLM_AUTH=$3
-shift 3
+DOMAIN=$4
+USERNAME=$5
+PASSWORD=$6
+shift 6
ADDARGS="$*"
incdir=`dirname $0`/../../../testprogs/blackbox
@@ -20,7 +23,8 @@ failed=0
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 $NTLM_AUTH $ADDARGS --client-domain=fOo --server-domain=fOo || failed=`expr $failed + 1`
+testit "ntlm_auth with specified domain" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $NTLM_AUTH $ADDARGS --client-domain=fOo --server-domain=fOo || failed=`expr $failed + 1`
+testit "ntlm_auth against winbindd" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $NTLM_AUTH --client-username=$USERNAME --client-domain=$DOMAIN --client-password=$PASSWORD --server-use-winbindd $ADDARGS || failed=`expr $failed + 1`
testok $0 $failed
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 3f8dcc1f56..3af4ab3dd4 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -137,7 +137,7 @@ for env in ["s3dc", "member", "s3member"]:
"samba3.ntlm_auth.diagnostics(%s:local)" % env, "%s:local" % env,
[os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_diagnostics.sh"), binpath('ntlm_auth3'), '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', configuration])
-plantestsuite("samba3.ntlm_auth.(s3dc:local)", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_s3.sh"), valgrindify(python), samba3srcdir, binpath('ntlm_auth3'), configuration])
+ plantestsuite("samba3.ntlm_auth.(%s:local)" % env, "%s:local" % env, [os.path.join(samba3srcdir, "script/tests/test_ntlm_auth_s3.sh"), valgrindify(python), samba3srcdir, binpath('ntlm_auth3'), '$DOMAIN', '$DC_USERNAME', '$DC_PASSWORD', 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', binpath('smbclient3'), configuration + " --option=clientntlmv2auth=no"])
diff --git a/source3/torture/test_ntlm_auth.py b/source3/torture/test_ntlm_auth.py
index 12a4dae398..b6e06a9bd5 100755
--- a/source3/torture/test_ntlm_auth.py
+++ b/source3/torture/test_ntlm_auth.py
@@ -89,6 +89,9 @@ def parseCommandLine():
help="Domain server uses for local auth. [default: FOO]")
parser.add_option("--server-helper", dest="server_helper",\
help="Helper mode for the ntlm_auth server. [default: squid-2.5-server]")
+ parser.add_option("--server-use-winbindd", dest="server_use_winbindd",\
+ help="Use winbindd to check the password (rather than default username/pw)", action="store_true")
+
parser.add_option("-s", "--configfile", dest="config_file",\
help="Path to smb.conf file. [default:/etc/samba/smb.conf")
@@ -163,9 +166,11 @@ def main():
server_args = []
server_args.append("--helper-protocol=%s" % opts.server_helper)
- server_args.append("--username=%s" % opts.server_username)
- server_args.append("--password=%s" % opts.server_password)
- server_args.append("--domain=%s" % opts.server_domain)
+ if not opts.server_use_winbindd:
+ server_args.append("--username=%s" % opts.server_username)
+ server_args.append("--password=%s" % opts.server_password)
+ server_args.append("--domain=%s" % opts.server_domain)
+
server_args.append("--configfile=%s" % opts.config_file)
os.execv(ntlm_auth_path, server_args)