[PATCH] Remove flapping part of the audit log tests

Andrew Bartlett abartlet at samba.org
Mon Jun 25 20:38:31 UTC 2018


G'Day Gary,

This part of the LSA secrets and password change audit logging tests is
flapping, because we can get the messages from smbd and the s4
rpc_server code out of order. 

We don't need to check that here, so remove this part of the tests. 

CI: https://gitlab.com/catalyst-samba/samba/pipelines/24545250

If indicated, please review and push

Andrew Bartlett
-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba
-------------- next part --------------
From 6a2d3b86024b593747a7060d51c3bd7ba29ee004 Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet at samba.org>
Date: Tue, 26 Jun 2018 08:29:46 +1200
Subject: [PATCH] dsdb-audit: Remove flapping part of the tests

Because we have tests for this in the auth audit code, we do not need to have
the complexity of checking that we got DCE/RPC over SMB as an authorization
message here.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
---
 python/samba/tests/audit_log_dsdb.py | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/python/samba/tests/audit_log_dsdb.py b/python/samba/tests/audit_log_dsdb.py
index 53d45737424..abcdb9dc413 100644
--- a/python/samba/tests/audit_log_dsdb.py
+++ b/python/samba/tests/audit_log_dsdb.py
@@ -150,8 +150,10 @@ class AuditLogDsdbTests(AuditLogTestBase):
                                  self.remoteAddress)
         session_id = self.get_session()
         self.assertEquals(session_id, audit["sessionId"])
-        service_description = self.get_service_description()
-        self.assertEquals(service_description, "DCE/RPC")
+        # We skip the check for self.get_service_description() as this
+        # is subject to a race between smbd and the s4 rpc_server code
+        # as to which will set the description as it is DCE/RPC over SMB
+
         self.assertTrue(self.is_guid(audit["transactionId"]))
 
         attributes = audit["attributes"]
@@ -189,8 +191,10 @@ class AuditLogDsdbTests(AuditLogTestBase):
                                  self.remoteAddress)
         session_id = self.get_session()
         self.assertEquals(session_id, audit["sessionId"])
-        service_description = self.get_service_description()
-        self.assertEquals(service_description, "DCE/RPC")
+        # We skip the check for self.get_service_description() as this
+        # is subject to a race between smbd and the s4 rpc_server code
+        # as to which will set the description as it is DCE/RPC over SMB
+
         self.assertTrue(self.is_guid(audit["transactionId"]))
 
         attributes = audit["attributes"]
@@ -434,8 +438,11 @@ class AuditLogDsdbTests(AuditLogTestBase):
         self.assertTrue(self.is_guid(audit["sessionId"]))
         session_id = self.get_session()
         self.assertEquals(session_id, audit["sessionId"])
-        service_description = self.get_service_description()
-        self.assertEquals(service_description, "DCE/RPC")
+
+        # We skip the check for self.get_service_description() as this
+        # is subject to a race between smbd and the s4 rpc_server code
+        # as to which will set the description as it is DCE/RPC over SMB
+
         attributes = audit["attributes"]
         self.assertEquals(2, len(attributes))
 
@@ -480,8 +487,11 @@ class AuditLogDsdbTests(AuditLogTestBase):
         self.assertTrue(self.is_guid(audit["sessionId"]))
         session_id = self.get_session()
         self.assertEquals(session_id, audit["sessionId"])
-        service_description = self.get_service_description()
-        self.assertEquals(service_description, "DCE/RPC")
+
+        # We skip the check for self.get_service_description() as this
+        # is subject to a race between smbd and the s4 rpc_server code
+        # as to which will set the description as it is DCE/RPC over SMB
+
 
     def test_modify(self):
 
-- 
2.14.4



More information about the samba-technical mailing list