summaryrefslogtreecommitdiffstats
path: root/test/TEST-01-BASIC
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2023-08-11 16:46:53 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2023-08-12 10:13:56 +0200
commit7294632c2c00fe9a4c0bd60fa57dd5d50c4d72f4 (patch)
treefbe6c1b8293a71934328b9ea108c0dab7cf912ee /test/TEST-01-BASIC
parenttest: correctly propagate return code from check_result hooks (diff)
downloadsystemd-7294632c2c00fe9a4c0bd60fa57dd5d50c4d72f4.tar.xz
systemd-7294632c2c00fe9a4c0bd60fa57dd5d50c4d72f4.zip
test: introduce TEST-08-INITRD
And move the initrd related tests from TEST-01-BASIC there. Additionally, this should provide coverage for recemt shutdown initrd related issues, see: - https://github.com/systemd/systemd/issues/28645 - https://github.com/systemd/systemd/pull/28648 - https://github.com/systemd/systemd/pull/28793
Diffstat (limited to 'test/TEST-01-BASIC')
-rwxr-xr-xtest/TEST-01-BASIC/test.sh34
1 files changed, 5 insertions, 29 deletions
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
index c729e95f1d..93185cf896 100755
--- a/test/TEST-01-BASIC/test.sh
+++ b/test/TEST-01-BASIC/test.sh
@@ -17,37 +17,13 @@ KERNEL_APPEND="foo -- -z bar --- baz $KERNEL_APPEND"
. "${TEST_BASE_DIR:?}/test-functions"
test_append_files() {
- # install tests manually so the test is functional even when -Dinstall-tests=false
- local dst="${1:?}/usr/lib/systemd/tests/testdata/units/"
+ local workspace="${1:?}"
+ local dst
+
+ # Install tests manually so the test is functional even when -Dinstall-tests=false
+ dst="$workspace/usr/lib/systemd/tests/testdata/units/"
mkdir -p "$dst"
cp -v "$TEST_UNITS_DIR"/{testsuite-01,end}.service "$TEST_UNITS_DIR/testsuite.target" "$dst"
}
-# Setup a one shot service in initrd that creates a dummy bind mount under /run
-# to check if the mount persists though the initrd transition. The "check" part
-# is in the respective testsuite-01.sh script.
-#
-# See: https://github.com/systemd/systemd/issues/28452
-run_qemu_hook() {
- local extra="$WORKDIR/initrd.extra"
-
- mkdir -m 755 "$extra"
- mkdir -m 755 "$extra/etc" "$extra/etc/systemd" "$extra/etc/systemd/system" "$extra/etc/systemd/system/initrd.target.wants"
-
- cat >"$extra/etc/systemd/system/initrd-run-mount.service" <<EOF
-[Unit]
-Description=Create a mount in /run that should survive the transition from initrd
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStart=sh -xec "mkdir /run/initrd-mount-source /run/initrd-mount-target; mount -v --bind /run/initrd-mount-source /run/initrd-mount-target"
-EOF
- ln -svrf "$extra/etc/systemd/system/initrd-run-mount.service" "$extra/etc/systemd/system/initrd.target.wants/initrd-run-mount.service"
-
- (cd "$extra" && find . | cpio -o -H newc -R root:root > "$extra.cpio")
-
- INITRD_EXTRA="$extra.cpio"
-}
-
do_test "$@"