torture: test_ntlm_auth.py now has a require-membership-of argument
authorGarming Sam <garming@catalyst.net.nz>
Fri, 4 Jul 2014 00:50:37 +0000 (12:50 +1200)
committerKamen Mazdrashki <kamenim@samba.org>
Tue, 15 Jul 2014 11:33:57 +0000 (13:33 +0200)
Change-Id: I90c2172af792a082fbf49ee0ab7d6eedf5471440
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
source3/torture/test_ntlm_auth.py

index cb181be243b1d18bae7d5fffcb720f329b73958e..d17af9b0bf90b823637becfc141c8ef2cd1f93c3 100755 (executable)
@@ -97,6 +97,8 @@ def parseCommandLine():
                                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("--require-membership-of", dest="sid",\
+                               help="Require that the user is a member of this group to authenticate.")
 
 
        parser.add_option("-s", "--configfile", dest="config_file",\
@@ -180,6 +182,11 @@ def main():
                        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 opts.sid:
+                               raise Exception("Server must be using winbindd for require-membership-of.")
+               else:
+                       if opts.sid:
+                               server_args.append("--require-membership-of=%s" % opts.sid)
 
                server_args.append("--configfile=%s" % opts.config_file)