drsbase: use credentials if supplied
authorGarming Sam <garming@catalyst.net.nz>
Wed, 8 Mar 2017 04:13:40 +0000 (17:13 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 13 Mar 2017 04:10:11 +0000 (05:10 +0100)
Pair-programmed-with: Bob Campbell <bobcampbell@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/torture/drs/python/drs_base.py

index e6f6e48234e23982be9f0ae04110fe3b98b48b45..f07592d9e5619ea1c12b40a9923042cd27d13026 100644 (file)
@@ -352,10 +352,12 @@ class DrsBaseTestCase(SambaToolCmdTest):
 
         return req10
 
 
         return req10
 
-    def _ds_bind(self, server_name):
+    def _ds_bind(self, server_name, creds=None):
         binding_str = "ncacn_ip_tcp:%s[seal]" % server_name
 
         binding_str = "ncacn_ip_tcp:%s[seal]" % server_name
 
-        drs = drsuapi.drsuapi(binding_str, self.get_loadparm(), self.get_credentials())
+        if creds is None:
+            creds = self.get_credentials()
+        drs = drsuapi.drsuapi(binding_str, self.get_loadparm(), creds)
         (drs_handle, supported_extensions) = drs_DsBind(drs)
         return (drs, drs_handle)
 
         (drs_handle, supported_extensions) = drs_DsBind(drs)
         return (drs, drs_handle)