1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

selftest: fix failing user setpassword test

A side effect of being able to generate at read time unicodePwd for a gMSA is that we can also generate the unicodePwd from a virtualSambaGPG password.

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-15 12:36:14 +13:00 committed by Douglas Bagnall
parent 8b67a86584
commit 562bde91b4
2 changed files with 2 additions and 3 deletions

View File

@ -324,7 +324,7 @@ class UserCmdTestCase(SambaToolCmdTest):
"syncpasswords --no-wait: 'sAMAccountName': %s out[%s]" % (user["name"], out))
self.assertMatch(out, "# unicodePwd::: REDACTED SECRET ATTRIBUTE",
"getpassword '# unicodePwd::: REDACTED SECRET ATTRIBUTE': out[%s]" % out)
if expect_nt_hash:
if expect_nt_hash or "virtualSambaGPG:: " in out:
self.assertMatch(out, "unicodePwd:: %s" % unicodePwd,
"getpassword unicodePwd: out[%s]" % out)
else:
@ -349,7 +349,7 @@ class UserCmdTestCase(SambaToolCmdTest):
self.assertEqual(err, "Got password OK\n", "getpassword without url")
self.assertMatch(out, "sAMAccountName: %s" % (user["name"]),
"getpassword: 'sAMAccountName': %s out[%s]" % (user["name"], out))
if expect_nt_hash:
if expect_nt_hash or "virtualSambaGPG:: " in out:
self.assertMatch(out, "unicodePwd:: %s" % unicodePwd,
"getpassword unicodePwd: out[%s]" % out)
else:

View File

@ -1 +0,0 @@
^samba.tests.samba_tool.user.samba.tests.samba_tool.user.UserCmdTestCase.test_setpassword\(ad_dc_no_ntlm