From: Zhihang Wei <wzh@ilbers.de>
To: Clara Kowalsky <clara.kowalsky@siemens.com>, isar-users@googlegroups.com
Subject: Re: [PATCH v2 1/4] testsuite: fix run_privileged_cmd in image account extension unit test
Date: Thu, 29 Oct 2026 15:23:06 +0100 [thread overview]
Message-ID: <73fed67d-acf3-4c2f-8eb3-85ece2241c44@ilbers.de> (raw)
In-Reply-To: <20261026143132.1067398-1-clara.kowalsky@siemens.com>
Applied to next, thanks.
Zhihang
On 10/26/26 15:31, 'Clara Kowalsky' via isar-users wrote:
> The account functions use run_privileged_cmd which BitBake provides
> through base.bbclass. The tests load the functions in isolation, so the
> helper is undefined and the tests fail with:
>
> NameError: name 'run_privileged_cmd' is not defined
>
> Fix this by providing a stub for the helper in the test namespace.
>
> Fixes: 14acf490 ("introduce wrappers for privileged execution")
> Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
> ---
> testsuite/unittests/test_image_account_extension.py | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/testsuite/unittests/test_image_account_extension.py b/testsuite/unittests/test_image_account_extension.py
> index ff0e47e0..8bf5f82b 100644
> --- a/testsuite/unittests/test_image_account_extension.py
> +++ b/testsuite/unittests/test_image_account_extension.py
> @@ -18,8 +18,16 @@ from bb import process
> from bb.data_smart import DataSmart
>
> file_name = 'meta/classes-recipe/image-account-extension.bbclass'
> +
> +
> +def run_privileged_cmd(d):
> + return 'sudo -E'
> +
> +
> image_create_users = load_function(file_name, 'image_create_users')
> +image_create_users.__globals__['run_privileged_cmd'] = run_privileged_cmd
> image_create_groups = load_function(file_name, 'image_create_groups')
> +image_create_groups.__globals__['run_privileged_cmd'] = run_privileged_cmd
>
>
> class TestImageAccountExtensionCommon(unittest.TestCase):
--
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/73fed67d-acf3-4c2f-8eb3-85ece2241c44%40ilbers.de.
prev parent reply other threads:[~2026-10-29 14:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 14:31 'Clara Kowalsky' via isar-users
2026-10-26 14:31 ` [PATCH v2 2/4] testsuite: fix deterministic password test in image account extension 'Clara Kowalsky' via isar-users
2026-10-26 14:31 ` [PATCH v2 3/4] testsuite: run Python unittests in fast suite 'Clara Kowalsky' via isar-users
2026-10-26 14:31 ` [PATCH v2 4/4] testsuite: improve documentation for running Python unittests 'Clara Kowalsky' via isar-users
2026-10-29 14:23 ` Zhihang Wei [this message]
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=73fed67d-acf3-4c2f-8eb3-85ece2241c44@ilbers.de \
--to=wzh@ilbers.de \
--cc=clara.kowalsky@siemens.com \
--cc=isar-users@googlegroups.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