s3-selftest: run ntlm_auth against winbindd in make test
authorAndrew Bartlett <abartlet@samba.org>
Fri, 24 Feb 2012 01:12:48 +0000 (12:12 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 24 Feb 2012 01:12:48 +0000 (12:12 +1100)
source3/script/tests/test_ntlm_auth_s3.sh
source3/selftest/tests.py
source3/torture/test_ntlm_auth.py

index 783ac03209c79d1b934d0e1792d6dfb35d1102e1..1655d7518b53396b9b215d2574b604bf2e0c5e19 100755 (executable)
@@ -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
index 3f8dcc1f564449eb0251a62d7de0e8bea8f94c10..3af4ab3dd403c2bb0e17f5a9c9f5cc80483862a9 100755 (executable)
@@ -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"])
index 12a4dae398c92938d7c3260b00ff65546292c500..b6e06a9bd583fd886e28beba242c4e013702c034 100755 (executable)
@@ -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)