]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: function _get_attribute() was in two places
authorRob van der Linde <rob@catalyst.net.nz>
Wed, 13 Dec 2023 03:39:06 +0000 (16:39 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 21 Dec 2023 02:05:38 +0000 (02:05 +0000)
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/samba_tool/user_virtualCryptSHA.py

index 38b1c9375b826a9dc87bba889a6e72425d085602..73661a4e620d788e9eaa71f2e3b40ef21a4a513f 100644 (file)
@@ -22,6 +22,7 @@ import base64
 import ldb
 import samba
 from samba.tests.samba_tool.base import SambaToolCmdTest
+from samba.tests.samba_tool.user_virtualCryptSHA_base import _get_attribute
 from samba.credentials import Credentials
 from samba.samdb import SamDB
 from samba.auth import system_session
@@ -33,19 +34,6 @@ import re
 USER_NAME = "CryptSHATestUser"
 HASH_OPTION = "password hash userPassword schemes"
 
-# Get the value of an attribute from the output string
-# Note: Does not correctly handle values spanning multiple lines,
-#       which is acceptable for it's usage in these tests.
-
-
-def _get_attribute(out, name):
-    p = re.compile("^" + name + r":\s+(\S+)")
-    for line in out.split("\n"):
-        m = p.match(line)
-        if m:
-            return m.group(1)
-    return ""
-
 
 class UserCmdCryptShaTestCase(SambaToolCmdTest):
     """