From: "'Clara Kowalsky' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Clara Kowalsky <clara.kowalsky@siemens.com>
Subject: [PATCH 2/2] testsuite: fix deterministic password test in image account extension
Date: Mon, 26 Oct 2026 13:18:44 +0100 [thread overview]
Message-ID: <20261026121844.663746-2-clara.kowalsky@siemens.com> (raw)
In-Reply-To: <20261026121844.663746-1-clara.kowalsky@siemens.com>
The test expected two process.run calls which worked for the original
crypt-based implementation. Commit 6144daf9 replaced crypt with an
openssl passwd subprocess, adding a third call, but did not update the
test.
Also mock the openssl output and verify the expected salt and password
input.
Fixes: 6144daf9 ("image-account-extension: Avoid deprecated crypt module")
Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
testsuite/unittests/test_image_account_extension.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/testsuite/unittests/test_image_account_extension.py b/testsuite/unittests/test_image_account_extension.py
index ecadc15f..fcc23506 100644
--- a/testsuite/unittests/test_image_account_extension.py
+++ b/testsuite/unittests/test_image_account_extension.py
@@ -117,11 +117,16 @@ class TestImageAccountExtensionImageCreateUsers(
)
with patch.object(process, 'run') as run_mock:
+ run_mock.return_value = (encrypted_password, '')
image_create_users(d)
password_data = f"{test_user}:{encrypted_password}".encode()
- assert run_mock.call_count == 2
+ assert run_mock.call_count == 3
+ run_mock.assert_any_call([
+ 'openssl', 'passwd', '-6', '--salt', 'eb2e2a12cccc88a',
+ cleartext_password,
+ ])
assert run_mock.call_args[0][1] == password_data
--
2.55.0
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20261026121844.663746-2-clara.kowalsky%40siemens.com.
next prev parent reply other threads:[~2026-10-26 12:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 12:18 [PATCH 1/2] testsuite: fix run_privileged_cmd in image account extension unit test 'Clara Kowalsky' via isar-users
2026-10-26 12:18 ` 'Clara Kowalsky' via isar-users [this message]
2026-10-26 12:41 ` [PATCH 2/2] testsuite: fix deterministic password test in image account extension 'Moessbauer, Felix' via isar-users
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261026121844.663746-2-clara.kowalsky@siemens.com \
--to=isar-users@googlegroups.com \
--cc=clara.kowalsky@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox