Some tests really don't want to be run as root, either because they
expect to get "permission denied" errors occasionally, or have explicit
checks.

Instead of numerous recipes re-inventing user creation in run-ptest,
create a user in the ptest-runner recipe that they can all use.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/recipes-support/ptest-runner/ptest-runner_2.4.2.bb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/recipes-support/ptest-runner/ptest-runner_2.4.2.bb 
b/meta/recipes-support/ptest-runner/ptest-runner_2.4.2.bb
index 5a1d3299930..ee13e28c7df 100644
--- a/meta/recipes-support/ptest-runner/ptest-runner_2.4.2.bb
+++ b/meta/recipes-support/ptest-runner/ptest-runner_2.4.2.bb
@@ -32,3 +32,8 @@ RDEPENDS:${PN}:append:libc-glibc = " libgcc"
 
 # pstree is called by ptest-runner-collect-system-data
 RDEPENDS:${PN}:append = " pstree"
+
+# Create a non-root user that test suites can use easily
+inherit useradd
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM:${PN} = "--system --no-create-home --home / --user-group ptest"
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#177792): 
https://lists.openembedded.org/g/openembedded-core/message/177792
Mute This Topic: https://lists.openembedded.org/mt/97265501/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to