summaryrefslogtreecommitdiffstats
path: root/meta-selftest/recipes-test/postinst/postinst_1.0.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-selftest/recipes-test/postinst/postinst_1.0.bb')
-rw-r--r--meta-selftest/recipes-test/postinst/postinst_1.0.bb14
1 files changed, 13 insertions, 1 deletions
diff --git a/meta-selftest/recipes-test/postinst/postinst_1.0.bb b/meta-selftest/recipes-test/postinst/postinst_1.0.bb
index d4bab6dcc2..913bfabf89 100644
--- a/meta-selftest/recipes-test/postinst/postinst_1.0.bb
+++ b/meta-selftest/recipes-test/postinst/postinst_1.0.bb
@@ -3,11 +3,12 @@ LICENSE = "MIT"
3 3
4inherit allarch 4inherit allarch
5 5
6PACKAGES = "${PN}-rootfs ${PN}-delayed-a ${PN}-delayed-b" 6PACKAGES = "${PN}-rootfs ${PN}-delayed-a ${PN}-delayed-b ${PN}-rootfs-failing"
7 7
8ALLOW_EMPTY_${PN}-rootfs = "1" 8ALLOW_EMPTY_${PN}-rootfs = "1"
9ALLOW_EMPTY_${PN}-delayed-a = "1" 9ALLOW_EMPTY_${PN}-delayed-a = "1"
10ALLOW_EMPTY_${PN}-delayed-b = "1" 10ALLOW_EMPTY_${PN}-delayed-b = "1"
11ALLOW_EMPTY_${PN}-rootfs-failing = "1"
11 12
12RDEPENDS_${PN}-delayed-a = "${PN}-rootfs" 13RDEPENDS_${PN}-delayed-a = "${PN}-rootfs"
13RDEPENDS_${PN}-delayed-b = "${PN}-delayed-a" 14RDEPENDS_${PN}-delayed-b = "${PN}-delayed-a"
@@ -58,3 +59,14 @@ pkg_postinst_ontarget_${PN}-delayed-b () {
58 59
59 touch ${TESTDIR}/delayed-b 60 touch ${TESTDIR}/delayed-b
60} 61}
62
63# This scriptlet intentionally includes a bogus command in the middle to test
64# that we catch and report such errors properly.
65pkg_postinst_${PN}-rootfs-failing () {
66 mkdir -p $D${TESTDIR}
67 touch $D${TESTDIR}/rootfs-before-failure
68 run_a_really_broken_command
69 # Scriptlet execution should stop here; the following commands are NOT supposed to run.
70 # (oe-selftest checks for it).
71 touch $D${TESTDIR}/rootfs-after-failure
72}