diff --git a/python/samba/netcmd/user/readpasswords/getpassword.py b/python/samba/netcmd/user/readpasswords/getpassword.py index b06bf58fdead..b5496a8d631b 100644 --- a/python/samba/netcmd/user/readpasswords/getpassword.py +++ b/python/samba/netcmd/user/readpasswords/getpassword.py @@ -197,4 +197,4 @@ def run(self, username=None, H=None, filter=None, ldif = samdb.write_ldif(obj, ldb.CHANGETYPE_NONE) self.outf.write("%s" % ldif) - self.outf.write("Got password OK\n") + self.errf.write("Got password OK\n") diff --git a/python/samba/tests/samba_tool/user.py b/python/samba/tests/samba_tool/user.py index e43a00c472e1..00f667bc4871 100644 --- a/python/samba/tests/samba_tool/user.py +++ b/python/samba/tests/samba_tool/user.py @@ -346,8 +346,7 @@ def test_setpassword(self): "--attributes=%s" % attributes, "--decrypt-samba-gpg") self.assertCmdSuccess(result, out, err, "Ensure getpassword runs") - self.assertEqual(err, "", "getpassword without url") - self.assertMatch(out, "Got password OK", "getpassword without url") + 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: @@ -357,7 +356,7 @@ def test_setpassword(self): self.assertNotIn("unicodePwd:: %s" % unicodePwd, out) self.assertMatch(out, "supplementalCredentials:: ", "getpassword supplementalCredentials: out[%s]" % out) - self._verify_supplementalCredentials(out.replace("\nGot password OK\n", "")) + self._verify_supplementalCredentials(out) if "virtualSambaGPG:: " in out: self.assertMatch(out, "virtualClearTextUTF8:: %s" % virtualClearTextUTF8, "getpassword virtualClearTextUTF8: out[%s]" % out) diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA.py b/python/samba/tests/samba_tool/user_virtualCryptSHA.py index e58340436a26..e95a4be2aa97 100644 --- a/python/samba/tests/samba_tool/user_virtualCryptSHA.py +++ b/python/samba/tests/samba_tool/user_virtualCryptSHA.py @@ -73,10 +73,7 @@ def _get_password(self, attributes, decrypt=False): out, err, "Ensure getpassword runs") - self.assertEqual(err, "", "getpassword") - self.assertMatch(out, - "Got password OK", - "getpassword out[%s]" % out) + self.assertEqual(err, "Got password OK\n", "getpassword") return out # Change the just the NT password hash, as would happen if the password diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py b/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py index 19cd713eacf2..14e3de97a2f7 100644 --- a/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py +++ b/python/samba/tests/samba_tool/user_virtualCryptSHA_base.py @@ -79,10 +79,7 @@ def _get_password(self, attributes, decrypt=False): out, err, "Ensure getpassword runs") - self.assertEqual(err, "", "getpassword") - self.assertMatch(out, - "Got password OK", - "getpassword out[%s]" % out) + self.assertEqual(err, "Got password OK\n", "getpassword") return out # Change the just the NT password hash, as would happen if the password diff --git a/python/samba/tests/samba_tool/user_wdigest.py b/python/samba/tests/samba_tool/user_wdigest.py index d11531205993..0d8776203de7 100644 --- a/python/samba/tests/samba_tool/user_wdigest.py +++ b/python/samba/tests/samba_tool/user_wdigest.py @@ -89,10 +89,7 @@ def _testWDigest(self, attribute, expected, missing=False): out, err, "Ensure getpassword runs") - self.assertEqual(err, "", "getpassword") - self.assertMatch(out, - "Got password OK", - "getpassword out[%s]" % out) + self.assertEqual(err, "Got password OK\n", "getpassword") if missing: self.assertTrue(attribute not in out)