public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Zk47T" <zizuzacker@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: zizuzacker@gmail.com
Subject: [PATCH 2/2] meta-selftest: add usegroup-deponly recipe to test USERADD_DEPENDS only
Date: Wed,  8 Apr 2026 22:00:03 +0700	[thread overview]
Message-ID: <20260408150003.18063-3-zizuzacker@gmail.com> (raw)
In-Reply-To: <20260408150003.18063-1-zizuzacker@gmail.com>

Add a test recipe that inherits useradd and only sets USERADD_DEPENDS
without USERADD_PACKAGES to validate the fix for [YOCTO #15863].

The root bug is that useradd.bbclass unconditionally requires
USERADD_PACKAGES to be set, even when a recipe only needs to depend on
users/groups created by another recipe via USERADD_DEPENDS. This recipe
depends on creategroup1 for user gt1 and group grouptest, but does not
create any users/groups itself, exercising the code path fixed in the
previous commit.

Signed-off-by: Zk47T <zizuzacker@gmail.com>
---
 .../selftest-users/usegroup-deponly.bb        | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 meta-selftest/recipes-test/selftest-users/usegroup-deponly.bb

diff --git a/meta-selftest/recipes-test/selftest-users/usegroup-deponly.bb b/meta-selftest/recipes-test/selftest-users/usegroup-deponly.bb
new file mode 100644
index 0000000000..e5db7a47ea
--- /dev/null
+++ b/meta-selftest/recipes-test/selftest-users/usegroup-deponly.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Test recipe that only uses USERADD_DEPENDS without USERADD_PARAM"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+LICENSE = "MIT"
+
+# This recipe depends on the user/group created by creategroup1
+# but does NOT create users or groups itself.
+USERADD_DEPENDS = "creategroup1"
+
+S = "${WORKDIR}/sources"
+UNPACKDIR = "${S}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit useradd allarch
+
+TESTDIR = "${D}${sysconfdir}/deponly"
+
+do_install() {
+	install -d   ${TESTDIR}
+	touch        ${TESTDIR}/file
+	chown gt1:grouptest ${TESTDIR}/file
+}
+
+FILES:${PN} = "${sysconfdir}/deponly/*"
-- 
2.34.1



      parent reply	other threads:[~2026-04-08 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 15:00 [PATCH 0/2] useradd.bbclass: fix parse error when only USERADD_DEPENDS is set Zk47T
2026-04-08 15:00 ` [PATCH 1/2] useradd.bbclass: allow inheriting with only USERADD_DEPENDS set Zk47T
2026-04-08 15:00 ` Zk47T [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=20260408150003.18063-3-zizuzacker@gmail.com \
    --to=zizuzacker@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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