From: Rob van der Linde Date: Thu, 14 Dec 2023 23:36:14 +0000 (+1300) Subject: selftest: fix failing user setpassword test X-Git-Tag: talloc-2.4.2~246 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=562bde91b44620a475923b90d76eb2eaf5109141;p=thirdparty%2Fsamba.git 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 Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/tests/samba_tool/user.py b/python/samba/tests/samba_tool/user.py index 00f667bc487..26c9748ffc3 100644 --- a/python/samba/tests/samba_tool/user.py +++ b/python/samba/tests/samba_tool/user.py @@ -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: diff --git a/selftest/knownfail.d/samba_tool_user b/selftest/knownfail.d/samba_tool_user deleted file mode 100644 index a558a1f8979..00000000000 --- a/selftest/knownfail.d/samba_tool_user +++ /dev/null @@ -1 +0,0 @@ -^samba.tests.samba_tool.user.samba.tests.samba_tool.user.UserCmdTestCase.test_setpassword\(ad_dc_no_ntlm