summaryrefslogtreecommitdiffstats
path: root/meta-selftest
diff options
context:
space:
mode:
authorDaisuke Yamane <daisuke.yamane@cybertrust.co.jp>2020-03-14 13:09:42 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-26 14:00:50 +0100
commitcaa530a277fd67cb88a077dddcad4b60911cf332 (patch)
tree9b06ae1e9ab520e0a3e49e00acd733ec47300687 /meta-selftest
parent6efa038c01e42af7602f805b9035df7ab4e0df73 (diff)
downloadpoky-caa530a277fd67cb88a077dddcad4b60911cf332.tar.gz
selftest/package: Add test to ensure ownership is preserved
Yocto Bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13806 Add test_preserve_ownership to selftest/package. This test creates a file, a directory and a symbolic link and changes ownership, then compares with them installed in rootfs to ensure ownership is preserved. [Test without a commit 'bitbake: lib/bb/utils.py: Preserve ownership of symlink'] | 2020-03-14 10:01:14,519 - oe-selftest - INFO - test_preserve_ownership (package.PackageTests) | 2020-03-14 10:56:44,612 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/file | 2020-03-14 10:56:44,770 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/dir | 2020-03-14 10:56:44,822 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/symlink | 2020-03-14 10:56:44,879 - oe-selftest - ERROR - Incrrect ownership /etc/selftest-chown/symlink [root:root] | 2020-03-14 10:56:45,884 - oe-selftest - INFO - ... FAIL [Test with a commit 'bitbake: lib/bb/utils.py: Preserve ownership of symlink'] | 2020-03-14 10:58:49,599 - oe-selftest - INFO - test_preserve_ownership (package.PackageTests) | 2020-03-14 11:51:39,947 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/file | 2020-03-14 11:51:40,013 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/dir | 2020-03-14 11:51:40,063 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/symlink | 2020-03-14 11:51:41,118 - oe-selftest - INFO - ... ok (From OE-Core rev: 88c1824468109d0f78d5fee7b71baa1f3944db7f) Signed-off-by: Daisuke Yamane <daisuke.yamane@cybertrust.co.jp> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-selftest')
-rw-r--r--meta-selftest/recipes-test/selftest-chown/selftest-chown.bb25
1 files changed, 25 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/selftest-chown/selftest-chown.bb b/meta-selftest/recipes-test/selftest-chown/selftest-chown.bb
new file mode 100644
index 0000000000..87bf9438b8
--- /dev/null
+++ b/meta-selftest/recipes-test/selftest-chown/selftest-chown.bb
@@ -0,0 +1,25 @@
1SUMMARY = "selftest chown"
2LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
3
4LICENSE = "MIT"
5
6S = "${WORKDIR}"
7
8inherit useradd allarch
9
10USERADD_PACKAGES = "${PN}"
11USERADD_PARAM_${PN} = "-u 1234 -M test"
12TESTDIR = "${D}${sysconfdir}/selftest-chown"
13
14do_install() {
15 install -d ${TESTDIR}
16 install -d ${TESTDIR}/dir
17 touch ${TESTDIR}/file
18 ln -s ./file ${TESTDIR}/symlink
19
20 chown test:test ${TESTDIR}/file
21 chown -R test:test ${TESTDIR}/dir
22 chown -h test:test ${TESTDIR}/symlink
23}
24
25FILES_${PN} = "${sysconfdir}/selftest-chown/*"