]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
ptest-runner: add non-root ptest user for tests to run as
authorRoss Burton <ross.burton@arm.com>
Mon, 27 Feb 2023 13:13:02 +0000 (13:13 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Feb 2023 13:27:56 +0000 (13:27 +0000)
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 <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-support/ptest-runner/ptest-runner_2.4.2.bb

index 5a1d329993029649a13c2a01be224a56eccc04e4..ee13e28c7dfaccdb42997ef801e225026145199a 100644 (file)
@@ -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"