1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

s3-selftest: run ntlm_auth against winbindd in make test

This commit is contained in:
Andrew Bartlett
2012-02-24 12:12:48 +11:00
parent 111d9f3eb2
commit b947d84c88
3 changed files with 15 additions and 6 deletions

View File

@ -10,7 +10,10 @@ fi
PYTHON=$1 PYTHON=$1
SRC3DIR=$2 SRC3DIR=$2
NTLM_AUTH=$3 NTLM_AUTH=$3
shift 3 DOMAIN=$4
USERNAME=$5
PASSWORD=$6
shift 6
ADDARGS="$*" ADDARGS="$*"
incdir=`dirname $0`/../../../testprogs/blackbox 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` testit "ntlm_auth" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $NTLM_AUTH $ADDARGS || failed=`expr $failed + 1`
# This should work even with NTLMv2 # 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 testok $0 $failed

View File

@ -137,7 +137,7 @@ for env in ["s3dc", "member", "s3member"]:
"samba3.ntlm_auth.diagnostics(%s:local)" % env, "%s:local" % env, "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]) [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"]: 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"]) 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"])

View File

@ -89,6 +89,9 @@ def parseCommandLine():
help="Domain server uses for local auth. [default: FOO]") help="Domain server uses for local auth. [default: FOO]")
parser.add_option("--server-helper", dest="server_helper",\ parser.add_option("--server-helper", dest="server_helper",\
help="Helper mode for the ntlm_auth server. [default: squid-2.5-server]") 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",\ parser.add_option("-s", "--configfile", dest="config_file",\
help="Path to smb.conf file. [default:/etc/samba/smb.conf") help="Path to smb.conf file. [default:/etc/samba/smb.conf")
@ -163,9 +166,11 @@ def main():
server_args = [] server_args = []
server_args.append("--helper-protocol=%s" % opts.server_helper) server_args.append("--helper-protocol=%s" % opts.server_helper)
server_args.append("--username=%s" % opts.server_username) if not opts.server_use_winbindd:
server_args.append("--password=%s" % opts.server_password) server_args.append("--username=%s" % opts.server_username)
server_args.append("--domain=%s" % opts.server_domain) server_args.append("--password=%s" % opts.server_password)
server_args.append("--domain=%s" % opts.server_domain)
server_args.append("--configfile=%s" % opts.config_file) server_args.append("--configfile=%s" % opts.config_file)
os.execv(ntlm_auth_path, server_args) os.execv(ntlm_auth_path, server_args)