tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth ccached credentials with...
authorSamuel Cabrero <scabrero@suse.de>
Fri, 31 Aug 2018 15:07:23 +0000 (17:07 +0200)
committerNoel Power <npower@samba.org>
Wed, 19 Dec 2018 11:42:11 +0000 (12:42 +0100)
Port ntlm_auth bash script tests to python

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/ntlm_auth.py
source3/script/tests/test_ntlm_auth_s3.sh

index 35895397e53e1d2c5f96a8323be31aefce784030..c3e0dc337ac00e14ff26f94342cc8e220e1b86f9 100644 (file)
@@ -114,3 +114,24 @@ class NTLMAuthHelpersTests(NTLMAuthTestCase):
                               server_helper="gss-spnego",
                               server_use_winbind=True)
         self.assertTrue(ret)
+
+    def test_ntlmssp_gss_spnego_cached_creds(self):
+        """ ntlm_auth with NTLMSSP client and gss-spnego server against
+        winbind with cached credentials """
+
+        param = "--ccache-save=%s%s%s%%%s" % (self.domain,
+                                              self.winbind_separator,
+                                              self.username,
+                                              self.password)
+        cache_cmd = ["wbinfo",
+                     param]
+        self.check_exit_code(cache_cmd, 0)
+
+        ret = self.run_helper(client_username=self.username,
+                              client_password=self.password,
+                              client_domain=self.domain,
+                              client_use_cached_creds=True,
+                              client_helper="ntlmssp-client-1",
+                              server_helper="gss-spnego",
+                              server_use_winbind=True)
+        self.assertTrue(ret)
index 12bdc65e89733dd73205c60c19283b50ddbe226d..4df0788fa15382804a227c043e25329e20504ec7 100755 (executable)
@@ -269,9 +269,6 @@ EOF
 }
 
 # This should work even with NTLMv2
-testit "wbinfo store cached credentials" $BINDIR/wbinfo --ccache-save=$DOMAIN/$USERNAME%$PASSWORD || failed=`expr $failed + 1`
-testit "ntlm_auth ccached credentials with NTLMSSP client and gss-spnego server" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $NTLM_AUTH $ADDARGS --client-username=$USERNAME --client-domain=$DOMAIN --client-use-cached-creds --client-helper=ntlmssp-client-1 --server-helper=gss-spnego --server-use-winbindd || failed=`expr $failed + 1`
-
 testit "ntlm_auth against winbindd with require-membership-of" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $NTLM_AUTH --client-username=$USERNAME --client-domain=$DOMAIN --client-password=$PASSWORD --server-use-winbindd $ADDARGS --require-membership-of=$SID || failed=`expr $failed + 1`
 testit "ntlm_auth with NTLMSSP gss-spnego-client and gss-spnego server against winbind with require-membership-of" $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $NTLM_AUTH --client-username=$USERNAME --client-domain=$DOMAIN --client-password=$PASSWORD --server-use-winbindd --client-helper=gss-spnego-client --server-helper=gss-spnego $ADDARGS --require-membership-of=$SID || failed=`expr $failed + 1`