]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest:audit_log_base: use string_is_guid()
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 28 Feb 2024 03:19:59 +0000 (16:19 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 29 Feb 2024 04:01:40 +0000 (04:01 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/audit_log_base.py

index fa5ecc7cace39e9948b773aa5e9e85d92102b9f5..e82b9bedf5a56aa1c6fc1e3cd89fbb1e94f5d638 100644 (file)
@@ -21,10 +21,10 @@ import samba.tests
 from samba.messaging import Messaging
 from samba.dcerpc.messaging import MSG_AUTH_LOG, AUTH_EVENT_NAME
 from samba.param import LoadParm
+from samba import string_is_guid
 import time
 import json
 import os
-import re
 
 
 def getAudit(message):
@@ -190,14 +190,9 @@ class AuditLogTestBase(samba.tests.TestCase):
                 # No new messages. We’ve probably got them all.
                 break
 
-    GUID_RE = re.compile(
-        "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")
-
-    #
-    # Is the supplied GUID string correctly formatted
-    #
     def is_guid(self, guid):
-        return self.GUID_RE.fullmatch(guid)
+        """Is the supplied GUID string correctly formatted"""
+        return string_is_guid(guid)
 
     def get_session(self):
         return self.auth_context["sessionId"]