public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: isar-users@googlegroups.com
Cc: tobias.schaffner@siemens.com,
	Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v2 2/2] add unit test for user creation with groups
Date: Thu, 27 Jul 2023 03:24:15 +0000	[thread overview]
Message-ID: <20230727032415.3366650-2-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20230727032415.3366650-1-felix.moessbauer@siemens.com>

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 testsuite/unittests/test_image_account_extension.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testsuite/unittests/test_image_account_extension.py b/testsuite/unittests/test_image_account_extension.py
index b7ad0c5c..08021a4a 100644
--- a/testsuite/unittests/test_image_account_extension.py
+++ b/testsuite/unittests/test_image_account_extension.py
@@ -39,12 +39,15 @@ class TestImageAccountExtensionImageCreateUsers(TestImageAccountExtensionCommon)
     def test_new_user(self):
         test_user = "new"
         d, rootfs = self.setup(test_user)
+        # make the list a bit clumsy to simulate appends and removals to that var
+        d.setVarFlag('USER_{}'.format(test_user), 'groups', 'dialout render  foo ')
 
         with patch.object(bb.process, "run") as run_mock:
             image_create_users(d)
 
         run_mock.assert_called_once_with(
-            ["sudo", "-E", "chroot", rootfs.path(), "/usr/sbin/useradd", test_user])
+            ["sudo", "-E", "chroot", rootfs.path(), "/usr/sbin/useradd",
+             '--groups', 'dialout,render,foo', test_user])
 
     def test_existing_user_no_change(self):
         test_user = "test"
-- 
2.34.1


  reply	other threads:[~2023-07-27  3:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27  3:24 [PATCH v2 1/2] fix group splitting in user creation Felix Moessbauer
2023-07-27  3:24 ` Felix Moessbauer [this message]
2023-08-01  7:21 ` Schaffner, Tobias
2023-08-02 21:31 ` Uladzimir Bely

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=20230727032415.3366650-2-felix.moessbauer@siemens.com \
    --to=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=tobias.schaffner@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