selftest: Pass the dcerpc binding object to self.waitForMessages in auth_log
authorAndrew Bartlett <abartlet@samba.org>
Mon, 12 Jun 2017 23:20:58 +0000 (11:20 +1200)
committerGarming Sam <garming@samba.org>
Wed, 14 Jun 2017 23:24:25 +0000 (01:24 +0200)
This ensures that object is not cleaned up, triggering a disconnect before we get back
the audit messages.  Otherwise they can be lost when the server task calls exit()
while the message thread is still trying to send them.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/tests/auth_log.py
python/samba/tests/auth_log_samlogon.py

index 6f32712c339170344ce3277534e0cd2848de7692..ff84befda4567a7ad2eb694e403ff14747599192 100644 (file)
@@ -250,16 +250,16 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
             binding = "[%s]" % binding
 
         if service == "dnsserver":
-            dnsserver.dnsserver("ncacn_ip_tcp:%s%s" % (self.server, binding),
-                                self.get_loadparm(),
-                                creds)
+            conn = dnsserver.dnsserver("ncacn_ip_tcp:%s%s" % (self.server, binding),
+                                       self.get_loadparm(),
+                                       creds)
         elif service == "srvsvc":
-           srvsvc.srvsvc("ncacn_ip_tcp:%s%s" % (self.server, binding),
-                         self.get_loadparm(),
-                         creds)
+            conn = srvsvc.srvsvc("ncacn_ip_tcp:%s%s" % (self.server, binding),
+                                 self.get_loadparm(),
+                                 creds)
 
 
-        messages = self.waitForMessages(isLastExpectedMessage)
+        messages = self.waitForMessages(isLastExpectedMessage, conn)
         checkFunction(messages, authTypes, service, binding, protection)
 
     def rpc_ncacn_ip_tcp_ntlm_check(self, messages, authTypes, service,
index cbef5a19308ae79c20c550b59ef930e759fe2571..d24986b68a54016241b90c77e5a7bcab8b2b3567 100644 (file)
@@ -152,7 +152,7 @@ class AuthLogTestsSamLogon(samba.tests.auth_log_base.AuthLogTestBase):
         (validation, authoritative, netr_flags_out) = result
 
 
-        messages = self.waitForMessages(isLastExpectedMessage)
+        messages = self.waitForMessages(isLastExpectedMessage, netlogon_conn)
         checkFunction(messages)
 
     def samlogon_check(self, messages):