diff options
author | Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com> | 2024-02-23 13:25:21 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-24 16:10:22 +0000 |
commit | 396bc832b75f5f83184367994305d28c6a186b09 (patch) | |
tree | cbdbe5362ee091621fc262110e03b46280fc0153 /meta-selftest | |
parent | f6daeba2e97e47550e959fb85d4639ef81d268e7 (diff) | |
download | poky-396bc832b75f5f83184367994305d28c6a186b09.tar.gz |
selftest-users: Convoluted selftest for USERADD_DEPENDS
This adds a test for 13904's fix by creating a convoluted set of recipes
with USERADD_DEPENDS in non-alpha order.
(From OE-Core rev: bfff81195cb9ba2493e366022470b2e0051d8071)
Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-selftest')
4 files changed, 136 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/selftest-users/acreategroup.bb b/meta-selftest/recipes-test/selftest-users/acreategroup.bb new file mode 100644 index 0000000000..66ed5695a2 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/acreategroup.bb | |||
@@ -0,0 +1,32 @@ | |||
1 | SUMMARY = "creategroup_a" | ||
2 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
3 | |||
4 | LICENSE = "MIT" | ||
5 | |||
6 | S = "${WORKDIR}" | ||
7 | |||
8 | EXCLUDE_FROM_WORLD="1" | ||
9 | |||
10 | inherit useradd allarch | ||
11 | |||
12 | USERADD_PACKAGES = "${PN}" | ||
13 | USERADD_PARAM:${PN} = "-u 5560 --gid a_group a_user" | ||
14 | GROUPADD_PARAM:${PN} = "-r a_group" | ||
15 | |||
16 | TESTDIR = "${D}${sysconfdir}/creategroup" | ||
17 | |||
18 | do_install() { | ||
19 | install -d ${TESTDIR} | ||
20 | install -d ${TESTDIR}/dir | ||
21 | touch ${TESTDIR}/file | ||
22 | ln -s ./file ${TESTDIR}/symlink | ||
23 | install -d ${TESTDIR}/fifotest | ||
24 | mkfifo ${TESTDIR}/fifotest/fifo | ||
25 | |||
26 | chown a_user:a_group ${TESTDIR}/file | ||
27 | chown -R a_user:a_group ${TESTDIR}/dir | ||
28 | chown -h a_user:a_group ${TESTDIR}/symlink | ||
29 | chown -R a_user:a_group ${TESTDIR}/fifotest | ||
30 | } | ||
31 | |||
32 | FILES:${PN} = "${sysconfdir}/creategroup/*" | ||
diff --git a/meta-selftest/recipes-test/selftest-users/bcreategroup.bb b/meta-selftest/recipes-test/selftest-users/bcreategroup.bb new file mode 100644 index 0000000000..c4844dd0da --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/bcreategroup.bb | |||
@@ -0,0 +1,37 @@ | |||
1 | SUMMARY = "creategroup_b" | ||
2 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
3 | |||
4 | LICENSE = "MIT" | ||
5 | |||
6 | # This recipe requires a and c. C requires A. Reverse alpha. | ||
7 | |||
8 | USERADD_DEPENDS = "acreategroup ccreategroup" | ||
9 | |||
10 | S = "${WORKDIR}" | ||
11 | |||
12 | EXCLUDE_FROM_WORLD="1" | ||
13 | |||
14 | inherit useradd allarch | ||
15 | |||
16 | USERADD_PACKAGES = "${PN}" | ||
17 | USERADD_PARAM:${PN} = "-u 5561 -g b_group -G a_group,c_group b_user " | ||
18 | GROUPADD_PARAM:${PN} = "-r b_group" | ||
19 | |||
20 | TESTDIR = "${D}${sysconfdir}/creategroup" | ||
21 | |||
22 | do_install() { | ||
23 | install -d ${TESTDIR} | ||
24 | install -d ${TESTDIR}/dir | ||
25 | touch ${TESTDIR}/file | ||
26 | ln -s ./file ${TESTDIR}/symlink | ||
27 | install -d ${TESTDIR}/fifotest | ||
28 | mkfifo ${TESTDIR}/fifotest/fifo | ||
29 | |||
30 | chown a_user:a_group ${TESTDIR}/file | ||
31 | chown -R c_user:c_group ${TESTDIR}/dir | ||
32 | chown -h a_user:a_group ${TESTDIR}/symlink | ||
33 | chown -R b_user:b_group ${TESTDIR}/fifotest | ||
34 | } | ||
35 | |||
36 | FILES:${PN} = "${sysconfdir}/creategroup/*" | ||
37 | |||
diff --git a/meta-selftest/recipes-test/selftest-users/ccreategroup.bb b/meta-selftest/recipes-test/selftest-users/ccreategroup.bb new file mode 100644 index 0000000000..021b1ebbf7 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/ccreategroup.bb | |||
@@ -0,0 +1,34 @@ | |||
1 | SUMMARY = "creategroup_c" | ||
2 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
3 | |||
4 | LICENSE = "MIT" | ||
5 | |||
6 | USERADD_DEPENDS = "acreategroup" | ||
7 | |||
8 | S = "${WORKDIR}" | ||
9 | |||
10 | EXCLUDE_FROM_WORLD="1" | ||
11 | |||
12 | inherit useradd allarch | ||
13 | |||
14 | USERADD_PACKAGES = "${PN}" | ||
15 | USERADD_PARAM:${PN} = "-u 5563 --gid c_group -G a_group c_user" | ||
16 | GROUPADD_PARAM:${PN} = "-r c_group" | ||
17 | |||
18 | TESTDIR = "${D}${sysconfdir}/creategroup" | ||
19 | |||
20 | do_install() { | ||
21 | install -d ${TESTDIR} | ||
22 | install -d ${TESTDIR}/dir | ||
23 | touch ${TESTDIR}/file | ||
24 | ln -s ./file ${TESTDIR}/symlink | ||
25 | install -d ${TESTDIR}/fifotest | ||
26 | mkfifo ${TESTDIR}/fifotest/fifo | ||
27 | |||
28 | chown c_user:c_group ${TESTDIR}/file | ||
29 | chown -R c_user:c_group ${TESTDIR}/dir | ||
30 | chown -h c_user:c_group ${TESTDIR}/symlink | ||
31 | chown -R c_user:c_group ${TESTDIR}/fifotest | ||
32 | } | ||
33 | |||
34 | FILES:${PN} = "${sysconfdir}/creategroup/*" | ||
diff --git a/meta-selftest/recipes-test/selftest-users/dcreategroup.bb b/meta-selftest/recipes-test/selftest-users/dcreategroup.bb new file mode 100644 index 0000000000..b96ca92a16 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/dcreategroup.bb | |||
@@ -0,0 +1,33 @@ | |||
1 | SUMMARY = "creategroup_d" | ||
2 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
3 | |||
4 | LICENSE = "MIT" | ||
5 | |||
6 | USERADD_DEPENDS = "bcreategroup" | ||
7 | |||
8 | S = "${WORKDIR}" | ||
9 | |||
10 | EXCLUDE_FROM_WORLD="1" | ||
11 | |||
12 | inherit useradd allarch | ||
13 | |||
14 | USERADD_PACKAGES = "${PN}" | ||
15 | USERADD_PARAM:${PN} = "-u 5564 -g d_group -G b_group d_user " | ||
16 | GROUPADD_PARAM:${PN} = "-r d_group" | ||
17 | |||
18 | TESTDIR = "${D}${sysconfdir}/creategroup" | ||
19 | |||
20 | do_install() { | ||
21 | install -d ${TESTDIR} | ||
22 | install -d ${TESTDIR}/dir | ||
23 | touch ${TESTDIR}/file | ||
24 | ln -s ./file ${TESTDIR}/symlink | ||
25 | install -d ${TESTDIR}/fifotest | ||
26 | mkfifo ${TESTDIR}/fifotest/fifo | ||
27 | |||
28 | chown d_user:d_group ${TESTDIR}/file | ||
29 | chown -R d_user:b_group ${TESTDIR}/dir | ||
30 | chown -h d_user:d_group ${TESTDIR}/symlink | ||
31 | chown -R d_user:b_group ${TESTDIR}/fifotest | ||
32 | } | ||
33 | |||