1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-19 12:23:49 +03:00

selftest: function _get_attribute() was in two places

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>
This commit is contained in:
Rob van der Linde
2023-12-13 16:39:06 +13:00
committed by Douglas Bagnall
parent 8cfc6ea923
commit b236856a3e

View 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):
"""