diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 1e0b622f60..66a58c56d7 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -71,7 +71,7 @@ jobs: steps: - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 - - uses: systemd/mkosi@22d212dcb229b553572578ef16c809f9a9961ee8 + - uses: systemd/mkosi@55f17a8ae67ece9712324c3107804daad94ad0d9 # Freeing up disk space with rm -rf can take multiple minutes. Since we don't need the extra free space # immediately, we remove the files in the background. However, we first move them to a different location diff --git a/mkosi.conf b/mkosi.conf index 6ed10d6292..9d23f4f8b2 100644 --- a/mkosi.conf +++ b/mkosi.conf @@ -40,6 +40,9 @@ KernelCommandLine=systemd.crash_shell panic=-1 softlockup_panic=1 panic_on_warn=1 + # These don't ship proper units with [Install] directives so we have to mask them instead. + systemd.mask=isc-dhcp-server.service + systemd.mask=mdmonitor.service [Host] Credentials=journal.storage=persistent diff --git a/mkosi.images/minimal-0/mkosi.conf b/mkosi.images/minimal-0/mkosi.conf index 3315d4b4a9..a929fb6eea 100644 --- a/mkosi.images/minimal-0/mkosi.conf +++ b/mkosi.images/minimal-0/mkosi.conf @@ -2,6 +2,7 @@ [Config] Dependencies=minimal-base +ConfigureScripts= [Distribution] CacheOnly=always diff --git a/mkosi.images/minimal-1/mkosi.conf b/mkosi.images/minimal-1/mkosi.conf index 3315d4b4a9..a929fb6eea 100644 --- a/mkosi.images/minimal-1/mkosi.conf +++ b/mkosi.images/minimal-1/mkosi.conf @@ -2,6 +2,7 @@ [Config] Dependencies=minimal-base +ConfigureScripts= [Distribution] CacheOnly=always diff --git a/mkosi.images/minimal-base/mkosi.conf b/mkosi.images/minimal-base/mkosi.conf index 477db6150f..7eb147379f 100644 --- a/mkosi.images/minimal-base/mkosi.conf +++ b/mkosi.images/minimal-base/mkosi.conf @@ -1,5 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1-or-later +[Config] +ConfigureScripts= + [Output] Format=directory diff --git a/mkosi.images/system/mkosi.conf b/mkosi.images/system/mkosi.conf index f7f32a07e6..4d3d2d9aa1 100644 --- a/mkosi.images/system/mkosi.conf +++ b/mkosi.images/system/mkosi.conf @@ -20,7 +20,7 @@ ExtraTrees= %O/minimal-1.root-%a.raw:/usr/share/minimal_1.raw %O/minimal-1.root-%a-verity.raw:/usr/share/minimal_1.verity %O/minimal-1.root-%a-verity-sig.raw:/usr/share/minimal_1.verity.sig - %O/minimal-base:/usr/share/testsuite-13-container-template + %O/minimal-base:/usr/share/TEST-13-NSPAWN-container-template Packages= acl @@ -42,7 +42,9 @@ Packages= kmod knot less + lvm2 man + mdadm mtools nano nftables diff --git a/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf index 0a91f6e226..ee1f02cfae 100644 --- a/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.conf @@ -30,6 +30,8 @@ Packages= iputils linux man-db + multipath-tools + open-iscsi openbsd-netcat openssh openssl @@ -44,6 +46,7 @@ Packages= shadow squashfs-tools stress + tgt tpm2-tools tpm2-tss vim diff --git a/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.conf index 37211b0cab..4efa2b440e 100644 --- a/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.conf @@ -24,6 +24,8 @@ Packages= bind-utils bpftool cryptsetup + device-mapper-event + device-mapper-multipath dfuzzer dhcp-server dnf @@ -35,7 +37,9 @@ Packages= iproute iproute-tc iputils + iscsi-initiator-utils kernel-core + kernel-modules # For squashfs and megasas2 libasan libcap-ng-utils libubsan diff --git a/mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf index 54f8f1c1bd..60ea1cb6a3 100644 --- a/mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf @@ -9,4 +9,3 @@ RepartDirectories=mkosi.repart [Content] Packages= rpmautospec-rpm-macros - kernel-modules # For squashfs diff --git a/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf index c80cd2b839..1e70a1b579 100644 --- a/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.conf @@ -54,7 +54,9 @@ Packages= libtss2-tcti-device0 locales man-db + multipath-tools netcat-openbsd + open-iscsi openssh-client openssh-server passwd @@ -66,6 +68,7 @@ Packages= sbsigntool squashfs-tools stress + tgt tpm2-tools tzdata xxd diff --git a/mkosi.images/system/mkosi.conf.d/10-debian/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-debian/mkosi.conf index c6b6155dda..6441096322 100644 --- a/mkosi.images/system/mkosi.conf.d/10-debian/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-debian/mkosi.conf @@ -2,3 +2,7 @@ [Match] Distribution=debian + +[Content] +Packages= + linux-image-generic diff --git a/mkosi.images/system/mkosi.conf.d/10-debian/mkosi.conf.d/amd64.conf b/mkosi.images/system/mkosi.conf.d/10-debian/mkosi.conf.d/amd64.conf deleted file mode 100644 index 615de52499..0000000000 --- a/mkosi.images/system/mkosi.conf.d/10-debian/mkosi.conf.d/amd64.conf +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -[Match] -Architecture=x86-64 - -[Content] -Packages= - linux-image-cloud-amd64 diff --git a/mkosi.images/system/mkosi.conf.d/10-debian/mkosi.conf.d/arm64.conf b/mkosi.images/system/mkosi.conf.d/10-debian/mkosi.conf.d/arm64.conf deleted file mode 100644 index af923fa442..0000000000 --- a/mkosi.images/system/mkosi.conf.d/10-debian/mkosi.conf.d/arm64.conf +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -[Match] -Architecture=arm64 - -[Content] -Packages= - linux-image-cloud-arm64 diff --git a/mkosi.images/system/mkosi.conf.d/10-fedora/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-fedora/mkosi.conf index 838c8314c4..75d2e400ce 100644 --- a/mkosi.images/system/mkosi.conf.d/10-fedora/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-fedora/mkosi.conf @@ -7,8 +7,9 @@ Distribution=fedora Packages= btrfs-progs compsize - f2fs-tools dnf5 + f2fs-tools + scsi-target-utils InitrdPackages= btrfs-progs diff --git a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf index 10cbd21a8f..33d3fe6950 100644 --- a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf +++ b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.conf @@ -50,6 +50,8 @@ Packages= libasan8 libkmod2 libubsan1 + multipath-tools + open-iscsi openssh-clients openssh-server pam @@ -65,6 +67,7 @@ Packages= sed shadow squashfs + tgt timezone tpm2.0-tools user(bin) diff --git a/mkosi.images/system/mkosi.extra/.autorelabel b/mkosi.images/system/mkosi.extra/.autorelabel new file mode 100644 index 0000000000..bd4fba4dfe --- /dev/null +++ b/mkosi.images/system/mkosi.extra/.autorelabel @@ -0,0 +1 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later diff --git a/mkosi.images/system/mkosi.extra/etc/iscsi/iscsid.conf b/mkosi.images/system/mkosi.extra/etc/iscsi/iscsid.conf new file mode 100644 index 0000000000..fcf4cd9cdc --- /dev/null +++ b/mkosi.images/system/mkosi.extra/etc/iscsi/iscsid.conf @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +iscsid.startup = /usr/bin/systemctl start iscsid.socket diff --git a/mkosi.images/system/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset b/mkosi.images/system/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset index fb82f3608f..aea1b5eea0 100644 --- a/mkosi.images/system/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset +++ b/mkosi.images/system/mkosi.extra/usr/lib/systemd/system-preset/00-mkosi.preset @@ -31,3 +31,6 @@ disable auditd.service # systemd-timesyncd is not enabled by default in the default systemd preset so enable it here instead. enable systemd-timesyncd.service + +# Skipped if selinux is not enabled, required for TEST-06-SELINUX. +enable autorelabel.service diff --git a/mkosi.images/system/mkosi.extra/usr/lib/systemd/system/isc-dhcp-server.service b/mkosi.images/system/mkosi.extra/usr/lib/systemd/system/isc-dhcp-server.service deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/TEST-01-BASIC/meson.build b/test/TEST-01-BASIC/meson.build new file mode 100644 index 0000000000..257dadd890 --- /dev/null +++ b/test/TEST-01-BASIC/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : 'TEST-01-BASIC', + }, +] diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index 93185cf896..d9619730b0 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -16,14 +16,4 @@ KERNEL_APPEND="foo -- -z bar --- baz $KERNEL_APPEND" # shellcheck source=test/test-functions . "${TEST_BASE_DIR:?}/test-functions" -test_append_files() { - 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" -} - do_test "$@" diff --git a/test/TEST-02-UNITTESTS/meson.build b/test/TEST-02-UNITTESTS/meson.build index 5c3c040858..b0003391b5 100644 --- a/test/TEST-02-UNITTESTS/meson.build +++ b/test/TEST-02-UNITTESTS/meson.build @@ -1,15 +1,16 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_params += { - 'mkosi_args': test_params['mkosi_args'] + [ - '--kernel-command-line-extra=' + ' '.join([ +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'cmdline' : integration_test_template['cmdline'] + [ ''' -frobnicate! systemd.setenv=TEST_CMDLINE_NEWLINE=foo + ''', + ''' systemd.setenv=TEST_CMDLINE_NEWLINE=bar - -''', - ]), - ], -} + ''', + ], + }, +] diff --git a/test/testsuite-03.units/always-activating.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.service similarity index 100% rename from test/testsuite-03.units/always-activating.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.service diff --git a/test/testsuite-03.units/always-activating.socket b/test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.socket similarity index 100% rename from test/testsuite-03.units/always-activating.socket rename to test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.socket diff --git a/test/testsuite-03.units/fails-on-restart-restartdirect.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.service similarity index 100% rename from test/testsuite-03.units/fails-on-restart-restartdirect.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.service diff --git a/test/testsuite-03.units/fails-on-restart-restartdirect.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.target similarity index 100% rename from test/testsuite-03.units/fails-on-restart-restartdirect.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.target diff --git a/test/testsuite-03.units/fails-on-restart.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.service similarity index 100% rename from test/testsuite-03.units/fails-on-restart.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.service diff --git a/test/testsuite-03.units/fails-on-restart.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.target similarity index 100% rename from test/testsuite-03.units/fails-on-restart.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.target diff --git a/test/testsuite-03.units/hello-after-sleep.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/hello-after-sleep.target similarity index 100% rename from test/testsuite-03.units/hello-after-sleep.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/hello-after-sleep.target diff --git a/test/testsuite-03.units/hello.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/hello.service similarity index 100% rename from test/testsuite-03.units/hello.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/hello.service diff --git a/test/testsuite-03.units/propagatestopto-and-pullin.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-and-pullin.target similarity index 100% rename from test/testsuite-03.units/propagatestopto-and-pullin.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-and-pullin.target diff --git a/test/testsuite-03.units/propagatestopto-indirect.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-indirect.target similarity index 100% rename from test/testsuite-03.units/propagatestopto-indirect.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-indirect.target diff --git a/test/testsuite-03.units/propagatestopto-only.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-only.target similarity index 100% rename from test/testsuite-03.units/propagatestopto-only.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-only.target diff --git a/test/testsuite-03.units/sleep-infinity-simple.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-simple.service similarity index 100% rename from test/testsuite-03.units/sleep-infinity-simple.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-simple.service diff --git a/test/testsuite-03.units/sleep.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/sleep.service similarity index 100% rename from test/testsuite-03.units/sleep.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/sleep.service diff --git a/test/testsuite-03.units/succeeds-on-restart-restartdirect.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service similarity index 66% rename from test/testsuite-03.units/succeeds-on-restart-restartdirect.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service index b05f2f8dcf..a2b9c339ad 100644 --- a/test/testsuite-03.units/succeeds-on-restart-restartdirect.service +++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Service] Type=oneshot -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-03.units/succeeds-on-restart.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-03-JOBS.units/succeeds-on-restart.sh Restart=on-failure RestartMode=direct diff --git a/test/testsuite-03.units/succeeds-on-restart-restartdirect.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.target similarity index 100% rename from test/testsuite-03.units/succeeds-on-restart-restartdirect.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.target diff --git a/test/testsuite-03.units/succeeds-on-restart.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service similarity index 66% rename from test/testsuite-03.units/succeeds-on-restart.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service index d7b3c7a210..d0e9c2bc84 100644 --- a/test/testsuite-03.units/succeeds-on-restart.service +++ b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Service] Type=oneshot -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-03.units/succeeds-on-restart.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-03-JOBS.units/succeeds-on-restart.sh Restart=on-failure RestartMode=normal diff --git a/test/testsuite-03.units/succeeds-on-restart.sh b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.sh similarity index 100% rename from test/testsuite-03.units/succeeds-on-restart.sh rename to test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.sh diff --git a/test/testsuite-03.units/succeeds-on-restart.target b/test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.target similarity index 100% rename from test/testsuite-03.units/succeeds-on-restart.target rename to test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.target diff --git a/test/testsuite-03.units/unstoppable.service b/test/TEST-03-JOBS/TEST-03-JOBS.units/unstoppable.service similarity index 100% rename from test/testsuite-03.units/unstoppable.service rename to test/TEST-03-JOBS/TEST-03-JOBS.units/unstoppable.service diff --git a/test/TEST-03-JOBS/meson.build b/test/TEST-03-JOBS/meson.build new file mode 100644 index 0000000000..3484d21ba2 --- /dev/null +++ b/test/TEST-03-JOBS/meson.build @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-03-JOBS.units'] diff --git a/test/testsuite-04.units/delegated-cgroup-filtering.service b/test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/delegated-cgroup-filtering.service similarity index 100% rename from test/testsuite-04.units/delegated-cgroup-filtering.service rename to test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/delegated-cgroup-filtering.service diff --git a/test/testsuite-04.units/forever-print-hola.service b/test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/forever-print-hola.service similarity index 100% rename from test/testsuite-04.units/forever-print-hola.service rename to test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/forever-print-hola.service diff --git a/test/testsuite-04.units/logs-filtering.service b/test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/logs-filtering.service similarity index 100% rename from test/testsuite-04.units/logs-filtering.service rename to test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/logs-filtering.service diff --git a/test/testsuite-04.units/silent-success.service b/test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/silent-success.service similarity index 100% rename from test/testsuite-04.units/silent-success.service rename to test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/silent-success.service diff --git a/test/testsuite-04.units/verbose-success.service b/test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/verbose-success.service similarity index 100% rename from test/testsuite-04.units/verbose-success.service rename to test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/verbose-success.service diff --git a/test/TEST-04-JOURNAL/meson.build b/test/TEST-04-JOURNAL/meson.build index 7f5cc704c9..5a0b073c02 100644 --- a/test/TEST-04-JOURNAL/meson.build +++ b/test/TEST-04-JOURNAL/meson.build @@ -1,5 +1,12 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_params += { - 'storage': 'persistent', -} +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'storage' : 'persistent', + }, +] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-04-JOURNAL.units'] diff --git a/test/TEST-04-JOURNAL/test.sh b/test/TEST-04-JOURNAL/test.sh index f8f3a4b3e3..a7aa71fce3 100755 --- a/test/TEST-04-JOURNAL/test.sh +++ b/test/TEST-04-JOURNAL/test.sh @@ -20,7 +20,7 @@ test_append_files() { # Since we nuke the journal repeatedly during this test, let's redirect # stdout/stderr to the console as well to make the test a bit more debug-able. if ! get_bool "${INTERACTIVE_DEBUG:-}"; then - dropin_dir="${workspace:?}/etc/systemd/system/testsuite-04.service.d/" + dropin_dir="${workspace:?}/etc/systemd/system/TEST-04-JOURNAL.service.d/" mkdir -p "$dropin_dir" printf '[Service]\nStandardOutput=journal+console\nStandardError=journal+console' >"$dropin_dir/99-stdout.conf" fi diff --git a/test/TEST-05-RLIMITS/meson.build b/test/TEST-05-RLIMITS/meson.build new file mode 100644 index 0000000000..d8198fdef8 --- /dev/null +++ b/test/TEST-05-RLIMITS/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : 'TEST-05-RLIMITS', + }, +] diff --git a/test/testsuite-06.units/hola.service b/test/TEST-06-SELINUX/TEST-06-SELINUX.units/hola.service similarity index 100% rename from test/testsuite-06.units/hola.service rename to test/TEST-06-SELINUX/TEST-06-SELINUX.units/hola.service diff --git a/test/TEST-06-SELINUX/meson.build b/test/TEST-06-SELINUX/meson.build index a62d144048..dd1dfb0baf 100644 --- a/test/TEST-06-SELINUX/meson.build +++ b/test/TEST-06-SELINUX/meson.build @@ -1,7 +1,12 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_params += { - 'mkosi_args' : ['--kernel-command-line-extra=apparmor=0 selinux=1 enforcing=0 lsm=selinux systemd.wants=autorelabel.service systemd.wants=firstboot-autorelabel.service'], - # FIXME; Figure out why reboot sometimes hangs with 'linux' firmware. - 'firmware' : 'uefi', -} +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'cmdline' : integration_test_template['cmdline'] + ['selinux=1', 'lsm=selinux'], + # FIXME; Figure out why reboot sometimes hangs with 'linux' firmware. + 'firmware' : 'uefi', + }, +] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-06-SELINUX.units'] diff --git a/test/units/testsuite-07.service b/test/TEST-07-PID1/TEST-07-PID1.service similarity index 80% rename from test/units/testsuite-07.service rename to test/TEST-07-PID1/TEST-07-PID1.service index 92302bfabb..53dd54cc45 100644 --- a/test/units/testsuite-07.service +++ b/test/TEST-07-PID1/TEST-07-PID1.service @@ -1,6 +1,9 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=TEST-07-PID1 +Wants=basic.target multi-user.target +After=basic.target +Before=getty-pre.target [Service] Type=oneshot diff --git a/test/testsuite-07.units/issue14566-repro.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service similarity index 67% rename from test/testsuite-07.units/issue14566-repro.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service index 56805963b4..757f978101 100644 --- a/test/testsuite-07.units/issue14566-repro.service +++ b/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service @@ -3,6 +3,6 @@ Description=Issue 14566 Repro [Service] -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-07.units/%N.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-07-PID1.units/%N.sh ExecStopPost=/bin/true KillMode=mixed diff --git a/test/testsuite-07.units/issue14566-repro.sh b/test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.sh similarity index 100% rename from test/testsuite-07.units/issue14566-repro.sh rename to test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.sh diff --git a/test/testsuite-07.units/issue16115-repro-1.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-1.service similarity index 100% rename from test/testsuite-07.units/issue16115-repro-1.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-1.service diff --git a/test/testsuite-07.units/issue16115-repro-2.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-2.service similarity index 100% rename from test/testsuite-07.units/issue16115-repro-2.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-2.service diff --git a/test/testsuite-07.units/issue16115-repro-3.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-3.service similarity index 100% rename from test/testsuite-07.units/issue16115-repro-3.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-3.service diff --git a/test/testsuite-07.units/issue2467.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue2467.service similarity index 100% rename from test/testsuite-07.units/issue2467.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue2467.service diff --git a/test/testsuite-07.units/issue2467.socket b/test/TEST-07-PID1/TEST-07-PID1.units/issue2467.socket similarity index 100% rename from test/testsuite-07.units/issue2467.socket rename to test/TEST-07-PID1/TEST-07-PID1.units/issue2467.socket diff --git a/test/testsuite-07.units/issue2730-alias.mount b/test/TEST-07-PID1/TEST-07-PID1.units/issue2730-alias.mount similarity index 100% rename from test/testsuite-07.units/issue2730-alias.mount rename to test/TEST-07-PID1/TEST-07-PID1.units/issue2730-alias.mount diff --git a/test/testsuite-07.units/issue2730.mount b/test/TEST-07-PID1/TEST-07-PID1.units/issue2730.mount similarity index 100% rename from test/testsuite-07.units/issue2730.mount rename to test/TEST-07-PID1/TEST-07-PID1.units/issue2730.mount diff --git a/test/testsuite-07.units/issue27953.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue27953.service similarity index 100% rename from test/testsuite-07.units/issue27953.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue27953.service diff --git a/test/testsuite-07.units/issue3166-fail-on-restart.service b/test/TEST-07-PID1/TEST-07-PID1.units/issue3166-fail-on-restart.service similarity index 100% rename from test/testsuite-07.units/issue3166-fail-on-restart.service rename to test/TEST-07-PID1/TEST-07-PID1.units/issue3166-fail-on-restart.service diff --git a/test/testsuite-07.units/local-fs.target.wants/issue2730.mount b/test/TEST-07-PID1/TEST-07-PID1.units/local-fs.target.wants/issue2730.mount similarity index 100% rename from test/testsuite-07.units/local-fs.target.wants/issue2730.mount rename to test/TEST-07-PID1/TEST-07-PID1.units/local-fs.target.wants/issue2730.mount diff --git a/test/testsuite-07.units/pass-fds-to-exec-no.socket b/test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-no.socket similarity index 100% rename from test/testsuite-07.units/pass-fds-to-exec-no.socket rename to test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-no.socket diff --git a/test/testsuite-07.units/pass-fds-to-exec-yes.socket b/test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-yes.socket similarity index 100% rename from test/testsuite-07.units/pass-fds-to-exec-yes.socket rename to test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-yes.socket diff --git a/test/TEST-07-PID1/meson.build b/test/TEST-07-PID1/meson.build new file mode 100644 index 0000000000..311860dc89 --- /dev/null +++ b/test/TEST-07-PID1/meson.build @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'unit' : files('TEST-07-PID1.service'), + }, +] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-07-PID1.units'] diff --git a/test/TEST-08-INITRD/meson.build b/test/TEST-08-INITRD/meson.build new file mode 100644 index 0000000000..d53dbe562c --- /dev/null +++ b/test/TEST-08-INITRD/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'enabled' : false, + }, +] diff --git a/test/TEST-08-INITRD/test.sh b/test/TEST-08-INITRD/test.sh index 3ad60f1a94..badb6cb31a 100755 --- a/test/TEST-08-INITRD/test.sh +++ b/test/TEST-08-INITRD/test.sh @@ -80,7 +80,7 @@ check_result_qemu_hook() { # 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-08.sh script. +# is in the respective TEST-08-INITRD.sh script. # # See: https://github.com/systemd/systemd/issues/28452 run_qemu_hook() { diff --git a/test/TEST-09-REBOOT/meson.build b/test/TEST-09-REBOOT/meson.build index a511a829af..c4b41bc97b 100644 --- a/test/TEST-09-REBOOT/meson.build +++ b/test/TEST-09-REBOOT/meson.build @@ -1,7 +1,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_params += { - 'storage': 'persistent', - # FIXME; Figure out why reboot sometimes hangs with 'linux' firmware. - 'firmware' : 'uefi', -} +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'storage' : 'persistent', + # FIXME; Figure out why reboot sometimes hangs with 'linux' firmware. + 'firmware' : 'uefi', + }, +] diff --git a/test/TEST-13-NSPAWN/meson.build b/test/TEST-13-NSPAWN/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-13-NSPAWN/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-13-NSPAWN/test.sh b/test/TEST-13-NSPAWN/test.sh index 744e793ac2..9a0404f4b0 100755 --- a/test/TEST-13-NSPAWN/test.sh +++ b/test/TEST-13-NSPAWN/test.sh @@ -13,7 +13,7 @@ TEST_FORCE_NEWIMAGE=1 test_append_files() { local workspace="${1:?}" - local container="$workspace/usr/share/testsuite-13-container-template" + local container="$workspace/usr/share/TEST-13-NSPAWN-container-template" # For virtual wlan interface. instmods mac80211_hwsim diff --git a/test/TEST-15-DROPIN/meson.build b/test/TEST-15-DROPIN/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-15-DROPIN/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/units/testsuite-16.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.service similarity index 86% rename from test/units/testsuite-16.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.service index d5494ae931..9e4675808d 100644 --- a/test/units/testsuite-16.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.service @@ -3,6 +3,10 @@ Description=TEST-16-EXTEND-TIMEOUT # Testsuite: Assess all other testsuite-*.services worked as expected +Wants=basic.target multi-user.target +After=basic.target +Before=getty-pre.target + Wants=success-all.service Wants=success-start.service Wants=success-runtime.service diff --git a/test/testsuite-16.units/extend-timeout.sh b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh similarity index 100% rename from test/testsuite-16.units/extend-timeout.sh rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/fail-runtime.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-runtime.service similarity index 86% rename from test/testsuite-16.units/fail-runtime.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-runtime.service index 1d74963a30..7380994dbd 100644 --- a/test/testsuite-16.units/fail-runtime.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-runtime.service @@ -10,4 +10,4 @@ TimeoutStartSec=4 TimeoutStopSec=4 RuntimeMaxSec=10 Environment=SERVICE=fail_runtime extend_timeout_interval=5 sleep_interval=7 start_intervals=0 run_intervals=2 stop_intervals=0 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/fail-start.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-start.service similarity index 86% rename from test/testsuite-16.units/fail-start.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-start.service index 38aebf2a8f..984d8f9864 100644 --- a/test/testsuite-16.units/fail-start.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-start.service @@ -11,4 +11,4 @@ TimeoutStartSec=10 TimeoutStopSec=4 RuntimeMaxSec=4 Environment=SERVICE=fail_start extend_timeout_interval=5 sleep_interval=7 start_intervals=2 run_intervals=0 stop_intervals=0 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/fail-stop.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-stop.service similarity index 90% rename from test/testsuite-16.units/fail-stop.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-stop.service index 1910ac9ff4..4293d7e8bd 100644 --- a/test/testsuite-16.units/fail-stop.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-stop.service @@ -10,7 +10,7 @@ TimeoutStartSec=4 TimeoutStopSec=10 RuntimeMaxSec=4 Environment=SERVICE=fail_stop extend_timeout_interval=5 sleep_interval=7 start_intervals=0 run_intervals=0 stop_intervals=2 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh # Due to 6041a7ee2c1bbff6301082f192fc1b0882400d42 SIGTERM isn't sent as the service shuts down with STOPPING=1 # This file makes the test assess.sh quicker by notifing it that this test has finished. ExecStopPost=/bin/bash -c '[[ $SERVICE_RESULT == timeout && $EXIT_CODE == killed ]] && touch /fail_runtime.terminated' diff --git a/test/testsuite-16.units/success-all.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-all.service similarity index 87% rename from test/testsuite-16.units/success-all.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-all.service index 1fdc363f69..7f26084c7a 100644 --- a/test/testsuite-16.units/success-all.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-all.service @@ -12,4 +12,4 @@ TimeoutStartSec=4 TimeoutStopSec=4 RuntimeMaxSec=4 Environment=SERVICE=success_all extend_timeout_interval=4 sleep_interval=2 start_intervals=3 run_intervals=3 stop_intervals=3 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/success-runtime.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-runtime.service similarity index 84% rename from test/testsuite-16.units/success-runtime.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-runtime.service index 2f5744d15e..33a36f3ba2 100644 --- a/test/testsuite-16.units/success-runtime.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-runtime.service @@ -11,4 +11,4 @@ TimeoutStartSec=4 TimeoutStopSec=4 RuntimeMaxSec=8 Environment=SERVICE=success_runtime extend_timeout_interval=4 sleep_interval=6 start_intervals=0 run_intervals=1 stop_intervals=0 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/success-start.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-start.service similarity index 85% rename from test/testsuite-16.units/success-start.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-start.service index be518e9870..0453b34ff3 100644 --- a/test/testsuite-16.units/success-start.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-start.service @@ -10,4 +10,4 @@ TimeoutStartSec=8 TimeoutStopSec=4 RuntimeMaxSec=4 Environment=SERVICE=success_start extend_timeout_interval=4 sleep_interval=6 start_intervals=1 run_intervals=0 stop_intervals=0 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/testsuite-16.units/success-stop.service b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-stop.service similarity index 85% rename from test/testsuite-16.units/success-stop.service rename to test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-stop.service index 2bd3e3e3ba..3719f54fd7 100644 --- a/test/testsuite-16.units/success-stop.service +++ b/test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-stop.service @@ -10,4 +10,4 @@ TimeoutStartSec=4 TimeoutStopSec=8 RuntimeMaxSec=4 Environment=SERVICE=success_stop extend_timeout_interval=4 sleep_interval=6 start_intervals=0 run_intervals=0 stop_intervals=1 -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-16.units/extend-timeout.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh diff --git a/test/TEST-16-EXTEND-TIMEOUT/meson.build b/test/TEST-16-EXTEND-TIMEOUT/meson.build new file mode 100644 index 0000000000..15986acfb4 --- /dev/null +++ b/test/TEST-16-EXTEND-TIMEOUT/meson.build @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'unit' : files('TEST-16-EXTEND-TIMEOUT.service'), + }, +] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-16-EXTEND-TIMEOUT.units'] diff --git a/test/TEST-17-UDEV/meson.build b/test/TEST-17-UDEV/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-17-UDEV/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-18-FAILUREACTION/meson.build b/test/TEST-18-FAILUREACTION/meson.build index e1bca2d7a8..5edfbcad1f 100644 --- a/test/TEST-18-FAILUREACTION/meson.build +++ b/test/TEST-18-FAILUREACTION/meson.build @@ -1,6 +1,9 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_params += { - # FIXME; Figure out why reboot sometimes hangs with 'linux' firmware. - 'firmware' : 'uefi', -} +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + # FIXME; Figure out why reboot sometimes hangs with 'linux' firmware. + 'firmware' : 'uefi', + }, +] diff --git a/test/TEST-19-CGROUP/meson.build b/test/TEST-19-CGROUP/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-19-CGROUP/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-21-DFUZZER/meson.build b/test/TEST-21-DFUZZER/meson.build index 5a27fb2f3f..aa6652910c 100644 --- a/test/TEST-21-DFUZZER/meson.build +++ b/test/TEST-21-DFUZZER/meson.build @@ -1,7 +1,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_params += { - 'timeout' : 3600, - 'priority' : -50, - 'slow' : true, -} +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'timeout' : 3600, + 'priority' : -50, + 'slow' : true, + }, +] diff --git a/test/TEST-22-TMPFILES/meson.build b/test/TEST-22-TMPFILES/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-22-TMPFILES/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/testsuite-23.units/testsuite-23-binds-to.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-binds-to.service similarity index 52% rename from test/testsuite-23.units/testsuite-23-binds-to.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-binds-to.service index 9a3e31b080..022c37e547 100644 --- a/test/testsuite-23.units/testsuite-23-binds-to.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-binds-to.service @@ -1,10 +1,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Unit with BindsTo= -BindsTo=testsuite-23-bound-by.service -After=testsuite-23-bound-by.service +BindsTo=TEST-23-UNIT-FILE-bound-by.service +After=TEST-23-UNIT-FILE-bound-by.service [Service] ExecStart=sleep infinity # --kill-who= (no 'm') to check that the short form is accepted -ExecStopPost=systemctl kill --kill-whom=main -sRTMIN+1 testsuite-23.service +ExecStopPost=systemctl kill --kill-whom=main -sRTMIN+1 TEST-23-UNIT-FILE.service diff --git a/test/testsuite-23.units/testsuite-23-bound-by.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-bound-by.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-bound-by.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-bound-by.service diff --git a/test/testsuite-23.units/testsuite-23-fail.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-fail.service similarity index 70% rename from test/testsuite-23.units/testsuite-23-fail.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-fail.service index 597810797d..b78e6b438e 100644 --- a/test/testsuite-23.units/testsuite-23-fail.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-fail.service @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Failing unit -OnFailure=testsuite-23-uphold.service +OnFailure=TEST-23-UNIT-FILE-uphold.service [Service] ExecStart=false diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-1.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-1.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-1.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-1.service diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-2.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-2.service similarity index 73% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-2.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-2.service index 36b4c272fd..42dd44555a 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-2.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-2.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-1.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-1.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-3.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-3.service similarity index 73% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-3.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-3.service index 9094445020..f745481f78 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-3.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-3.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-1.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-1.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-4.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-4.service similarity index 77% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-4.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-4.service index a70f8fca99..a0ff403986 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-4.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-4.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-5.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-5.service [Service] Type=notify diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-5.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-5.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-5.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-5.service diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-6.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-6.service similarity index 77% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-6.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-6.service index dae533cc36..9227bdaa05 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-6.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-6.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-8.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-8.service [Service] Type=notify diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-7.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-7.service similarity index 77% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-7.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-7.service index 60c083a3f4..a5d62c651d 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-7.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-7.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-8.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-8.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-8.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-8.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-8.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-8.service diff --git a/test/testsuite-23.units/testsuite-23-joins-namespace-of-9.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-9.service similarity index 77% rename from test/testsuite-23.units/testsuite-23-joins-namespace-of-9.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-9.service index 6c64873b24..a30f92af80 100644 --- a/test/testsuite-23.units/testsuite-23-joins-namespace-of-9.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-9.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] -JoinsNamespaceOf=testsuite-23-joins-namespace-of-8.service +JoinsNamespaceOf=TEST-23-UNIT-FILE-joins-namespace-of-8.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-namespaced.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service similarity index 88% rename from test/testsuite-23.units/testsuite-23-namespaced.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service index 46c27ca5d8..82eb74c0bd 100644 --- a/test/testsuite-23.units/testsuite-23-namespaced.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service @@ -7,7 +7,7 @@ Type=notify RemainAfterExit=yes MountAPIVFS=yes PrivateTmp=yes -BindPaths=/run/testsuite-23-marker-fixed:/tmp/testfile-marker-fixed +BindPaths=/run/TEST-23-UNIT-FILE-marker-fixed:/tmp/testfile-marker-fixed InaccessiblePaths=/run/inaccessible ExecStartPre=grep -q -F MARKER_FIXED /tmp/testfile-marker-fixed ExecStart=sh -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; test ! -f /run/inaccessible/testfile-marker-fixed' diff --git a/test/testsuite-23.units/testsuite-23-non-namespaced.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-non-namespaced.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-non-namespaced.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-non-namespaced.service diff --git a/test/testsuite-23.units/testsuite-23-oneshot-restartforce.sh b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-oneshot-restartforce.sh similarity index 100% rename from test/testsuite-23.units/testsuite-23-oneshot-restartforce.sh rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-oneshot-restartforce.sh diff --git a/test/testsuite-23.units/testsuite-23-openfile-server.socket b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server.socket similarity index 100% rename from test/testsuite-23.units/testsuite-23-openfile-server.socket rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server.socket diff --git a/test/testsuite-23.units/testsuite-23-openfile-server@.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server@.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-openfile-server@.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server@.service diff --git a/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-one.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-one.service new file mode 100644 index 0000000000..0739aaf31d --- /dev/null +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-one.service @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=Stop Propagation Receiver +Wants=TEST-23-UNIT-FILE-prop-stop-two.service +After=TEST-23-UNIT-FILE-prop-stop-two.service +StopPropagatedFrom=TEST-23-UNIT-FILE-prop-stop-two.service + +[Service] +ExecStart=sleep infinity +ExecStopPost=systemctl kill --kill-whom=main -sUSR2 TEST-23-UNIT-FILE.service diff --git a/test/testsuite-23.units/testsuite-23-prop-stop-two.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-two.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-prop-stop-two.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-two.service diff --git a/test/testsuite-23.units/testsuite-23-retry-fail.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service similarity index 60% rename from test/testsuite-23.units/testsuite-23-retry-fail.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service index 2e0972cbf0..319757a44d 100644 --- a/test/testsuite-23.units/testsuite-23-retry-fail.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service @@ -5,5 +5,5 @@ Description=Failed Dependency Unit [Service] Type=oneshot RemainAfterExit=yes -ExecStart=sh -c "if [ -f /tmp/testsuite-23-retry-fail ]; then exit 0; else exit 1; fi" +ExecStart=sh -c "if [ -f /tmp/TEST-23-UNIT-FILE-retry-fail ]; then exit 0; else exit 1; fi" Restart=no diff --git a/test/testsuite-23.units/testsuite-23-retry-upheld.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-upheld.service similarity index 60% rename from test/testsuite-23.units/testsuite-23-retry-upheld.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-upheld.service index 3c20e4338c..722a3b479b 100644 --- a/test/testsuite-23.units/testsuite-23-retry-upheld.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-upheld.service @@ -1,8 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Upheld Unit -Requires=testsuite-23-retry-fail.service -After=testsuite-23-retry-fail.service +Requires=TEST-23-UNIT-FILE-retry-fail.service +After=TEST-23-UNIT-FILE-retry-fail.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-retry-uphold.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-uphold.service similarity index 70% rename from test/testsuite-23.units/testsuite-23-retry-uphold.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-uphold.service index 7f15f068b4..829ea5c39e 100644 --- a/test/testsuite-23.units/testsuite-23-retry-uphold.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-uphold.service @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Upholding Unit -Upholds=testsuite-23-retry-upheld.service +Upholds=TEST-23-UNIT-FILE-retry-upheld.service [Service] ExecStart=sleep infinity diff --git a/test/testsuite-23.units/testsuite-23-short-lived.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-short-lived.service similarity index 74% rename from test/testsuite-23.units/testsuite-23-short-lived.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-short-lived.service index 2dcb2ae228..ac9583f916 100644 --- a/test/testsuite-23.units/testsuite-23-short-lived.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-short-lived.service @@ -8,4 +8,4 @@ StartLimitBurst=15 StartLimitIntervalSec=1h [Service] -ExecStart=/usr/lib/systemd/tests/testdata/units/testsuite-23-short-lived.sh +ExecStart=/usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE-short-lived.sh diff --git a/test/testsuite-23.units/testsuite-23-specifier-j-depends-wants.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-depends-wants.service similarity index 100% rename from test/testsuite-23.units/testsuite-23-specifier-j-depends-wants.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-depends-wants.service diff --git a/test/testsuite-23.units/testsuite-23-specifier-j-wants.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-wants.service similarity index 65% rename from test/testsuite-23.units/testsuite-23-specifier-j-wants.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-wants.service index 9abb257df4..5aeee9f8d6 100644 --- a/test/testsuite-23.units/testsuite-23-specifier-j-wants.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-wants.service @@ -1,8 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Wants with percent-j specifier -Wants=testsuite-23-specifier-j-depends-%j.service -After=testsuite-23-specifier-j-depends-%j.service +Wants=TEST-23-UNIT-FILE-specifier-j-depends-%j.service +After=TEST-23-UNIT-FILE-specifier-j-depends-%j.service [Service] Type=oneshot diff --git a/test/testsuite-23.units/testsuite-23-success.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-success.service similarity index 72% rename from test/testsuite-23.units/testsuite-23-success.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-success.service index 2ace6fa370..1ae6271fcc 100644 --- a/test/testsuite-23.units/testsuite-23-success.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-success.service @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Succeeding unit -OnSuccess=testsuite-23-fail.service +OnSuccess=TEST-23-UNIT-FILE-fail.service [Service] ExecStart=true diff --git a/test/testsuite-23.units/testsuite-23-upheldby-install.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-upheldby-install.service similarity index 76% rename from test/testsuite-23.units/testsuite-23-upheldby-install.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-upheldby-install.service index bcfacd21dd..edb8fcb2e9 100644 --- a/test/testsuite-23.units/testsuite-23-upheldby-install.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-upheldby-install.service @@ -6,4 +6,4 @@ Description=Unit that sets UpheldBy= through [Install] ExecStart=sleep infinity [Install] -UpheldBy=testsuite-23-retry-uphold.service +UpheldBy=TEST-23-UNIT-FILE-retry-uphold.service diff --git a/test/testsuite-23.units/testsuite-23-uphold.service b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-uphold.service similarity index 71% rename from test/testsuite-23.units/testsuite-23-uphold.service rename to test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-uphold.service index 67f0ac8859..36c5dae7d3 100644 --- a/test/testsuite-23.units/testsuite-23-uphold.service +++ b/test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-uphold.service @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=Upholding Unit -Upholds=testsuite-23-short-lived.service +Upholds=TEST-23-UNIT-FILE-short-lived.service [Service] ExecStart=sleep infinity diff --git a/test/TEST-23-UNIT-FILE/meson.build b/test/TEST-23-UNIT-FILE/meson.build new file mode 100644 index 0000000000..3f44662ae3 --- /dev/null +++ b/test/TEST-23-UNIT-FILE/meson.build @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-23-UNIT-FILE.units'] diff --git a/test/TEST-24-CRYPTSETUP/meson.build b/test/TEST-24-CRYPTSETUP/meson.build new file mode 100644 index 0000000000..d53dbe562c --- /dev/null +++ b/test/TEST-24-CRYPTSETUP/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'enabled' : false, + }, +] diff --git a/test/TEST-25-IMPORT/meson.build b/test/TEST-25-IMPORT/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-25-IMPORT/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-26-SYSTEMCTL/meson.build b/test/TEST-26-SYSTEMCTL/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-26-SYSTEMCTL/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-29-PORTABLE/meson.build b/test/TEST-29-PORTABLE/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-29-PORTABLE/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/testsuite-30.units/systemd-timedated.service.d/watchdog.conf b/test/TEST-30-ONCLOCKCHANGE/TEST-30-ONCLOCKCHANGE.units/systemd-timedated.service.d/watchdog.conf similarity index 100% rename from test/testsuite-30.units/systemd-timedated.service.d/watchdog.conf rename to test/TEST-30-ONCLOCKCHANGE/TEST-30-ONCLOCKCHANGE.units/systemd-timedated.service.d/watchdog.conf diff --git a/test/TEST-30-ONCLOCKCHANGE/meson.build b/test/TEST-30-ONCLOCKCHANGE/meson.build new file mode 100644 index 0000000000..174ec42867 --- /dev/null +++ b/test/TEST-30-ONCLOCKCHANGE/meson.build @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-30-ONCLOCKCHANGE.units'] diff --git a/test/TEST-31-DEVICE-ENUMERATION/meson.build b/test/TEST-31-DEVICE-ENUMERATION/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-31-DEVICE-ENUMERATION/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-32-OOMPOLICY/meson.build b/test/TEST-32-OOMPOLICY/meson.build new file mode 100644 index 0000000000..2b832a8f6d --- /dev/null +++ b/test/TEST-32-OOMPOLICY/meson.build @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'configuration' : integration_test_template['configuration'] + { + 'memory-accounting' : 'yes', + }, + }, +] diff --git a/test/TEST-34-DYNAMICUSERMIGRATE/meson.build b/test/TEST-34-DYNAMICUSERMIGRATE/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-34-DYNAMICUSERMIGRATE/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-35-LOGIN/meson.build b/test/TEST-35-LOGIN/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-35-LOGIN/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-36-NUMAPOLICY/meson.build b/test/TEST-36-NUMAPOLICY/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-36-NUMAPOLICY/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-38-FREEZER/meson.build b/test/TEST-38-FREEZER/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-38-FREEZER/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-43-PRIVATEUSER-UNPRIV/meson.build b/test/TEST-43-PRIVATEUSER-UNPRIV/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-43-PRIVATEUSER-UNPRIV/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-44-LOG-NAMESPACE/TEST-44-LOG-NAMESPACE.service b/test/TEST-44-LOG-NAMESPACE/TEST-44-LOG-NAMESPACE.service new file mode 100644 index 0000000000..1b1dd98418 --- /dev/null +++ b/test/TEST-44-LOG-NAMESPACE/TEST-44-LOG-NAMESPACE.service @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=TEST-44-LOG-NAMESPACE +Wants=basic.target multi-user.target systemd-journald@foobar.socket systemd-journald-varlink@foobar.socket +After=basic.target systemd-journald@foobar.socket systemd-journald-varlink@foobar.socket +Before=getty-pre.target + +[Service] +ExecStartPre=rm -f /failed /testok +ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh +Type=oneshot diff --git a/test/TEST-44-LOG-NAMESPACE/meson.build b/test/TEST-44-LOG-NAMESPACE/meson.build new file mode 100644 index 0000000000..555ba7befd --- /dev/null +++ b/test/TEST-44-LOG-NAMESPACE/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'unit' : files('TEST-44-LOG-NAMESPACE.service'), + }, +] diff --git a/test/TEST-45-TIMEDATE/meson.build b/test/TEST-45-TIMEDATE/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-45-TIMEDATE/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-46-HOMED/meson.build b/test/TEST-46-HOMED/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-46-HOMED/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-50-DISSECT/meson.build b/test/TEST-50-DISSECT/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-50-DISSECT/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/testsuite-52.units/test-honor-first-shutdown.service b/test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service similarity index 73% rename from test/testsuite-52.units/test-honor-first-shutdown.service rename to test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service index abcf578402..bbeac3a74e 100644 --- a/test/testsuite-52.units/test-honor-first-shutdown.service +++ b/test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service @@ -4,7 +4,7 @@ Description=Honor First Shutdown feature After=multi-user.target [Service] -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-52.units/%N.sh +ExecStart=/usr/lib/systemd/tests/testdata/TEST-52-HONORFIRSTSHUTDOWN.units/%N.sh ExecStop=sh -c 'kill -KILL $MAINPID' FailureAction=reboot diff --git a/test/testsuite-52.units/test-honor-first-shutdown.sh b/test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.sh similarity index 100% rename from test/testsuite-52.units/test-honor-first-shutdown.sh rename to test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.sh diff --git a/test/TEST-52-HONORFIRSTSHUTDOWN/meson.build b/test/TEST-52-HONORFIRSTSHUTDOWN/meson.build new file mode 100644 index 0000000000..08503e8822 --- /dev/null +++ b/test/TEST-52-HONORFIRSTSHUTDOWN/meson.build @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-52-HONORFIRSTSHUTDOWN.units'] diff --git a/test/TEST-53-ISSUE-16347/meson.build b/test/TEST-53-ISSUE-16347/meson.build index 0b7644f4ad..8d6df66cb0 100644 --- a/test/TEST-53-ISSUE-16347/meson.build +++ b/test/TEST-53-ISSUE-16347/meson.build @@ -1,7 +1,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_params += { - 'mkosi_args' : test_params['mkosi_args'] + [ - '--configure-script', meson.current_source_dir() / 'mkosi.configure', - ], -} +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'mkosi-args' : integration_test_template['mkosi-args'] + [ + '--configure-script', meson.current_source_dir() / 'mkosi.configure', + ], + }, +] diff --git a/test/TEST-54-CREDS/meson.build b/test/TEST-54-CREDS/meson.build new file mode 100644 index 0000000000..d53dbe562c --- /dev/null +++ b/test/TEST-54-CREDS/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'enabled' : false, + }, +] diff --git a/test/TEST-55-OOMD/meson.build b/test/TEST-55-OOMD/meson.build index 86a0d8f957..9aef9165cf 100644 --- a/test/TEST-55-OOMD/meson.build +++ b/test/TEST-55-OOMD/meson.build @@ -1,7 +1,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_params += { - 'mkosi_args' : test_params['mkosi_args'] + [ - '--credential=@0@'.format(meson.current_source_dir() / 'systemd.unit-dropin.init.scope') - ] -} +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'mkosi-args' : integration_test_template['mkosi-args'] + [ + '--credential=@0@'.format(meson.current_source_dir() / 'systemd.unit-dropin.init.scope') + ] + }, +] diff --git a/test/TEST-58-REPART/meson.build b/test/TEST-58-REPART/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-58-REPART/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-59-RELOADING-RESTART/meson.build b/test/TEST-59-RELOADING-RESTART/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-59-RELOADING-RESTART/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-60-MOUNT-RATELIMIT/meson.build b/test/TEST-60-MOUNT-RATELIMIT/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-60-MOUNT-RATELIMIT/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-62-RESTRICT-IFACES/meson.build b/test/TEST-62-RESTRICT-IFACES/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-62-RESTRICT-IFACES/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/testsuite-63.units/test63-glob.path b/test/TEST-63-PATH/TEST-63-PATH.units/test63-glob.path similarity index 100% rename from test/testsuite-63.units/test63-glob.path rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-glob.path diff --git a/test/testsuite-63.units/test63-glob.service b/test/TEST-63-PATH/TEST-63-PATH.units/test63-glob.service similarity index 100% rename from test/testsuite-63.units/test63-glob.service rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-glob.service diff --git a/test/testsuite-63.units/test63-issue-24577-dep.service b/test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577-dep.service similarity index 100% rename from test/testsuite-63.units/test63-issue-24577-dep.service rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577-dep.service diff --git a/test/testsuite-63.units/test63-issue-24577.path b/test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.path similarity index 100% rename from test/testsuite-63.units/test63-issue-24577.path rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.path diff --git a/test/testsuite-63.units/test63-issue-24577.service b/test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.service similarity index 100% rename from test/testsuite-63.units/test63-issue-24577.service rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.service diff --git a/test/testsuite-63.units/test63-pr-30768.path b/test/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.path similarity index 100% rename from test/testsuite-63.units/test63-pr-30768.path rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.path diff --git a/test/testsuite-63.units/test63-pr-30768.service b/test/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.service similarity index 100% rename from test/testsuite-63.units/test63-pr-30768.service rename to test/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.service diff --git a/test/testsuite-63.units/test63.path b/test/TEST-63-PATH/TEST-63-PATH.units/test63.path similarity index 100% rename from test/testsuite-63.units/test63.path rename to test/TEST-63-PATH/TEST-63-PATH.units/test63.path diff --git a/test/testsuite-63.units/test63.service b/test/TEST-63-PATH/TEST-63-PATH.units/test63.service similarity index 100% rename from test/testsuite-63.units/test63.service rename to test/TEST-63-PATH/TEST-63-PATH.units/test63.service diff --git a/test/TEST-63-PATH/meson.build b/test/TEST-63-PATH/meson.build new file mode 100644 index 0000000000..4aa3afdf7a --- /dev/null +++ b/test/TEST-63-PATH/meson.build @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-63-PATH.units'] diff --git a/test/TEST-64-UDEV-STORAGE/btrfs_basic.configure b/test/TEST-64-UDEV-STORAGE/btrfs_basic.configure new file mode 100755 index 0000000000..8ef58a9fdd --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/btrfs_basic.configure @@ -0,0 +1,26 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import sys + + +config = json.load(sys.stdin) + +config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0"] + +for i in range(4): + id = f"drivebtrfsbasic{i}" + config["QemuDrives"] += [ + { + "Id": id, + "Size": "350M" if i == 0 else "128M", + "Options": "cache=unsafe", + } + ] + config["QemuArgs"] += [ + "-device", + f"scsi-hd,drive={id},vendor=systemd,product=foobar,serial=deadbeefbtrfs{i}", + ] + +json.dump(config, sys.stdout) diff --git a/test/TEST-64-UDEV-STORAGE/iscsi_lvm.configure b/test/TEST-64-UDEV-STORAGE/iscsi_lvm.configure new file mode 100755 index 0000000000..ca23e33858 --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/iscsi_lvm.configure @@ -0,0 +1,26 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import sys + + +config = json.load(sys.stdin) + +config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0"] + +for i in range(4): + id = f"driveiscsibasic{i}" + config["QemuDrives"] += [ + { + "Id": id, + "Size": "150M" if i == 0 else "70M", + "Options": "cache=unsafe", + } + ] + config["QemuArgs"] += [ + "-device", + f"scsi-hd,drive={id},vendor=systemd,product=foobar,serial=deadbeefiscsi{i}", + ] + +json.dump(config, sys.stdout) diff --git a/test/TEST-64-UDEV-STORAGE/long_sysfs_path.configure b/test/TEST-64-UDEV-STORAGE/long_sysfs_path.configure new file mode 100755 index 0000000000..6108bdb981 --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/long_sysfs_path.configure @@ -0,0 +1,32 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import sys + + +config = json.load(sys.stdin) + +config["QemuDrives"] += [ + { + "Id": "drive0", + "Size": "64M", + "Options": "cache=unsafe", + } +] +config["QemuArgs"] += ["-device", "pci-bridge,id=pci_bridge0,chassis_nr=64"] + +# Create 25 additional PCI bridges, each one connected to the previous one +# (basically a really long extension cable), and attach a virtio drive to +# the last one. This should force udev into attempting to create a device +# unit with a _really_ long name. +for bridge in range(1, 26): + config["QemuArgs"] += [ + "-device", + f"pci-bridge,id=pci_bridge{bridge},bus=pci_bridge{bridge - 1}," + f"chassis_nr={64 + bridge}" + ] + +config["QemuArgs"] += ["-device", f"virtio-blk-pci,drive=drive0,scsi=off,bus=pci_bridge25"] + +json.dump(config, sys.stdout) diff --git a/test/TEST-64-UDEV-STORAGE/lvm_basic.configure b/test/TEST-64-UDEV-STORAGE/lvm_basic.configure new file mode 100755 index 0000000000..9387b8377c --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/lvm_basic.configure @@ -0,0 +1,25 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import sys + + +config = json.load(sys.stdin) + +config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0"] + +for i in range(4): + id = f"drivelvmbasic{i}" + config["QemuDrives"] += [ + { + "Id": id, + "Size": "32M", + "Options": "cache=unsafe", + } + ] + config["QemuArgs"] += [ + "-device", f"scsi-hd,drive={id},vendor=systemd,product=foobar,serial=deadbeeflvm{i}", + ] + +json.dump(config, sys.stdout) diff --git a/test/TEST-64-UDEV-STORAGE/mdadm_basic.configure b/test/TEST-64-UDEV-STORAGE/mdadm_basic.configure new file mode 100755 index 0000000000..3f00afa955 --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/mdadm_basic.configure @@ -0,0 +1,25 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import sys + + +config = json.load(sys.stdin) + +config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0"] + +for i in range(5): + id = f"drivemdadmbasic{i}" + config["QemuDrives"] += [ + { + "Id": id, + "Size": "64M", + "Options": "cache=unsafe", + } + ] + config["QemuArgs"] += [ + "-device", f"scsi-hd,drive={id},vendor=systemd,product=foobar,serial=deadbeefmdadm{i}", + ] + +json.dump(config, sys.stdout) diff --git a/test/TEST-64-UDEV-STORAGE/mdadm_lvm.configure b/test/TEST-64-UDEV-STORAGE/mdadm_lvm.configure new file mode 100755 index 0000000000..b7661d9e81 --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/mdadm_lvm.configure @@ -0,0 +1,25 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import sys + + +config = json.load(sys.stdin) + +config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0"] + +for i in range(5): + id = f"drivemdadmlvm{i}" + config["QemuDrives"] += [ + { + "Id": id, + "Size": "64M", + "Options": "cache=unsafe", + } + ] + config["QemuArgs"] += [ + "-device", f"scsi-hd,drive={id},vendor=systemd,product=foobar,serial=deadbeefmdadmlvm{i}", + ] + +json.dump(config, sys.stdout) diff --git a/test/TEST-64-UDEV-STORAGE/megasas2_basic.configure b/test/TEST-64-UDEV-STORAGE/megasas2_basic.configure new file mode 100755 index 0000000000..632e2de5b0 --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/megasas2_basic.configure @@ -0,0 +1,36 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import os +import subprocess +import sys + + +config = json.load(sys.stdin) + +qemu = f"qemu-system-{os.environ["QEMU_ARCHITECTURE"]}" +result = subprocess.run([qemu, '-device', 'help'], check=True, text=True, stdout=subprocess.PIPE) +if 'name "megasas-gen2"' not in result.stdout: + print("megasas-gen2 device driver is not available, skipping test...", file=sys.stderr) + exit(77) + +for i in range(4): + config["QemuArgs"] += ['-device', f"megasas-gen2,id=scsi{i}"] + +for i in range(128): + id = f"drive{i}" + config["QemuDrives"] += [ + { + "Id": id, + "Size": "1M", + "Options": "cache=unsafe", + } + ] + config["QemuArgs"] += [ + '-device', + f"scsi-hd,drive={id},bus=scsi{i // 32}.0,channel=0," + f"scsi-id={i % 32},lun=0", + ] + +json.dump(config, sys.stdout) diff --git a/test/TEST-64-UDEV-STORAGE/meson.build b/test/TEST-64-UDEV-STORAGE/meson.build new file mode 100644 index 0000000000..ba1d1f8ed3 --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/meson.build @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +name = fs.name(meson.current_source_dir()) +unit = configure_file( + input : files('../test.service.in'), + output : '@0@.service'.format(name), + configuration : integration_test_template['configuration'], +) + +foreach testcase : [ + 'btrfs_basic', + 'iscsi_lvm', + 'long_sysfs_path', + 'lvm_basic', + 'mdadm_basic', + 'mdadm_lvm', + 'megasas2_basic', + 'multipath_basic_failover', + 'nvme_basic', + 'nvme_subsystem', + 'simultaneous_events', + 'virtio_scsi_identically_named_partitions', +] + integration_tests += [ + integration_test_template + { + 'name' : '@0@-@1@'.format(name, testcase), + # Make sure the service is still named TEST-64-UDEV-STORAGE.service. + 'unit' : unit, + 'cmdline' : integration_test_template['cmdline'] + [ + 'systemd.setenv=TEST_FUNCTION_NAME=testcase_@0@'.format(testcase) + ], + 'mkosi-args' : integration_test_template['mkosi-args'] + [ + '--configure-script', files('@0@.configure'.format(testcase)), + ], + }, + ] +endforeach diff --git a/test/TEST-64-UDEV-STORAGE/multipath_basic_failover.configure b/test/TEST-64-UDEV-STORAGE/multipath_basic_failover.configure new file mode 100755 index 0000000000..5f323b8a8b --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/multipath_basic_failover.configure @@ -0,0 +1,31 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import sys + + +config = json.load(sys.stdin) + +# Add 16 multipath devices, each backed by 4 paths +# We don't use --qemu-drive for this since they have to share the file. +for ndisk in range(16): + wwn = f"0xDEADDEADBEEF{ndisk:04d}" + if ndisk == 0: + size = "16M" + else: + size = "1M" + + for nback in range(4): + id = f"drive{ndisk}x{nback}" + config["QemuDrives"] += [ + { + "Id": id, + "Size": size, + "Options": "cache=unsafe", + "FileId": str(ndisk), + } + ] + config["QemuArgs"] += ["-device", f"scsi-hd,drive={id},serial=MPIO{ndisk},wwn={wwn}"] + +json.dump(config, sys.stdout) diff --git a/test/TEST-64-UDEV-STORAGE/nvme_basic.configure b/test/TEST-64-UDEV-STORAGE/nvme_basic.configure new file mode 100755 index 0000000000..68cbd728c3 --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/nvme_basic.configure @@ -0,0 +1,42 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import os +import subprocess +import sys + + +config = json.load(sys.stdin) + +qemu = f"qemu-system-{os.environ["QEMU_ARCHITECTURE"]}" +result = subprocess.run([qemu, '-device', 'help'], check=True, text=True, stdout=subprocess.PIPE) +if 'name "nvme"' not in result.stdout: + print("nvme device driver is not available, skipping test...", file=sys.stderr) + exit(77) + +for i in range(4): + config["QemuArgs"] += ["-device", f"megasas-gen2,id=scsi{i}"] + +def add_drive(i: int, serial: str) -> None: + global config + id = f"nvme{i}" + config["QemuDrives"] += [ + { + "Id": id, + "Size": "1M", + "Options": "cache=unsafe", + } + ] + config["QemuArgs"] += ["-device", f"nvme,drive={id},serial={serial},num_queues=8"] + +for i in range(5): + add_drive(i, serial=f"deadbeef{i}") +for i in range(5, 10): + add_drive(i, serial=f" deadbeef {i} ") +for i in range(10, 15): + add_drive(i, serial=f" dead/beef/{i} ") +for i in range(15, 20): + add_drive(i, serial=f"dead/../../beef/{i}") + +json.dump(config, sys.stdout) diff --git a/test/TEST-64-UDEV-STORAGE/nvme_subsystem.configure b/test/TEST-64-UDEV-STORAGE/nvme_subsystem.configure new file mode 100755 index 0000000000..eb601a6843 --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/nvme_subsystem.configure @@ -0,0 +1,39 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import os +import subprocess +import sys + + +config = json.load(sys.stdin) + +qemu = f"qemu-system-{os.environ["QEMU_ARCHITECTURE"]}" +result = subprocess.run([qemu, '-device', 'help'], check=True, text=True, stdout=subprocess.PIPE) +if 'name "nvme"' not in result.stdout: + print("nvme device driver is not available, skipping test...", file=sys.stderr) + exit(77) + +for id in ("nvme0", "nvme1"): + config["QemuDrives"] += [ + { + "Id": id, + "Size": "1M", + "Options": "cache=unsafe", + } + + ] + +config["QemuArgs"] += [ + # Create an NVM Subsystem Device + "-device", "nvme-subsys,id=nvme-subsys-64,nqn=subsys64", + # Attach two NVM controllers to it + "-device", "nvme,subsys=nvme-subsys-64,serial=deadbeef", + "-device", "nvme,subsys=nvme-subsys-64,serial=deadbeef", + # And create two shared namespaces attached to both controllers + "-device", "nvme-ns,drive=nvme0,nsid=16,shared=on", + "-device", "nvme-ns,drive=nvme1,nsid=17,shared=on", +] + +json.dump(config, sys.stdout) diff --git a/test/TEST-64-UDEV-STORAGE/simultaneous_events.configure b/test/TEST-64-UDEV-STORAGE/simultaneous_events.configure new file mode 100755 index 0000000000..a0edb01cc1 --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/simultaneous_events.configure @@ -0,0 +1,21 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import sys + + +config = json.load(sys.stdin) + +for i in range(10): + id = f"drivesimultaneousevents{i}" + config["QemuDrives"] += [ + { + "Id": id, + "Size": "128M", + "Options": "cache=unsafe", + } + ] + config["QemuArgs"] += ["-device", f"scsi-hd,drive={id},serial=deadbeeftest{i}"] + +json.dump(config, sys.stdout) diff --git a/test/TEST-64-UDEV-STORAGE/test.sh b/test/TEST-64-UDEV-STORAGE/test.sh index 9d4c90f88e..ddcb938588 100755 --- a/test/TEST-64-UDEV-STORAGE/test.sh +++ b/test/TEST-64-UDEV-STORAGE/test.sh @@ -369,7 +369,7 @@ testcase_lvm_basic() { return 77 fi - local qemu_opts=("-device ahci,id=ahci0") + local qemu_opts=("-device virtio-scsi-pci,id=scsi0") local diskpath i # Attach 4 SATA disks to the VM (and set their model and serial fields @@ -378,7 +378,7 @@ testcase_lvm_basic() { diskpath="${TESTDIR:?}/lvmbasic${i}.img" dd if=/dev/zero of="$diskpath" bs=1M count=32 qemu_opts+=( - "-device ide-hd,bus=ahci0.$i,drive=drive$i,model=foobar,serial=deadbeeflvm$i" + "-device scsi-hd,drive=drive$i,vendor=systemd,product=foobar,serial=deadbeeflvm$i" "-drive format=raw,cache=unsafe,file=$diskpath,if=none,id=drive$i" ) done @@ -396,7 +396,7 @@ testcase_btrfs_basic() { return 77 fi - local qemu_opts=("-device ahci,id=ahci0") + local qemu_opts=("-device virtio-scsi-pci,id=scsi0") local diskpath i size for i in {0..3}; do @@ -406,7 +406,7 @@ testcase_btrfs_basic() { dd if=/dev/zero of="$diskpath" bs=1M count="$size" qemu_opts+=( - "-device ide-hd,bus=ahci0.$i,drive=drive$i,model=foobar,serial=deadbeefbtrfs$i" + "-device scsi-hd,drive=drive$i,vendor=systemd,product=foobar,serial=deadbeefbtrfs$i" "-drive format=raw,cache=unsafe,file=$diskpath,if=none,id=drive$i" ) done @@ -424,7 +424,7 @@ testcase_iscsi_lvm() { return 77 fi - local qemu_opts=("-device ahci,id=ahci0") + local qemu_opts=("-device virtio-scsi-pci,id=scsi0") local diskpath i size for i in {0..3}; do @@ -435,7 +435,7 @@ testcase_iscsi_lvm() { dd if=/dev/zero of="$diskpath" bs=1M count="$size" qemu_opts+=( - "-device ide-hd,bus=ahci0.$i,drive=drive$i,model=foobar,serial=deadbeefiscsi$i" + "-device scsi-hd,drive=drive$i,vendor=systemd,product=foobar,serial=deadbeefiscsi$i" "-drive format=raw,cache=unsafe,file=$diskpath,if=none,id=drive$i" ) done @@ -479,7 +479,7 @@ testcase_mdadm_basic() { return 77 fi - local qemu_opts=("-device ahci,id=ahci0") + local qemu_opts=("-device virtio-scsi-pci,id=scsi0") local diskpath i size for i in {0..4}; do @@ -487,7 +487,7 @@ testcase_mdadm_basic() { dd if=/dev/zero of="$diskpath" bs=1M count=64 qemu_opts+=( - "-device ide-hd,bus=ahci0.$i,drive=drive$i,model=foobar,serial=deadbeefmdadm$i" + "-device scsi-hd,drive=drive$i,vendor=systemd,product=foobar,serial=deadbeefmdadm$i" "-drive format=raw,cache=unsafe,file=$diskpath,if=none,id=drive$i" ) done @@ -505,7 +505,7 @@ testcase_mdadm_lvm() { return 77 fi - local qemu_opts=("-device ahci,id=ahci0") + local qemu_opts=("-device virtio-scsi-pci,id=scsi0") local diskpath i size for i in {0..4}; do @@ -513,7 +513,7 @@ testcase_mdadm_lvm() { dd if=/dev/zero of="$diskpath" bs=1M count=64 qemu_opts+=( - "-device ide-hd,bus=ahci0.$i,drive=drive$i,model=foobar,serial=deadbeefmdadmlvm$i" + "-device scsi-hd,drive=drive$i,vendor=systemd,product=foobar,serial=deadbeefmdadmlvm$i" "-drive format=raw,cache=unsafe,file=$diskpath,if=none,id=drive$i" ) done diff --git a/test/TEST-64-UDEV-STORAGE/virtio_scsi_identically_named_partitions.configure b/test/TEST-64-UDEV-STORAGE/virtio_scsi_identically_named_partitions.configure new file mode 100755 index 0000000000..de22c1aa6b --- /dev/null +++ b/test/TEST-64-UDEV-STORAGE/virtio_scsi_identically_named_partitions.configure @@ -0,0 +1,33 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +import json +import os +import subprocess +import sys + + +config = json.load(sys.stdin) + +qemu = f"qemu-system-{os.environ["QEMU_ARCHITECTURE"]}" +result = subprocess.run([qemu, '-device', 'help'], check=True, text=True, stdout=subprocess.PIPE) +if 'name "virtio-scsi-pci"' not in result.stdout: + print("virtio-scsi-pci device driver is not available, skipping test...", file=sys.stderr) + exit(77) + +num_disk = 16 + +config["QemuArgs"] += ["-device", "virtio-scsi-pci,id=scsi0,num_queues=4"] + +for i in range(0, num_disk): + id = f"drivenamedpart{i}" + config["QemuDrives"] += [ + { + "Id": id, + "Size": "40M", + "Options": "cache=unsafe" + } + ] + config["QemuArgs"] += ["-device", f"scsi-hd,drive={id},bus=scsi0.0,channel=0,scsi-id=0,lun={i}"] + +json.dump(config, sys.stdout) diff --git a/test/TEST-65-ANALYZE/meson.build b/test/TEST-65-ANALYZE/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-65-ANALYZE/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-66-DEVICE-ISOLATION/meson.build b/test/TEST-66-DEVICE-ISOLATION/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-66-DEVICE-ISOLATION/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-67-INTEGRITY/meson.build b/test/TEST-67-INTEGRITY/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-67-INTEGRITY/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-68-PROPAGATE-EXIT-STATUS/meson.build b/test/TEST-68-PROPAGATE-EXIT-STATUS/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-68-PROPAGATE-EXIT-STATUS/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/units/testsuite-69.service b/test/TEST-69-SHUTDOWN/TEST-69-SHUTDOWN.service similarity index 60% rename from test/units/testsuite-69.service rename to test/TEST-69-SHUTDOWN/TEST-69-SHUTDOWN.service index 3910369c0f..5ff2842698 100644 --- a/test/units/testsuite-69.service +++ b/test/TEST-69-SHUTDOWN/TEST-69-SHUTDOWN.service @@ -1,6 +1,9 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Unit] Description=TEST-69-SHUTDOWN +Wants=basic.target multi-user.target +After=basic.target +Before=getty-pre.target [Service] Type=oneshot diff --git a/test/TEST-69-SHUTDOWN/meson.build b/test/TEST-69-SHUTDOWN/meson.build new file mode 100644 index 0000000000..ab4a38b13e --- /dev/null +++ b/test/TEST-69-SHUTDOWN/meson.build @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'enabled' : false, + 'unit' : files('TEST-69-SHUTDOWN.service'), + }, +] diff --git a/test/TEST-70-TPM2/meson.build b/test/TEST-70-TPM2/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-70-TPM2/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-71-HOSTNAME/meson.build b/test/TEST-71-HOSTNAME/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-71-HOSTNAME/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-72-SYSUPDATE/meson.build b/test/TEST-72-SYSUPDATE/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-72-SYSUPDATE/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-73-LOCALE/meson.build b/test/TEST-73-LOCALE/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-73-LOCALE/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-74-AUX-UTILS/meson.build b/test/TEST-74-AUX-UTILS/meson.build index 7f5cc704c9..43a733ee64 100644 --- a/test/TEST-74-AUX-UTILS/meson.build +++ b/test/TEST-74-AUX-UTILS/meson.build @@ -1,5 +1,8 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -test_params += { - 'storage': 'persistent', -} +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'storage': 'persistent', + }, +] diff --git a/test/TEST-75-RESOLVED/meson.build b/test/TEST-75-RESOLVED/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-75-RESOLVED/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-76-SYSCTL/meson.build b/test/TEST-76-SYSCTL/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-76-SYSCTL/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-78-SIGQUEUE/meson.build b/test/TEST-78-SIGQUEUE/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-78-SIGQUEUE/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-79-MEMPRESS/meson.build b/test/TEST-79-MEMPRESS/meson.build new file mode 100644 index 0000000000..2b832a8f6d --- /dev/null +++ b/test/TEST-79-MEMPRESS/meson.build @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'configuration' : integration_test_template['configuration'] + { + 'memory-accounting' : 'yes', + }, + }, +] diff --git a/test/testsuite-80.units/fdstore-nopin.service b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-nopin.service similarity index 54% rename from test/testsuite-80.units/fdstore-nopin.service rename to test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-nopin.service index 29ffd23033..f65885345f 100644 --- a/test/testsuite-80.units/fdstore-nopin.service +++ b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-nopin.service @@ -3,4 +3,4 @@ Type=notify NotifyAccess=all FileDescriptorStoreMax=10 FileDescriptorStorePreserve=restart -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-80.units/fdstore-pin.sh 0 +ExecStart=/usr/lib/systemd/tests/testdata/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh 0 diff --git a/test/testsuite-80.units/fdstore-pin.service b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.service similarity index 53% rename from test/testsuite-80.units/fdstore-pin.service rename to test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.service index 913daa2725..393b5ac681 100644 --- a/test/testsuite-80.units/fdstore-pin.service +++ b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.service @@ -3,4 +3,4 @@ Type=notify NotifyAccess=all FileDescriptorStoreMax=10 FileDescriptorStorePreserve=yes -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-80.units/fdstore-pin.sh 1 +ExecStart=/usr/lib/systemd/tests/testdata/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh 1 diff --git a/test/testsuite-80.units/fdstore-pin.sh b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh similarity index 100% rename from test/testsuite-80.units/fdstore-pin.sh rename to test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh diff --git a/test/testsuite-80.units/fdstore-pin.target b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.target similarity index 100% rename from test/testsuite-80.units/fdstore-pin.target rename to test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.target diff --git a/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/notify.service b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/notify.service new file mode 100644 index 0000000000..5693be613d --- /dev/null +++ b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/notify.service @@ -0,0 +1,4 @@ +[Service] +Type=notify +NotifyAccess=all +ExecStart=/usr/lib/systemd/tests/testdata/TEST-80-NOTIFYACCESS.units/test.sh diff --git a/test/testsuite-80.units/test.sh b/test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/test.sh similarity index 100% rename from test/testsuite-80.units/test.sh rename to test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/test.sh diff --git a/test/TEST-80-NOTIFYACCESS/meson.build b/test/TEST-80-NOTIFYACCESS/meson.build new file mode 100644 index 0000000000..f78c6fd732 --- /dev/null +++ b/test/TEST-80-NOTIFYACCESS/meson.build @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] + +testdata_subdirs += [meson.current_source_dir() / 'TEST-80-NOTIFYACCESS.units'] diff --git a/test/TEST-81-GENERATORS/meson.build b/test/TEST-81-GENERATORS/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-81-GENERATORS/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/units/testsuite-82.service b/test/TEST-82-SOFTREBOOT/TEST-82-SOFTREBOOT.service similarity index 80% rename from test/units/testsuite-82.service rename to test/TEST-82-SOFTREBOOT/TEST-82-SOFTREBOOT.service index a8fc4f9cc7..f3892a7777 100644 --- a/test/units/testsuite-82.service +++ b/test/TEST-82-SOFTREBOOT/TEST-82-SOFTREBOOT.service @@ -2,7 +2,9 @@ [Unit] Description=TEST-82-SOFTREBOOT DefaultDependencies=no +Wants=basic.target multi-user.target After=basic.target +Before=getty-pre.target [Service] Type=oneshot diff --git a/test/TEST-82-SOFTREBOOT/meson.build b/test/TEST-82-SOFTREBOOT/meson.build new file mode 100644 index 0000000000..575ada9851 --- /dev/null +++ b/test/TEST-82-SOFTREBOOT/meson.build @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + 'enabled' : false, + 'unit' : files('TEST-82-SOFTREBOOT.service'), + }, +] diff --git a/test/TEST-83-BTRFS/meson.build b/test/TEST-83-BTRFS/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-83-BTRFS/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/TEST-84-STORAGETM/meson.build b/test/TEST-84-STORAGETM/meson.build new file mode 100644 index 0000000000..8dec5f37e7 --- /dev/null +++ b/test/TEST-84-STORAGETM/meson.build @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later + +integration_tests += [ + integration_test_template + { + 'name' : fs.name(meson.current_source_dir()), + }, +] diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py index c41ca8e55a..55ea4ff0d8 100755 --- a/test/integration-test-wrapper.py +++ b/test/integration-test-wrapper.py @@ -42,8 +42,8 @@ def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('--meson-source-dir', required=True, type=Path) parser.add_argument('--meson-build-dir', required=True, type=Path) - parser.add_argument('--test-name', required=True) - parser.add_argument('--test-number', required=True) + parser.add_argument('--name', required=True) + parser.add_argument('--unit', required=True) parser.add_argument('--storage', required=True) parser.add_argument('--firmware', required=True) parser.add_argument('--slow', action=argparse.BooleanOptionalAction) @@ -51,21 +51,18 @@ def main(): args = parser.parse_args() if not bool(int(os.getenv("SYSTEMD_INTEGRATION_TESTS", "0"))): - print(f"SYSTEMD_INTEGRATION_TESTS=1 not found in environment, skipping {args.test_name}", file=sys.stderr) + print(f"SYSTEMD_INTEGRATION_TESTS=1 not found in environment, skipping {args.name}", file=sys.stderr) exit(77) if args.slow and not bool(int(os.getenv("SYSTEMD_SLOW_TESTS", "0"))): - print(f"SYSTEMD_SLOW_TESTS=1 not found in environment, skipping {args.test_name}", file=sys.stderr) + print(f"SYSTEMD_SLOW_TESTS=1 not found in environment, skipping {args.name}", file=sys.stderr) exit(77) - name = args.test_name + (f"-{i}" if (i := os.getenv("MESON_TEST_ITERATION")) else "") - test_unit = f"testsuite-{args.test_number}.service" + name = args.name + (f"-{i}" if (i := os.getenv("MESON_TEST_ITERATION")) else "") dropin = textwrap.dedent( """\ [Unit] - After=multi-user.target network.target - Requires=multi-user.target SuccessAction=exit SuccessActionExitStatus=123 @@ -122,16 +119,17 @@ def main(): else [] ), '--credential', - f"systemd.unit-dropin.{test_unit}={shlex.quote(dropin)}", + f"systemd.unit-dropin.{args.unit}={shlex.quote(dropin)}", '--runtime-network=none', '--runtime-scratch=no', + *args.mkosi_args, '--append', '--qemu-firmware', args.firmware, '--kernel-command-line-extra', ' '.join([ 'systemd.hostname=H', - f"SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-{args.test_number}.units:/usr/lib/systemd/tests/testdata/units:", - f"systemd.unit={test_unit}", + f"SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/{args.name}.units:/usr/lib/systemd/tests/testdata/units:", + f"systemd.unit={args.unit}", 'systemd.mask=systemd-networkd-wait-online.service', *( [ @@ -145,7 +143,6 @@ def main(): ), ]), '--credential', f"journal.storage={'persistent' if sys.stderr.isatty() else args.storage}", - *args.mkosi_args, 'qemu', ] @@ -184,7 +181,7 @@ def main(): ops += [f"gh run download {id} --name {artifact} -D ci/{artifact}"] journal_file = Path(f"ci/{artifact}/test/journal/{name}.journal") - ops += [f"journalctl --file {journal_file} --no-hostname -o short-monotonic -u {test_unit} -p info"] + ops += [f"journalctl --file {journal_file} --no-hostname -o short-monotonic -u {args.unit} -p info"] print("Test failed, relevant logs can be viewed with: \n\n" f"{(' && '.join(ops))}\n", file=sys.stderr) diff --git a/test/meson.build b/test/meson.build index 30a0461f0d..61aa01089a 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,75 +1,5 @@ # SPDX-License-Identifier: LGPL-2.1-or-later -if install_tests - foreach subdir : [ - 'auxv', - 'journal-data', - 'knot-data', - 'test-journals', - 'units', - 'test-execute', - 'test-fstab-generator', - 'test-path', - 'test-path-util', - 'test-umount', - 'test-network', - 'test-network-generator-conversion', - 'testsuite-03.units', - 'testsuite-04.units', - 'testsuite-06.units', - 'testsuite-07.units', - 'testsuite-16.units', - 'testsuite-23.units', - 'testsuite-30.units', - 'testsuite-52.units', - 'testsuite-63.units', - 'testsuite-80.units', - ] - # install_subdir() before meson 1.3.0 does not handle symlinks correctly (it follows them - # instead of copying the symlink) so we use rsync instead. - if meson.version().version_compare('<1.3.0') - if not rsync.found() - error('rsync is required to install the integration test data') - endif - - rsync_r = rsync.full_path() + ' -rlpt --exclude .gitattributes --exclude 25-default.link -- "@0@" "${DESTDIR:-}@1@"' - meson.add_install_script(sh, '-c', - rsync_r.format(meson.current_source_dir() / subdir, testdata_dir)) - else - install_subdir(subdir, - exclude_files : ['.gitattributes', '25-default.link'], - install_dir : testdata_dir, - follow_symlinks : false) - endif - endforeach - - # test-network/conf/25-default.link is a local symlink that becomes dangling when installed, so we - # exclude it and create the correct symlink here. - meson.add_install_script(sh, '-c', ln_s.format(networkdir / '99-default.link', - testdata_dir / 'test-network/conf/25-default.link')) - - install_data(kbd_model_map, - install_dir : testdata_dir + '/test-keymap-util') - - if conf.get('HAVE_ZSTD') == 1 and efi_arch != '' - install_subdir('test-bcd', - exclude_files : '.gitattributes', - install_dir : testdata_dir) - endif - if conf.get('ENABLE_RESOLVE') == 1 - install_subdir('test-resolve', - exclude_files : '.gitattributes', - install_dir : testdata_dir) - endif - - # The unit tests implemented as shell scripts expect to find testdata/ - # in the directory where they are stored. - meson.add_install_script(sh, '-c', ln_s.format(testdata_dir, - unittestsdir / 'testdata')) -endif - -############################################################ - if conf.get('ENABLE_SYSUSERS') == 1 test_sysusers_sh = configure_file( input : 'test-sysusers.sh.in', @@ -344,102 +274,141 @@ endif ############################################################ integration_test_wrapper = find_program('integration-test-wrapper.py') -integration_tests = { - '01': 'TEST-01-BASIC', - '02': 'TEST-02-UNITTESTS', - '03': 'TEST-03-JOBS', - '04': 'TEST-04-JOURNAL', - '05': 'TEST-05-RLIMITS', - '06': 'TEST-06-SELINUX', - '07': 'TEST-07-PID1', - # '08': 'TEST-08-INITRD', - '09': 'TEST-09-REBOOT', - '13': 'TEST-13-NSPAWN', - '15': 'TEST-15-DROPIN', - '16': 'TEST-16-EXTEND-TIMEOUT', - '17': 'TEST-17-UDEV', - '18': 'TEST-18-FAILUREACTION', - '19': 'TEST-19-CGROUP', - '21': 'TEST-21-DFUZZER', - '22': 'TEST-22-TMPFILES', - '23': 'TEST-23-UNIT-FILE', - # '24': 'TEST-24-CRYPTSETUP', - '25': 'TEST-25-IMPORT', - '26': 'TEST-26-SYSTEMCTL', - '29': 'TEST-29-PORTABLE', - '30': 'TEST-30-ONCLOCKCHANGE', - '31': 'TEST-31-DEVICE-ENUMERATION', - '32': 'TEST-32-OOMPOLICY', - '34': 'TEST-34-DYNAMICUSERMIGRATE', - '35': 'TEST-35-LOGIN', - '36': 'TEST-36-NUMAPOLICY', - '38': 'TEST-38-FREEZER', - '43': 'TEST-43-PRIVATEUSER-UNPRIV', - '44': 'TEST-44-LOG-NAMESPACE', - '45': 'TEST-45-TIMEDATE', - '46': 'TEST-46-HOMED', - '50': 'TEST-50-DISSECT', - '52': 'TEST-52-HONORFIRSTSHUTDOWN', - '53': 'TEST-53-ISSUE-16347', - # '54': 'TEST-54-CREDS', - '55': 'TEST-55-OOMD', - '58': 'TEST-58-REPART', - '59': 'TEST-59-RELOADING-RESTART', - '60': 'TEST-60-MOUNT-RATELIMIT', - '62': 'TEST-62-RESTRICT-IFACES', - '63': 'TEST-63-PATH', - # '64': 'TEST-64-UDEV-STORAGE', - '65': 'TEST-65-ANALYZE', - '66': 'TEST-66-DEVICE-ISOLATION', - '67': 'TEST-67-INTEGRITY', - '68': 'TEST-68-PROPAGATE-EXIT-STATUS', - # '69': 'TEST-69-SHUTDOWN', - '70': 'TEST-70-TPM2', - '71': 'TEST-71-HOSTNAME', - '72': 'TEST-72-SYSUPDATE', - '73': 'TEST-73-LOCALE', - '74': 'TEST-74-AUX-UTILS', - '75': 'TEST-75-RESOLVED', - '76': 'TEST-76-SYSCTL', - '78': 'TEST-78-SIGQUEUE', - '79': 'TEST-79-MEMPRESS', - '80': 'TEST-80-NOTIFYACCESS', - '81': 'TEST-81-GENERATORS', - # '82': 'TEST-82-SOFTREBOOT', - '83': 'TEST-83-BTRFS', - '84': 'TEST-84-STORAGETM', +integration_tests = [] +integration_test_template = { + 'mkosi-args' : [], + 'timeout' : 1800, + 'storage' : 'volatile', + 'priority' : 0, + 'firmware' : 'linux', + 'slow' : false, + 'enabled' : true, + 'configuration' : { + 'memory-accounting' : 'no', + 'command' : testdata_dir / 'units/%N.sh', + }, + 'cmdline' : [], } -foreach test_number, dirname : integration_tests - test_params = { - 'mkosi_args' : [], - 'timeout' : 1800, - 'storage' : 'volatile', - 'priority' : 0, - 'firmware' : 'linux', - 'slow' : false, - } +testdata_subdirs = [ + 'auxv', + 'journal-data', + 'knot-data', + 'test-journals', + 'units', + 'test-execute', + 'test-fstab-generator', + 'test-path', + 'test-path-util', + 'test-umount', + 'test-network', + 'test-network-generator-conversion', +] - # TODO: This fs.exists call isn't included in rebuild logic - # so if you add a new meson.build in a subdir - # you need to touch another build file to get it to reparse. - if fs.exists(dirname / 'meson.build') - subdir(dirname) - endif +foreach dirname : [ + 'TEST-01-BASIC', + 'TEST-02-UNITTESTS', + 'TEST-03-JOBS', + 'TEST-04-JOURNAL', + 'TEST-05-RLIMITS', + 'TEST-06-SELINUX', + 'TEST-07-PID1', + 'TEST-08-INITRD', + 'TEST-09-REBOOT', + 'TEST-13-NSPAWN', + 'TEST-15-DROPIN', + 'TEST-16-EXTEND-TIMEOUT', + 'TEST-17-UDEV', + 'TEST-18-FAILUREACTION', + 'TEST-19-CGROUP', + 'TEST-21-DFUZZER', + 'TEST-22-TMPFILES', + 'TEST-23-UNIT-FILE', + 'TEST-24-CRYPTSETUP', + 'TEST-25-IMPORT', + 'TEST-26-SYSTEMCTL', + 'TEST-29-PORTABLE', + 'TEST-30-ONCLOCKCHANGE', + 'TEST-31-DEVICE-ENUMERATION', + 'TEST-32-OOMPOLICY', + 'TEST-34-DYNAMICUSERMIGRATE', + 'TEST-35-LOGIN', + 'TEST-36-NUMAPOLICY', + 'TEST-38-FREEZER', + 'TEST-43-PRIVATEUSER-UNPRIV', + 'TEST-44-LOG-NAMESPACE', + 'TEST-45-TIMEDATE', + 'TEST-46-HOMED', + 'TEST-50-DISSECT', + 'TEST-52-HONORFIRSTSHUTDOWN', + 'TEST-53-ISSUE-16347', + 'TEST-54-CREDS', + 'TEST-55-OOMD', + 'TEST-58-REPART', + 'TEST-59-RELOADING-RESTART', + 'TEST-60-MOUNT-RATELIMIT', + 'TEST-62-RESTRICT-IFACES', + 'TEST-63-PATH', + 'TEST-64-UDEV-STORAGE', + 'TEST-65-ANALYZE', + 'TEST-66-DEVICE-ISOLATION', + 'TEST-67-INTEGRITY', + 'TEST-68-PROPAGATE-EXIT-STATUS', + 'TEST-69-SHUTDOWN', + 'TEST-70-TPM2', + 'TEST-71-HOSTNAME', + 'TEST-72-SYSUPDATE', + 'TEST-73-LOCALE', + 'TEST-74-AUX-UTILS', + 'TEST-75-RESOLVED', + 'TEST-76-SYSCTL', + 'TEST-78-SIGQUEUE', + 'TEST-79-MEMPRESS', + 'TEST-80-NOTIFYACCESS', + 'TEST-81-GENERATORS', + 'TEST-82-SOFTREBOOT', + 'TEST-83-BTRFS', + 'TEST-84-STORAGETM', +] + subdir(dirname) +endforeach - args = [ +foreach integration_test : integration_tests + integration_test_args = [ '--meson-source-dir', meson.project_source_root(), '--meson-build-dir', meson.project_build_root(), - '--test-name', dirname, - '--test-number', test_number, - '--storage', test_params['storage'], - '--firmware', test_params['firmware'], + '--name', integration_test['name'], + '--storage', integration_test['storage'], + '--firmware', integration_test['firmware'], ] - if test_params['slow'] - args += ['--slow'] + if 'unit' in integration_test + integration_test_unit = integration_test['unit'] + else + integration_test_unit = configure_file( + input : 'test.service.in', + output : '@0@.service'.format(integration_test['name']), + configuration : integration_test['configuration'], + ) endif - args += ['--'] + test_params['mkosi_args'] + integration_test_args += ['--unit', fs.name(integration_test_unit)] + if install_tests + install_data(integration_test_unit, install_dir : testdata_dir / 'units') + endif + + if integration_test['slow'] + integration_test_args += ['--slow'] + endif + + integration_test_args += ['--'] + + if integration_test['cmdline'].length() > 0 + integration_test_args += [ + '--kernel-command-line-extra=@0@'.format(' '.join(integration_test['cmdline'])) + ] + endif + + integration_test_args += integration_test['mkosi-args'] integration_test_env = {} @@ -451,14 +420,65 @@ foreach test_number, dirname : integration_tests integration_test_env += {'SYSTEMD_SLOW_TESTS': '1'} endif - # We don't explicitly depend on the "mkosi" target because that means the image is rebuilt - # on every "ninja -C build". Instead, the mkosi target has to be rebuilt manually before - # running the integration tests with mkosi. - test(dirname, - integration_test_wrapper, - env : integration_test_env, - args : args, - timeout : test_params['timeout'], - priority : test_params['priority'], - suite : 'integration-tests') + if not integration_test['enabled'] + continue + endif + + # We don't explicitly depend on the "mkosi" target because that means the image is rebuilt on every + # "ninja -C build". Instead, the mkosi target has to be rebuilt manually before running the + # integration tests with mkosi. + test( + integration_test['name'], + integration_test_wrapper, + env : integration_test_env, + args : integration_test_args, + timeout : integration_test['timeout'], + priority : integration_test['priority'], + suite : 'integration-tests', + ) endforeach + +if install_tests + foreach subdir : testdata_subdirs + # install_subdir() before meson 1.3.0 does not handle symlinks correctly (it follows them + # instead of copying the symlink) so we use rsync instead. + if meson.version().version_compare('<1.3.0') + if not rsync.found() + error('rsync is required to install the integration test data') + endif + + rsync_r = rsync.full_path() + ' -rlpt --exclude .gitattributes --exclude 25-default.link -- "@0@" "${DESTDIR:-}@1@"' + meson.add_install_script(sh, '-c', + rsync_r.format(meson.current_source_dir() / subdir, testdata_dir)) + else + install_subdir(subdir, + exclude_files : ['.gitattributes', '25-default.link'], + install_dir : testdata_dir, + follow_symlinks : false) + endif + endforeach + + # test-network/conf/25-default.link is a local symlink that becomes dangling when installed, so we + # exclude it and create the correct symlink here. + meson.add_install_script(sh, '-c', ln_s.format(networkdir / '99-default.link', + testdata_dir / 'test-network/conf/25-default.link')) + + install_data(kbd_model_map, + install_dir : testdata_dir + '/test-keymap-util') + + if conf.get('HAVE_ZSTD') == 1 and efi_arch != '' + install_subdir('test-bcd', + exclude_files : '.gitattributes', + install_dir : testdata_dir) + endif + if conf.get('ENABLE_RESOLVE') == 1 + install_subdir('test-resolve', + exclude_files : '.gitattributes', + install_dir : testdata_dir) + endif + + # The unit tests implemented as shell scripts expect to find testdata/ + # in the directory where they are stored. + meson.add_install_script(sh, '-c', ln_s.format(testdata_dir, + unittestsdir / 'testdata')) +endif diff --git a/test/test-functions b/test/test-functions index 6e889f838b..e1f65e26a1 100644 --- a/test/test-functions +++ b/test/test-functions @@ -146,12 +146,6 @@ if ! [[ "$TESTNAME" =~ ^TEST\-([0-9]+)\-.+$ ]]; then echo "ERROR: Test name '$TESTNAME' is not in the expected format: TEST-[0-9]+-*" >&2 exit 1 fi -TESTID="${BASH_REMATCH[1]:?}" - -if [[ ! -f "$TEST_UNITS_DIR/testsuite-$TESTID.service" ]]; then - echo "ERROR: Test '$TESTNAME' is missing its service file '$TEST_UNITS_DIR/testsuite-$TESTID.service" >&2 - exit 1 -fi BASICTOOLS=( awk @@ -566,9 +560,9 @@ run_qemu() { "loglevel=2" "init=$PATH_TO_INIT" "console=$CONSOLE" - "SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-$1.units:/usr/lib/systemd/tests/testdata/units:" + "SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/$1.units:/usr/lib/systemd/tests/testdata/units:" "systemd.unit=testsuite.target" - "systemd.wants=testsuite-$1.service" + "systemd.wants=$1.service" "noresume" "oops=panic" ${TEST_MATCH_SUBTEST:+"systemd.setenv=TEST_MATCH_SUBTEST=$TEST_MATCH_SUBTEST"} @@ -658,13 +652,13 @@ run_nspawn() { "--register=no" "--kill-signal=SIGKILL" "--directory=${1:?}" - "--setenv=SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-$2.units:/usr/lib/systemd/tests/testdata/units:" - "--machine=TEST-$TESTID" + "--setenv=SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/$2.units:/usr/lib/systemd/tests/testdata/units:" + "--machine=$2" ) local kernel_params=( "$PATH_TO_INIT" "systemd.unit=testsuite.target" - "systemd.wants=testsuite-$2.service" + "systemd.wants=$2.service" ${TEST_MATCH_SUBTEST:+"systemd.setenv=TEST_MATCH_SUBTEST=$TEST_MATCH_SUBTEST"} ${TEST_MATCH_TESTCASE:+"systemd.setenv=TEST_MATCH_TESTCASE=$TEST_MATCH_TESTCASE"} ) @@ -1745,10 +1739,10 @@ save_journal() { dest_name="system.journal" fi - # Show messages from the testsuite-XX.service or messages with priority "warning" and higher + # Show messages from the TEST-XX-XXX.service or messages with priority "warning" and higher echo " --- $source_dir ---" "$JOURNALCTL" --all --no-pager --no-hostname -o short-monotonic -D "$source_dir" \ - _SYSTEMD_UNIT="testsuite-${TESTID:?}.service" + SYSLOG_IDENTIFIER="testsuite-$TESTID.sh" + \ + _SYSTEMD_UNIT="${TESTNAME:?}.service" + SYSLOG_IDENTIFIER="$TESTNAME.sh" + \ PRIORITY=4 + PRIORITY=3 + PRIORITY=2 + PRIORITY=1 + PRIORITY=0 if get_bool "$save"; then @@ -3325,11 +3319,11 @@ test_setup() { } test_run() { - local test_id="${1:?}" + local test_name="${1:?}" mount_initdir if ! get_bool "${TEST_NO_QEMU:=}"; then - if run_qemu "$test_id"; then + if run_qemu "$test_name"; then check_result_qemu || { echo "qemu test failed"; return 1; } else dwarn "can't run qemu, skipping" @@ -3337,7 +3331,7 @@ test_run() { fi if ! get_bool "${TEST_NO_NSPAWN:=}"; then mount_initdir - if run_nspawn "${initdir:?}" "$test_id"; then + if run_nspawn "${initdir:?}" "$test_name"; then check_result_nspawn "$initdir" || { echo "nspawn-root test failed"; return 1; } else dwarn "can't run systemd-nspawn, skipping" @@ -3345,7 +3339,7 @@ test_run() { if get_bool "${RUN_IN_UNPRIVILEGED_CONTAINER:=}"; then dir="$TESTDIR/unprivileged-nspawn-root" - if NSPAWN_ARGUMENTS="-U --private-network ${NSPAWN_ARGUMENTS:-}" run_nspawn "$dir" "$test_id"; then + if NSPAWN_ARGUMENTS="-U --private-network ${NSPAWN_ARGUMENTS:-}" run_nspawn "$dir" "$test_name"; then check_result_nspawn "$dir" || { echo "unprivileged-nspawn-root test failed"; return 1; } else dwarn "can't run systemd-nspawn, skipping" @@ -3401,7 +3395,7 @@ do_test() { case $1 in --run) echo "${testname} RUN: $TEST_DESCRIPTION" - test_run "$TESTID" + test_run "$TESTNAME" ret=$? if [ $ret -eq 0 ]; then echo "${testname} RUN: $TEST_DESCRIPTION [OK]" @@ -3433,7 +3427,7 @@ do_test() { test_setup_cleanup >"$TESTLOG" 2>&1 || ret=$? fi if [ $ret -eq 0 ]; then - test_run "$TESTID" >"$TESTLOG" 2>&1 || ret=$? + test_run "$TESTNAME" >"$TESTLOG" 2>&1 || ret=$? fi test_cleanup if [ $ret -eq 0 ]; then diff --git a/test/test.service.in b/test/test.service.in new file mode 100644 index 0000000000..71e3618ec3 --- /dev/null +++ b/test/test.service.in @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +[Unit] +Description=%N +Wants=basic.target network.target tpm2.target multi-user.target user@4711.service +After=basic.target network.target tpm2.target user@4711.service +Before=getty-pre.target + +[Service] +ExecStartPre=rm -f /failed /testok +ExecStart=@command@ +Type=oneshot +MemoryAccounting=@memory-accounting@ diff --git a/test/testsuite-23.units/testsuite-23-prop-stop-one.service b/test/testsuite-23.units/testsuite-23-prop-stop-one.service deleted file mode 100644 index 03189550a7..0000000000 --- a/test/testsuite-23.units/testsuite-23-prop-stop-one.service +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Stop Propagation Receiver -Wants=testsuite-23-prop-stop-two.service -After=testsuite-23-prop-stop-two.service -StopPropagatedFrom=testsuite-23-prop-stop-two.service - -[Service] -ExecStart=sleep infinity -ExecStopPost=systemctl kill --kill-whom=main -sUSR2 testsuite-23.service diff --git a/test/testsuite-80.units/notify.service b/test/testsuite-80.units/notify.service deleted file mode 100644 index 196b076672..0000000000 --- a/test/testsuite-80.units/notify.service +++ /dev/null @@ -1,4 +0,0 @@ -[Service] -Type=notify -NotifyAccess=all -ExecStart=/usr/lib/systemd/tests/testdata/testsuite-80.units/test.sh diff --git a/test/units/testsuite-01.sh b/test/units/TEST-01-BASIC.sh similarity index 100% rename from test/units/testsuite-01.sh rename to test/units/TEST-01-BASIC.sh diff --git a/test/units/testsuite-02.sh b/test/units/TEST-02-UNITTESTS.sh similarity index 100% rename from test/units/testsuite-02.sh rename to test/units/TEST-02-UNITTESTS.sh diff --git a/test/units/testsuite-03.sh b/test/units/TEST-03-JOBS.sh similarity index 100% rename from test/units/testsuite-03.sh rename to test/units/TEST-03-JOBS.sh diff --git a/test/units/testsuite-04.LogFilterPatterns.sh b/test/units/TEST-04-JOURNAL.LogFilterPatterns.sh similarity index 100% rename from test/units/testsuite-04.LogFilterPatterns.sh rename to test/units/TEST-04-JOURNAL.LogFilterPatterns.sh diff --git a/test/units/testsuite-04.SYSTEMD_JOURNAL_COMPRESS.sh b/test/units/TEST-04-JOURNAL.SYSTEMD_JOURNAL_COMPRESS.sh similarity index 100% rename from test/units/testsuite-04.SYSTEMD_JOURNAL_COMPRESS.sh rename to test/units/TEST-04-JOURNAL.SYSTEMD_JOURNAL_COMPRESS.sh diff --git a/test/units/testsuite-04.bsod.sh b/test/units/TEST-04-JOURNAL.bsod.sh similarity index 100% rename from test/units/testsuite-04.bsod.sh rename to test/units/TEST-04-JOURNAL.bsod.sh diff --git a/test/units/testsuite-04.cat.sh b/test/units/TEST-04-JOURNAL.cat.sh similarity index 100% rename from test/units/testsuite-04.cat.sh rename to test/units/TEST-04-JOURNAL.cat.sh diff --git a/test/units/testsuite-04.corrupted-journals.sh b/test/units/TEST-04-JOURNAL.corrupted-journals.sh similarity index 100% rename from test/units/testsuite-04.corrupted-journals.sh rename to test/units/TEST-04-JOURNAL.corrupted-journals.sh diff --git a/test/units/testsuite-04.fss.sh b/test/units/TEST-04-JOURNAL.fss.sh similarity index 100% rename from test/units/testsuite-04.fss.sh rename to test/units/TEST-04-JOURNAL.fss.sh diff --git a/test/units/testsuite-04.journal-append.sh b/test/units/TEST-04-JOURNAL.journal-append.sh similarity index 100% rename from test/units/testsuite-04.journal-append.sh rename to test/units/TEST-04-JOURNAL.journal-append.sh diff --git a/test/units/testsuite-04.journal-corrupt.sh b/test/units/TEST-04-JOURNAL.journal-corrupt.sh similarity index 100% rename from test/units/testsuite-04.journal-corrupt.sh rename to test/units/TEST-04-JOURNAL.journal-corrupt.sh diff --git a/test/units/testsuite-04.journal-gatewayd.sh b/test/units/TEST-04-JOURNAL.journal-gatewayd.sh similarity index 100% rename from test/units/testsuite-04.journal-gatewayd.sh rename to test/units/TEST-04-JOURNAL.journal-gatewayd.sh diff --git a/test/units/testsuite-04.journal-remote.sh b/test/units/TEST-04-JOURNAL.journal-remote.sh similarity index 100% rename from test/units/testsuite-04.journal-remote.sh rename to test/units/TEST-04-JOURNAL.journal-remote.sh diff --git a/test/units/testsuite-04.journal.sh b/test/units/TEST-04-JOURNAL.journal.sh similarity index 100% rename from test/units/testsuite-04.journal.sh rename to test/units/TEST-04-JOURNAL.journal.sh diff --git a/test/units/testsuite-04.sh b/test/units/TEST-04-JOURNAL.sh similarity index 100% rename from test/units/testsuite-04.sh rename to test/units/TEST-04-JOURNAL.sh diff --git a/test/units/testsuite-05.effective-limit.sh b/test/units/TEST-05-RLIMITS.effective-limit.sh similarity index 100% rename from test/units/testsuite-05.effective-limit.sh rename to test/units/TEST-05-RLIMITS.effective-limit.sh diff --git a/test/units/testsuite-05.rlimit.sh b/test/units/TEST-05-RLIMITS.rlimit.sh similarity index 77% rename from test/units/testsuite-05.rlimit.sh rename to test/units/TEST-05-RLIMITS.rlimit.sh index bbf3adbe65..6b425d4081 100755 --- a/test/units/testsuite-05.rlimit.sh +++ b/test/units/TEST-05-RLIMITS.rlimit.sh @@ -16,8 +16,8 @@ systemctl daemon-reload [[ "$(systemctl show -P DefaultLimitNOFILESoft)" = "10000" ]] [[ "$(systemctl show -P DefaultLimitNOFILE)" = "16384" ]] -[[ "$(systemctl show -P LimitNOFILESoft testsuite-05.service)" = "10000" ]] -[[ "$(systemctl show -P LimitNOFILE testsuite-05.service)" = "16384" ]] +[[ "$(systemctl show -P LimitNOFILESoft TEST-05-RLIMITS.service)" = "10000" ]] +[[ "$(systemctl show -P LimitNOFILE TEST-05-RLIMITS.service)" = "16384" ]] # shellcheck disable=SC2016 systemd-run --wait -t bash -c '[[ "$(ulimit -n -S)" = "10000" ]]' diff --git a/test/units/testsuite-05.sh b/test/units/TEST-05-RLIMITS.sh similarity index 100% rename from test/units/testsuite-05.sh rename to test/units/TEST-05-RLIMITS.sh diff --git a/test/units/testsuite-06.sh b/test/units/TEST-06-SELINUX.sh similarity index 100% rename from test/units/testsuite-06.sh rename to test/units/TEST-06-SELINUX.sh diff --git a/test/units/testsuite-07.aux-scope.sh b/test/units/TEST-07-PID1.aux-scope.sh similarity index 100% rename from test/units/testsuite-07.aux-scope.sh rename to test/units/TEST-07-PID1.aux-scope.sh diff --git a/test/units/testsuite-07.exec-context.sh b/test/units/TEST-07-PID1.exec-context.sh similarity index 100% rename from test/units/testsuite-07.exec-context.sh rename to test/units/TEST-07-PID1.exec-context.sh diff --git a/test/units/testsuite-07.exec-deserialization.sh b/test/units/TEST-07-PID1.exec-deserialization.sh similarity index 100% rename from test/units/testsuite-07.exec-deserialization.sh rename to test/units/TEST-07-PID1.exec-deserialization.sh diff --git a/test/units/testsuite-07.exec-timestamps.sh b/test/units/TEST-07-PID1.exec-timestamps.sh similarity index 100% rename from test/units/testsuite-07.exec-timestamps.sh rename to test/units/TEST-07-PID1.exec-timestamps.sh diff --git a/test/units/testsuite-07.issue-14566.sh b/test/units/TEST-07-PID1.issue-14566.sh similarity index 100% rename from test/units/testsuite-07.issue-14566.sh rename to test/units/TEST-07-PID1.issue-14566.sh diff --git a/test/units/testsuite-07.issue-16115.sh b/test/units/TEST-07-PID1.issue-16115.sh similarity index 100% rename from test/units/testsuite-07.issue-16115.sh rename to test/units/TEST-07-PID1.issue-16115.sh diff --git a/test/units/testsuite-07.issue-1981.sh b/test/units/TEST-07-PID1.issue-1981.sh similarity index 100% rename from test/units/testsuite-07.issue-1981.sh rename to test/units/TEST-07-PID1.issue-1981.sh diff --git a/test/units/testsuite-07.issue-2467.sh b/test/units/TEST-07-PID1.issue-2467.sh similarity index 100% rename from test/units/testsuite-07.issue-2467.sh rename to test/units/TEST-07-PID1.issue-2467.sh diff --git a/test/units/testsuite-07.issue-27953.sh b/test/units/TEST-07-PID1.issue-27953.sh similarity index 100% rename from test/units/testsuite-07.issue-27953.sh rename to test/units/TEST-07-PID1.issue-27953.sh diff --git a/test/units/testsuite-07.issue-30412.sh b/test/units/TEST-07-PID1.issue-30412.sh similarity index 100% rename from test/units/testsuite-07.issue-30412.sh rename to test/units/TEST-07-PID1.issue-30412.sh diff --git a/test/units/testsuite-07.issue-3166.sh b/test/units/TEST-07-PID1.issue-3166.sh similarity index 100% rename from test/units/testsuite-07.issue-3166.sh rename to test/units/TEST-07-PID1.issue-3166.sh diff --git a/test/units/testsuite-07.issue-3171.sh b/test/units/TEST-07-PID1.issue-3171.sh similarity index 100% rename from test/units/testsuite-07.issue-3171.sh rename to test/units/TEST-07-PID1.issue-3171.sh diff --git a/test/units/testsuite-07.main-PID-change.sh b/test/units/TEST-07-PID1.main-PID-change.sh similarity index 88% rename from test/units/testsuite-07.main-PID-change.sh rename to test/units/TEST-07-PID1.main-PID-change.sh index bd1144c6f2..16f3510e5e 100755 --- a/test/units/testsuite-07.main-PID-change.sh +++ b/test/units/TEST-07-PID1.main-PID-change.sh @@ -10,7 +10,7 @@ set -o pipefail # The main service PID should be the parent bash process MAINPID="${PPID:?}" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Start a test process inside of our own cgroup sleep infinity & @@ -23,41 +23,41 @@ EXTERNALPID="$(systemctl show -P MainPID test-sleep.service)" # Update our own main PID to the external test PID, this should work systemd-notify MAINPID="$EXTERNALPID" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$EXTERNALPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$EXTERNALPID" # Update our own main PID to the internal test PID, this should work, too systemd-notify MAINPID=$INTERNALPID -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$INTERNALPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$INTERNALPID" # Update it back to our own PID, this should also work systemd-notify MAINPID="$MAINPID" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Try to set it to PID 1, which it should ignore, because that's the manager systemd-notify MAINPID=1 -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Try to set it to PID 0, which is invalid and should be ignored systemd-notify MAINPID=0 -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Try to set it to a valid but non-existing PID, which should be ignored. (Note # that we set the PID to a value well above any known /proc/sys/kernel/pid_max, # which means we can be pretty sure it doesn't exist by coincidence) systemd-notify MAINPID=1073741824 -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Change it again to the external PID, without privileges this time. This should be ignored, because the PID is from outside of our cgroup and we lack privileges. systemd-notify --uid=1000 MAINPID="$EXTERNALPID" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" # Change it again to the internal PID, without privileges this time. This should work, as the process is on our cgroup, and that's enough even if we lack privileges. systemd-notify --uid=1000 MAINPID="$INTERNALPID" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$INTERNALPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$INTERNALPID" # Update it back to our own PID, this should also work systemd-notify --uid=1000 MAINPID="$MAINPID" -test "$(systemctl show -P MainPID testsuite-07.service)" -eq "$MAINPID" +test "$(systemctl show -P MainPID TEST-07-PID1.service)" -eq "$MAINPID" cat >/tmp/test-mainpid.sh <<\EOF #!/usr/bin/env bash diff --git a/test/units/testsuite-07.mount-invalid-chars.sh b/test/units/TEST-07-PID1.mount-invalid-chars.sh similarity index 100% rename from test/units/testsuite-07.mount-invalid-chars.sh rename to test/units/TEST-07-PID1.mount-invalid-chars.sh diff --git a/test/units/testsuite-07.poll-limit.sh b/test/units/TEST-07-PID1.poll-limit.sh similarity index 100% rename from test/units/testsuite-07.poll-limit.sh rename to test/units/TEST-07-PID1.poll-limit.sh diff --git a/test/units/testsuite-07.pr-31351.sh b/test/units/TEST-07-PID1.pr-31351.sh similarity index 100% rename from test/units/testsuite-07.pr-31351.sh rename to test/units/TEST-07-PID1.pr-31351.sh diff --git a/test/units/testsuite-07.private-network.sh b/test/units/TEST-07-PID1.private-network.sh similarity index 100% rename from test/units/testsuite-07.private-network.sh rename to test/units/TEST-07-PID1.private-network.sh diff --git a/test/units/testsuite-07.sh b/test/units/TEST-07-PID1.sh similarity index 100% rename from test/units/testsuite-07.sh rename to test/units/TEST-07-PID1.sh diff --git a/test/units/testsuite-07.socket-pass-fds.sh b/test/units/TEST-07-PID1.socket-pass-fds.sh similarity index 100% rename from test/units/testsuite-07.socket-pass-fds.sh rename to test/units/TEST-07-PID1.socket-pass-fds.sh diff --git a/test/units/testsuite-07.type-exec-parallel.sh b/test/units/TEST-07-PID1.type-exec-parallel.sh similarity index 100% rename from test/units/testsuite-07.type-exec-parallel.sh rename to test/units/TEST-07-PID1.type-exec-parallel.sh diff --git a/test/units/testsuite-08.sh b/test/units/TEST-08-INITRD.sh similarity index 100% rename from test/units/testsuite-08.sh rename to test/units/TEST-08-INITRD.sh diff --git a/test/units/testsuite-09.journal.sh b/test/units/TEST-09-REBOOT.journal.sh similarity index 100% rename from test/units/testsuite-09.journal.sh rename to test/units/TEST-09-REBOOT.journal.sh diff --git a/test/units/testsuite-09.sh b/test/units/TEST-09-REBOOT.sh similarity index 100% rename from test/units/testsuite-09.sh rename to test/units/TEST-09-REBOOT.sh diff --git a/test/units/testsuite-13.importctl.sh b/test/units/TEST-13-NSPAWN.importctl.sh similarity index 100% rename from test/units/testsuite-13.importctl.sh rename to test/units/TEST-13-NSPAWN.importctl.sh diff --git a/test/units/testsuite-13.machinectl.sh b/test/units/TEST-13-NSPAWN.machinectl.sh similarity index 100% rename from test/units/testsuite-13.machinectl.sh rename to test/units/TEST-13-NSPAWN.machinectl.sh diff --git a/test/units/testsuite-13.nspawn-oci.sh b/test/units/TEST-13-NSPAWN.nspawn-oci.sh similarity index 99% rename from test/units/testsuite-13.nspawn-oci.sh rename to test/units/TEST-13-NSPAWN.nspawn-oci.sh index b8a76fa172..65dcc96b59 100755 --- a/test/units/testsuite-13.nspawn-oci.sh +++ b/test/units/TEST-13-NSPAWN.nspawn-oci.sh @@ -34,7 +34,7 @@ NETNS="$(mktemp /var/tmp/netns.XXX)" mount --bind /proc/self/ns/net "$NETNS" TMPDIR="$(mktemp -d)" touch "$TMPDIR/hello" -OCI="$(mktemp -d /var/lib/machines/testsuite-13.oci-bundle.XXX)" +OCI="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.oci-bundle.XXX)" create_dummy_container "$OCI/rootfs" mkdir -p "$OCI/rootfs/opt/var" mkdir -p "$OCI/rootfs/opt/readonly" diff --git a/test/units/testsuite-13.nspawn.sh b/test/units/TEST-13-NSPAWN.nspawn.sh similarity index 96% rename from test/units/testsuite-13.nspawn.sh rename to test/units/TEST-13-NSPAWN.nspawn.sh index 026ed23fcd..7901e9877b 100755 --- a/test/units/testsuite-13.nspawn.sh +++ b/test/units/TEST-13-NSPAWN.nspawn.sh @@ -82,7 +82,7 @@ testcase_sanity() { template="$(mktemp -d /tmp/nspawn-template.XXX)" create_dummy_container "$template" # Create a simple image from the just created container template - image="$(mktemp /var/lib/machines/testsuite-13.image-XXX.img)" + image="$(mktemp /var/lib/machines/TEST-13-NSPAWN.image-XXX.img)" dd if=/dev/zero of="$image" bs=1M count=256 mkfs.ext4 "$image" mkdir -p /mnt @@ -94,7 +94,7 @@ testcase_sanity() { systemd-nspawn --version # --template= - root="$(mktemp -u -d /var/lib/machines/testsuite-13.sanity.XXX)" + root="$(mktemp -u -d /var/lib/machines/TEST-13-NSPAWN.sanity.XXX)" coverage_create_nspawn_dropin "$root" (! systemd-nspawn --directory="$root" bash -xec 'echo hello') # Initialize $root from $template (the $root directory must not exist, hence @@ -342,7 +342,7 @@ testcase_nspawn_settings() { local root container dev private_users wlan_names mkdir -p /run/systemd/nspawn - root="$(mktemp -d /var/lib/machines/testsuite-13.nspawn-settings.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.nspawn-settings.XXX)" container="$(basename "$root")" create_dummy_container "$root" rm -f "/etc/systemd/nspawn/$container.nspawn" @@ -505,7 +505,7 @@ bind_user_cleanup() { testcase_bind_user() { local root - root="$(mktemp -d /var/lib/machines/testsuite-13.bind-user.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.bind-user.XXX)" create_dummy_container "$root" useradd --create-home --user-group nspawn-bind-user-1 useradd --create-home --user-group nspawn-bind-user-2 @@ -554,7 +554,7 @@ testcase_bind_tmp_path() { # https://github.com/systemd/systemd/issues/4789 local root - root="$(mktemp -d /var/lib/machines/testsuite-13.bind-tmp-path.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.bind-tmp-path.XXX)" create_dummy_container "$root" : >/tmp/bind systemd-nspawn --register=no \ @@ -569,7 +569,7 @@ testcase_norbind() { # https://github.com/systemd/systemd/issues/13170 local root - root="$(mktemp -d /var/lib/machines/testsuite-13.norbind-path.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.norbind-path.XXX)" mkdir -p /tmp/binddir/subdir echo -n "outer" >/tmp/binddir/subdir/file mount -t tmpfs tmpfs /tmp/binddir/subdir @@ -596,7 +596,7 @@ testcase_rootidmap() { local root cmd permissions local owner=1000 - root="$(mktemp -d /var/lib/machines/testsuite-13.rootidmap-path.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.rootidmap-path.XXX)" # Create ext4 image, as ext4 supports idmapped-mounts. mkdir -p /tmp/rootidmap/bind dd if=/dev/zero of=/tmp/rootidmap/ext4.img bs=4k count=2048 @@ -640,7 +640,7 @@ testcase_owneridmap() { local root cmd permissions local owner=1000 - root="$(mktemp -d /var/lib/machines/testsuite-13.owneridmap-path.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.owneridmap-path.XXX)" # Create ext4 image, as ext4 supports idmapped-mounts. mkdir -p /tmp/owneridmap/bind dd if=/dev/zero of=/tmp/owneridmap/ext4.img bs=4k count=2048 @@ -704,7 +704,7 @@ testcase_notification_socket() { local root local cmd='echo a | nc -U -u -w 1 /run/host/notify' - root="$(mktemp -d /var/lib/machines/testsuite-13.check_notification_socket.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.check_notification_socket.XXX)" create_dummy_container "$root" systemd-nspawn --register=no --directory="$root" bash -x -c "$cmd" @@ -716,7 +716,7 @@ testcase_notification_socket() { testcase_os_release() { local root entrypoint os_release_source - root="$(mktemp -d /var/lib/machines/testsuite-13.os-release.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.os-release.XXX)" create_dummy_container "$root" entrypoint="$root/entrypoint.sh" cat >"$entrypoint" <<\EOF @@ -758,7 +758,7 @@ testcase_machinectl_bind() { local service_path service_name root container_name ec local cmd='for i in $(seq 1 20); do if test -f /tmp/marker; then exit 0; fi; sleep .5; done; exit 1;' - root="$(mktemp -d /var/lib/machines/testsuite-13.machinectl-bind.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.machinectl-bind.XXX)" create_dummy_container "$root" container_name="$(basename "$root")" @@ -793,7 +793,7 @@ testcase_selinux() { local root - root="$(mktemp -d /var/lib/machines/testsuite-13.selinux.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.selinux.XXX)" create_dummy_container "$root" chcon -R -t container_t "$root" @@ -810,7 +810,7 @@ testcase_ephemeral_config() { # https://github.com/systemd/systemd/issues/13297 local root container_name - root="$(mktemp -d /var/lib/machines/testsuite-13.ephemeral-config.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.ephemeral-config.XXX)" create_dummy_container "$root" container_name="$(basename "$root")" @@ -853,7 +853,7 @@ matrix_run_one() { return 0 fi - root="$(mktemp -d "/var/lib/machines/testsuite-13.unified-$1-cgns-$2-api-vfs-writable-$3.XXX")" + root="$(mktemp -d "/var/lib/machines/TEST-13-NSPAWN.unified-$1-cgns-$2-api-vfs-writable-$3.XXX")" create_dummy_container "$root" SYSTEMD_NSPAWN_UNIFIED_HIERARCHY="$cgroupsv2" SYSTEMD_NSPAWN_USE_CGNS="$use_cgns" SYSTEMD_NSPAWN_API_VFS_WRITABLE="$api_vfs_writable" \ @@ -941,8 +941,8 @@ testcase_check_os_release() { # https://github.com/systemd/systemd/issues/29185 local base common_opts root - base="$(mktemp -d /var/lib/machines/testsuite-13.check_os_release_base.XXX)" - root="$(mktemp -d /var/lib/machines/testsuite-13.check_os_release.XXX)" + base="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.check_os_release_base.XXX)" + root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.check_os_release.XXX)" create_dummy_container "$base" cp -d "$base"/{bin,sbin,lib,lib64} "$root/" common_opts=( diff --git a/test/units/testsuite-13.nss-mymachines.sh b/test/units/TEST-13-NSPAWN.nss-mymachines.sh similarity index 100% rename from test/units/testsuite-13.nss-mymachines.sh rename to test/units/TEST-13-NSPAWN.nss-mymachines.sh diff --git a/test/units/testsuite-13.sh b/test/units/TEST-13-NSPAWN.sh similarity index 100% rename from test/units/testsuite-13.sh rename to test/units/TEST-13-NSPAWN.sh diff --git a/test/units/testsuite-15.sh b/test/units/TEST-15-DROPIN.sh similarity index 98% rename from test/units/testsuite-15.sh rename to test/units/TEST-15-DROPIN.sh index 7143a1597a..f5bd8d8af4 100755 --- a/test/units/testsuite-15.sh +++ b/test/units/TEST-15-DROPIN.sh @@ -694,15 +694,15 @@ testcase_symlink_dropin_directory() { echo "Testing symlink drop-in directory..." create_services test15-a rmdir /{etc,run,usr/lib}/systemd/system/test15-a.service.d - mkdir -p /tmp/testsuite-15-test15-a-dropin-directory - ln -s /tmp/testsuite-15-test15-a-dropin-directory /etc/systemd/system/test15-a.service.d - cat >/tmp/testsuite-15-test15-a-dropin-directory/override.conf </tmp/TEST-15-DROPIN-test15-a-dropin-directory/override.conf </tmp/TEST-23-UNIT-FILE.counter + +if [ "$counter" -eq 5 ] ; then + systemctl kill --kill-whom=main -sUSR1 TEST-23-UNIT-FILE.service +fi + +exec sleep 1.5 diff --git a/test/units/testsuite-23.ExecReload.sh b/test/units/TEST-23-UNIT-FILE.ExecReload.sh similarity index 100% rename from test/units/testsuite-23.ExecReload.sh rename to test/units/TEST-23-UNIT-FILE.ExecReload.sh diff --git a/test/units/testsuite-23.ExecStopPost.sh b/test/units/TEST-23-UNIT-FILE.ExecStopPost.sh similarity index 100% rename from test/units/testsuite-23.ExecStopPost.sh rename to test/units/TEST-23-UNIT-FILE.ExecStopPost.sh diff --git a/test/units/TEST-23-UNIT-FILE.JoinsNamespaceOf.sh b/test/units/TEST-23-UNIT-FILE.JoinsNamespaceOf.sh new file mode 100755 index 0000000000..4fd68d8b84 --- /dev/null +++ b/test/units/TEST-23-UNIT-FILE.JoinsNamespaceOf.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later + +set -eux +set -o pipefail + +# Test JoinsNamespaceOf= with PrivateTmp=yes + +systemd-analyze log-level debug +systemd-analyze log-target journal + +# simple case +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-1.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-2.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-3.service +systemctl stop TEST-23-UNIT-FILE-joins-namespace-of-1.service + +# inverse dependency +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-4.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-5.service +systemctl stop TEST-23-UNIT-FILE-joins-namespace-of-4.service + +# transitive dependency +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-6.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-7.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-8.service +systemctl start TEST-23-UNIT-FILE-joins-namespace-of-9.service +systemctl stop TEST-23-UNIT-FILE-joins-namespace-of-6.service +systemctl stop TEST-23-UNIT-FILE-joins-namespace-of-8.service + +systemd-analyze log-level info diff --git a/test/units/testsuite-23.RuntimeDirectoryPreserve.sh b/test/units/TEST-23-UNIT-FILE.RuntimeDirectoryPreserve.sh similarity index 100% rename from test/units/testsuite-23.RuntimeDirectoryPreserve.sh rename to test/units/TEST-23-UNIT-FILE.RuntimeDirectoryPreserve.sh diff --git a/test/units/testsuite-23.StandardOutput.sh b/test/units/TEST-23-UNIT-FILE.StandardOutput.sh similarity index 80% rename from test/units/testsuite-23.StandardOutput.sh rename to test/units/TEST-23-UNIT-FILE.StandardOutput.sh index 50b9ac2a2b..a951b13b46 100755 --- a/test/units/testsuite-23.StandardOutput.sh +++ b/test/units/TEST-23-UNIT-FILE.StandardOutput.sh @@ -7,7 +7,7 @@ set -o pipefail systemd-analyze log-level debug -systemd-run --wait --unit=testsuite-23-standard-output-one \ +systemd-run --wait --unit=TEST-23-UNIT-FILE-standard-output-one \ -p StandardOutput=file:/tmp/stdout \ -p StandardError=file:/tmp/stderr \ -p Type=exec \ @@ -19,7 +19,7 @@ cmp /tmp/stderr <"/run/systemd/system/$UNIT_NAME" </run/TEST-23-UNIT-FILE-marker-fixed +mkdir /run/inaccessible + +systemctl start TEST-23-UNIT-FILE-namespaced.service + +# Ensure that inaccessible paths aren't bypassed by the runtime setup, +(! systemctl bind --mkdir TEST-23-UNIT-FILE-namespaced.service /run/TEST-23-UNIT-FILE-marker-fixed /run/inaccessible/testfile-marker-fixed) + +echo "MARKER_WRONG" >/run/TEST-23-UNIT-FILE-marker-wrong +echo "MARKER_RUNTIME" >/run/TEST-23-UNIT-FILE-marker-runtime + +# Mount twice to exercise mount-beneath (on kernel 6.5+, on older kernels it will just overmount) +systemctl bind --mkdir TEST-23-UNIT-FILE-namespaced.service /run/TEST-23-UNIT-FILE-marker-wrong /tmp/testfile-marker-runtime +test "$(systemctl show -P SubState TEST-23-UNIT-FILE-namespaced.service)" = "running" +systemctl bind --mkdir TEST-23-UNIT-FILE-namespaced.service /run/TEST-23-UNIT-FILE-marker-runtime /tmp/testfile-marker-runtime + +timeout 10 bash -xec 'while [[ "$(systemctl show -P SubState TEST-23-UNIT-FILE-namespaced.service)" == running ]]; do sleep .5; done' +systemctl is-active TEST-23-UNIT-FILE-namespaced.service + +# Now test that systemctl bind fails when attempted on a non-namespaced unit +systemctl start TEST-23-UNIT-FILE-non-namespaced.service + +(! systemctl bind --mkdir TEST-23-UNIT-FILE-non-namespaced.service /run/TEST-23-UNIT-FILE-marker-runtime /tmp/testfile-marker-runtime) + +timeout 10 bash -xec 'while [[ "$(systemctl show -P SubState TEST-23-UNIT-FILE-non-namespaced.service)" == running ]]; do sleep .5; done' +(! systemctl is-active TEST-23-UNIT-FILE-non-namespaced.service) diff --git a/test/units/testsuite-23.sh b/test/units/TEST-23-UNIT-FILE.sh similarity index 100% rename from test/units/testsuite-23.sh rename to test/units/TEST-23-UNIT-FILE.sh diff --git a/test/units/TEST-23-UNIT-FILE.start-stop-no-reload.sh b/test/units/TEST-23-UNIT-FILE.start-stop-no-reload.sh new file mode 100755 index 0000000000..61a6592cb6 --- /dev/null +++ b/test/units/TEST-23-UNIT-FILE.start-stop-no-reload.sh @@ -0,0 +1,93 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: LGPL-2.1-or-later +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh +set -eux +set -o pipefail + +# Test start & stop operations without daemon-reload + +at_exit() { + set +e + + rm -f /run/systemd/system/TEST-23-UNIT-FILE-no-reload.{service,target} +} + +trap at_exit EXIT + +cat >/run/systemd/system/TEST-23-UNIT-FILE-no-reload.target </run/systemd/system/TEST-23-UNIT-FILE-no-reload.service </run/systemd/system/TEST-23-UNIT-FILE-no-reload.service </run/systemd/system/TEST-23-UNIT-FILE-no-reload.target </run/systemd/system/TEST-23-UNIT-FILE-no-reload.service </run/systemd/system/testsuite-55-testbloat.service.d/override.conf </run/systemd/system/TEST-55-OOMD-testbloat.service.d/override.conf </dev/null && echo thisshouldnotbehere; done" diff --git a/test/units/testsuite-66.sh b/test/units/TEST-66-DEVICE-ISOLATION.sh similarity index 64% rename from test/units/testsuite-66.sh rename to test/units/TEST-66-DEVICE-ISOLATION.sh index 147335a7af..ccdfcb274c 100755 --- a/test/units/testsuite-66.sh +++ b/test/units/TEST-66-DEVICE-ISOLATION.sh @@ -3,11 +3,11 @@ set -eux set -o pipefail -RESULTS_FILE=/tmp/testsuite66serviceresults +RESULTS_FILE=/tmp/TEST-66-DEVICE-ISOLATION.serviceresults systemd-analyze log-level debug -systemctl start testsuite-66-deviceisolation.service +systemctl start TEST-66-DEVICE-ISOLATION-device-isolation.service sleep 5 grep -q "Operation not permitted" "$RESULTS_FILE" @@ -15,7 +15,7 @@ grep -q "Operation not permitted" "$RESULTS_FILE" systemctl daemon-reload systemctl daemon-reexec -systemctl stop testsuite-66-deviceisolation.service +systemctl stop TEST-66-DEVICE-ISOLATION-device-isolation.service grep -q "thisshouldnotbehere" "$RESULTS_FILE" && exit 42 diff --git a/test/units/testsuite-67.sh b/test/units/TEST-67-INTEGRITY.sh similarity index 100% rename from test/units/testsuite-67.sh rename to test/units/TEST-67-INTEGRITY.sh diff --git a/test/units/testsuite-68.sh b/test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh similarity index 100% rename from test/units/testsuite-68.sh rename to test/units/TEST-68-PROPAGATE-EXIT-STATUS.sh diff --git a/test/units/testsuite-70.creds.sh b/test/units/TEST-70-TPM2.creds.sh similarity index 100% rename from test/units/testsuite-70.creds.sh rename to test/units/TEST-70-TPM2.creds.sh diff --git a/test/units/testsuite-70.cryptenroll.sh b/test/units/TEST-70-TPM2.cryptenroll.sh similarity index 100% rename from test/units/testsuite-70.cryptenroll.sh rename to test/units/TEST-70-TPM2.cryptenroll.sh diff --git a/test/units/testsuite-70.cryptsetup.sh b/test/units/TEST-70-TPM2.cryptsetup.sh similarity index 100% rename from test/units/testsuite-70.cryptsetup.sh rename to test/units/TEST-70-TPM2.cryptsetup.sh diff --git a/test/units/testsuite-70.measure.sh b/test/units/TEST-70-TPM2.measure.sh similarity index 100% rename from test/units/testsuite-70.measure.sh rename to test/units/TEST-70-TPM2.measure.sh diff --git a/test/units/testsuite-70.pcrextend.sh b/test/units/TEST-70-TPM2.pcrextend.sh similarity index 100% rename from test/units/testsuite-70.pcrextend.sh rename to test/units/TEST-70-TPM2.pcrextend.sh diff --git a/test/units/testsuite-70.pcrlock.sh b/test/units/TEST-70-TPM2.pcrlock.sh similarity index 100% rename from test/units/testsuite-70.pcrlock.sh rename to test/units/TEST-70-TPM2.pcrlock.sh diff --git a/test/units/testsuite-70.sh b/test/units/TEST-70-TPM2.sh similarity index 100% rename from test/units/testsuite-70.sh rename to test/units/TEST-70-TPM2.sh diff --git a/test/units/testsuite-70.tpm2-setup.sh b/test/units/TEST-70-TPM2.tpm2-setup.sh similarity index 100% rename from test/units/testsuite-70.tpm2-setup.sh rename to test/units/TEST-70-TPM2.tpm2-setup.sh diff --git a/test/units/testsuite-71.sh b/test/units/TEST-71-HOSTNAME.sh similarity index 100% rename from test/units/testsuite-71.sh rename to test/units/TEST-71-HOSTNAME.sh diff --git a/test/units/testsuite-72.sh b/test/units/TEST-72-SYSUPDATE.sh similarity index 100% rename from test/units/testsuite-72.sh rename to test/units/TEST-72-SYSUPDATE.sh diff --git a/test/units/testsuite-73.sh b/test/units/TEST-73-LOCALE.sh similarity index 100% rename from test/units/testsuite-73.sh rename to test/units/TEST-73-LOCALE.sh diff --git a/test/units/testsuite-74.battery-check.sh b/test/units/TEST-74-AUX-UTILS.battery-check.sh similarity index 100% rename from test/units/testsuite-74.battery-check.sh rename to test/units/TEST-74-AUX-UTILS.battery-check.sh diff --git a/test/units/testsuite-74.bootctl.sh b/test/units/TEST-74-AUX-UTILS.bootctl.sh similarity index 100% rename from test/units/testsuite-74.bootctl.sh rename to test/units/TEST-74-AUX-UTILS.bootctl.sh diff --git a/test/units/testsuite-74.busctl.sh b/test/units/TEST-74-AUX-UTILS.busctl.sh similarity index 100% rename from test/units/testsuite-74.busctl.sh rename to test/units/TEST-74-AUX-UTILS.busctl.sh diff --git a/test/units/testsuite-74.capsule.sh b/test/units/TEST-74-AUX-UTILS.capsule.sh similarity index 100% rename from test/units/testsuite-74.capsule.sh rename to test/units/TEST-74-AUX-UTILS.capsule.sh diff --git a/test/units/testsuite-74.cgls.sh b/test/units/TEST-74-AUX-UTILS.cgls.sh similarity index 100% rename from test/units/testsuite-74.cgls.sh rename to test/units/TEST-74-AUX-UTILS.cgls.sh diff --git a/test/units/testsuite-74.cgtop.sh b/test/units/TEST-74-AUX-UTILS.cgtop.sh similarity index 100% rename from test/units/testsuite-74.cgtop.sh rename to test/units/TEST-74-AUX-UTILS.cgtop.sh diff --git a/test/units/testsuite-74.coredump.sh b/test/units/TEST-74-AUX-UTILS.coredump.sh similarity index 99% rename from test/units/testsuite-74.coredump.sh rename to test/units/TEST-74-AUX-UTILS.coredump.sh index f48607c0db..3f3571639e 100755 --- a/test/units/testsuite-74.coredump.sh +++ b/test/units/TEST-74-AUX-UTILS.coredump.sh @@ -79,7 +79,7 @@ timeout 30 bash -c "while [[ \$(coredumpctl list -q --no-legend $CORE_TEST_BIN | if cgroupfs_supports_user_xattrs; then # Make sure we can forward crashes back to containers - CONTAINER="testsuite-74-container" + CONTAINER="TEST-74-AUX-UTILS-container" mkdir -p "/var/lib/machines/$CONTAINER" mkdir -p "/run/systemd/system/systemd-nspawn@$CONTAINER.service.d" diff --git a/test/units/testsuite-74.delta.sh b/test/units/TEST-74-AUX-UTILS.delta.sh similarity index 100% rename from test/units/testsuite-74.delta.sh rename to test/units/TEST-74-AUX-UTILS.delta.sh diff --git a/test/units/testsuite-74.escape.sh b/test/units/TEST-74-AUX-UTILS.escape.sh similarity index 100% rename from test/units/testsuite-74.escape.sh rename to test/units/TEST-74-AUX-UTILS.escape.sh diff --git a/test/units/testsuite-74.firstboot.sh b/test/units/TEST-74-AUX-UTILS.firstboot.sh similarity index 100% rename from test/units/testsuite-74.firstboot.sh rename to test/units/TEST-74-AUX-UTILS.firstboot.sh diff --git a/test/units/testsuite-74.id128.sh b/test/units/TEST-74-AUX-UTILS.id128.sh similarity index 100% rename from test/units/testsuite-74.id128.sh rename to test/units/TEST-74-AUX-UTILS.id128.sh diff --git a/test/units/testsuite-74.machine-id-setup.sh b/test/units/TEST-74-AUX-UTILS.machine-id-setup.sh similarity index 100% rename from test/units/testsuite-74.machine-id-setup.sh rename to test/units/TEST-74-AUX-UTILS.machine-id-setup.sh diff --git a/test/units/testsuite-74.modules-load.sh b/test/units/TEST-74-AUX-UTILS.modules-load.sh similarity index 100% rename from test/units/testsuite-74.modules-load.sh rename to test/units/TEST-74-AUX-UTILS.modules-load.sh diff --git a/test/units/testsuite-74.mount.sh b/test/units/TEST-74-AUX-UTILS.mount.sh similarity index 100% rename from test/units/testsuite-74.mount.sh rename to test/units/TEST-74-AUX-UTILS.mount.sh diff --git a/test/units/testsuite-74.network-generator.sh b/test/units/TEST-74-AUX-UTILS.network-generator.sh similarity index 100% rename from test/units/testsuite-74.network-generator.sh rename to test/units/TEST-74-AUX-UTILS.network-generator.sh diff --git a/test/units/testsuite-74.networkctl.sh b/test/units/TEST-74-AUX-UTILS.networkctl.sh similarity index 100% rename from test/units/testsuite-74.networkctl.sh rename to test/units/TEST-74-AUX-UTILS.networkctl.sh diff --git a/test/units/testsuite-74.path.sh b/test/units/TEST-74-AUX-UTILS.path.sh similarity index 100% rename from test/units/testsuite-74.path.sh rename to test/units/TEST-74-AUX-UTILS.path.sh diff --git a/test/units/testsuite-74.pstore.sh b/test/units/TEST-74-AUX-UTILS.pstore.sh similarity index 100% rename from test/units/testsuite-74.pstore.sh rename to test/units/TEST-74-AUX-UTILS.pstore.sh diff --git a/test/units/testsuite-74.run.sh b/test/units/TEST-74-AUX-UTILS.run.sh similarity index 100% rename from test/units/testsuite-74.run.sh rename to test/units/TEST-74-AUX-UTILS.run.sh diff --git a/test/units/testsuite-74.sh b/test/units/TEST-74-AUX-UTILS.sh similarity index 100% rename from test/units/testsuite-74.sh rename to test/units/TEST-74-AUX-UTILS.sh diff --git a/test/units/testsuite-74.socket.sh b/test/units/TEST-74-AUX-UTILS.socket.sh similarity index 100% rename from test/units/testsuite-74.socket.sh rename to test/units/TEST-74-AUX-UTILS.socket.sh diff --git a/test/units/testsuite-74.ssh.sh b/test/units/TEST-74-AUX-UTILS.ssh.sh similarity index 100% rename from test/units/testsuite-74.ssh.sh rename to test/units/TEST-74-AUX-UTILS.ssh.sh diff --git a/test/units/testsuite-74.varlinkctl.sh b/test/units/TEST-74-AUX-UTILS.varlinkctl.sh similarity index 100% rename from test/units/testsuite-74.varlinkctl.sh rename to test/units/TEST-74-AUX-UTILS.varlinkctl.sh diff --git a/test/units/testsuite-74.vpick.sh b/test/units/TEST-74-AUX-UTILS.vpick.sh similarity index 100% rename from test/units/testsuite-74.vpick.sh rename to test/units/TEST-74-AUX-UTILS.vpick.sh diff --git a/test/units/testsuite-75.sh b/test/units/TEST-75-RESOLVED.sh similarity index 100% rename from test/units/testsuite-75.sh rename to test/units/TEST-75-RESOLVED.sh diff --git a/test/units/testsuite-76.sh b/test/units/TEST-76-SYSCTL.sh similarity index 100% rename from test/units/testsuite-76.sh rename to test/units/TEST-76-SYSCTL.sh diff --git a/test/units/testsuite-78.sh b/test/units/TEST-78-SIGQUEUE.sh similarity index 100% rename from test/units/testsuite-78.sh rename to test/units/TEST-78-SIGQUEUE.sh diff --git a/test/units/testsuite-79.sh b/test/units/TEST-79-MEMPRESS.sh similarity index 94% rename from test/units/testsuite-79.sh rename to test/units/TEST-79-MEMPRESS.sh index 205f7f3da3..4ce73d4c29 100755 --- a/test/units/testsuite-79.sh +++ b/test/units/TEST-79-MEMPRESS.sh @@ -15,7 +15,7 @@ fi systemd-analyze log-level debug -CGROUP=/sys/fs/cgroup/"$(systemctl show testsuite-79.service -P ControlGroup)" +CGROUP=/sys/fs/cgroup/"$(systemctl show TEST-79-MEMPRESS.service -P ControlGroup)" test -d "$CGROUP" if ! test -f "$CGROUP"/memory.pressure ; then diff --git a/test/units/testsuite-80.sh b/test/units/TEST-80-NOTIFYACCESS.sh similarity index 100% rename from test/units/testsuite-80.sh rename to test/units/TEST-80-NOTIFYACCESS.sh diff --git a/test/units/testsuite-81.debug-generator.sh b/test/units/TEST-81-GENERATORS.debug-generator.sh similarity index 100% rename from test/units/testsuite-81.debug-generator.sh rename to test/units/TEST-81-GENERATORS.debug-generator.sh diff --git a/test/units/testsuite-81.environment-d-generator.sh b/test/units/TEST-81-GENERATORS.environment-d-generator.sh similarity index 100% rename from test/units/testsuite-81.environment-d-generator.sh rename to test/units/TEST-81-GENERATORS.environment-d-generator.sh diff --git a/test/units/testsuite-81.fstab-generator.sh b/test/units/TEST-81-GENERATORS.fstab-generator.sh similarity index 100% rename from test/units/testsuite-81.fstab-generator.sh rename to test/units/TEST-81-GENERATORS.fstab-generator.sh diff --git a/test/units/testsuite-81.getty-generator.sh b/test/units/TEST-81-GENERATORS.getty-generator.sh similarity index 100% rename from test/units/testsuite-81.getty-generator.sh rename to test/units/TEST-81-GENERATORS.getty-generator.sh diff --git a/test/units/testsuite-81.run-generator.sh b/test/units/TEST-81-GENERATORS.run-generator.sh similarity index 100% rename from test/units/testsuite-81.run-generator.sh rename to test/units/TEST-81-GENERATORS.run-generator.sh diff --git a/test/units/testsuite-81.sh b/test/units/TEST-81-GENERATORS.sh similarity index 100% rename from test/units/testsuite-81.sh rename to test/units/TEST-81-GENERATORS.sh diff --git a/test/units/testsuite-81.system-update-generator.sh b/test/units/TEST-81-GENERATORS.system-update-generator.sh similarity index 100% rename from test/units/testsuite-81.system-update-generator.sh rename to test/units/TEST-81-GENERATORS.system-update-generator.sh diff --git a/test/units/testsuite-82.sh b/test/units/TEST-82-SOFTREBOOT.sh similarity index 79% rename from test/units/testsuite-82.sh rename to test/units/TEST-82-SOFTREBOOT.sh index 9747602d19..7a1d8a9221 100755 --- a/test/units/testsuite-82.sh +++ b/test/units/TEST-82-SOFTREBOOT.sh @@ -23,13 +23,13 @@ systemd-analyze log-level debug export SYSTEMD_LOG_LEVEL=debug -if [ -f /run/testsuite82.touch3 ]; then +if [ -f /run/TEST-82-SOFTREBOOT.touch3 ]; then echo "This is the fourth boot!" systemd-notify --status="Fourth Boot" test "$(busctl -j get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager SoftRebootsCount | jq -r '.data')" -eq 3 - rm /run/testsuite82.touch3 + rm /run/TEST-82-SOFTREBOOT.touch3 mount rmdir /original-root /run/nextroot @@ -39,10 +39,10 @@ if [ -f /run/testsuite82.touch3 ]; then test "$x" = "oinkoink" # Check that the surviving services are still around - test "$(systemctl show -P ActiveState testsuite-82-survive.service)" = "active" - test "$(systemctl show -P ActiveState testsuite-82-survive-argv.service)" = "active" - test "$(systemctl show -P ActiveState testsuite-82-nosurvive-sigterm.service)" != "active" - test "$(systemctl show -P ActiveState testsuite-82-nosurvive.service)" != "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-survive.service)" = "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-survive-argv.service)" = "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-nosurvive-sigterm.service)" != "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-nosurvive.service)" != "active" # Check journals journalctl -o short-monotonic --no-hostname --grep '(will soft-reboot|KILL|corrupt)' @@ -50,13 +50,13 @@ if [ -f /run/testsuite82.touch3 ]; then # All succeeded, exit cleanly now -elif [ -f /run/testsuite82.touch2 ]; then +elif [ -f /run/TEST-82-SOFTREBOOT.touch2 ]; then echo "This is the third boot!" systemd-notify --status="Third Boot" test "$(busctl -j get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager SoftRebootsCount | jq -r '.data')" -eq 2 - rm /run/testsuite82.touch2 + rm /run/TEST-82-SOFTREBOOT.touch2 # Check that the fdstore entry still exists test "$LISTEN_FDS" -eq 2 @@ -70,10 +70,10 @@ elif [ -f /run/testsuite82.touch2 ]; then rm "$T" # Check that the surviving services are still around - test "$(systemctl show -P ActiveState testsuite-82-survive.service)" = "active" - test "$(systemctl show -P ActiveState testsuite-82-survive-argv.service)" = "active" - test "$(systemctl show -P ActiveState testsuite-82-nosurvive-sigterm.service)" != "active" - test "$(systemctl show -P ActiveState testsuite-82-nosurvive.service)" != "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-survive.service)" = "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-survive-argv.service)" = "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-nosurvive-sigterm.service)" != "active" + test "$(systemctl show -P ActiveState TEST-82-SOFTREBOOT-nosurvive.service)" != "active" # Test that we really are in the new overlayfs root fs read -r x /sys/fs/selinux/enforce; fixfiles -f -F relabel; rm /.autorelabel; systemctl --force reboot' +ExecStart=sh -xec 'echo 0 >/sys/fs/selinux/enforce; fixfiles -f -F relabel; rm /.autorelabel;' Type=oneshot TimeoutSec=infinity -RemainAfterExit=yes [Install] -WantedBy=multi-user.target +WantedBy=basic.target diff --git a/test/units/firstboot-autorelabel.service b/test/units/firstboot-autorelabel.service deleted file mode 100644 index b69dcf72a3..0000000000 --- a/test/units/firstboot-autorelabel.service +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Activate relabelling on firstboot only -DefaultDependencies=no -Wants=first-boot-complete.target -Requires=local-fs.target -After=local-fs.target -Conflicts=shutdown.target -Before=shutdown.target -Before=first-boot-complete.target sysinit.target autorelabel.service -ConditionPathIsReadWrite=/etc -ConditionFirstBoot=yes - -[Service] -ExecStart=touch /.autorelabel -Type=oneshot -RemainAfterExit=yes - -[Install] -WantedBy=sysinit.target diff --git a/test/units/test-control.sh b/test/units/test-control.sh index 0a1611b80a..4cede74d50 100644 --- a/test/units/test-control.sh +++ b/test/units/test-control.sh @@ -107,7 +107,7 @@ run_subtests_with_signals() { _show_summary } -# Run all subtests (i.e. files named as testsuite-..sh) +# Run all subtests (i.e. files named as $TESTNAME..sh) run_subtests() { local subtests=("${0%.sh}".*.sh) local subtest diff --git a/test/units/testsuite-01.service b/test/units/testsuite-01.service deleted file mode 100644 index 9074e0968f..0000000000 --- a/test/units/testsuite-01.service +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-01-BASIC -After=multi-user.target -Wants=systemd-resolved.service systemd-networkd.service - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-02.service b/test/units/testsuite-02.service deleted file mode 100644 index dea2c4f501..0000000000 --- a/test/units/testsuite-02.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-02-UNITTESTS - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-03.service b/test/units/testsuite-03.service deleted file mode 100644 index 836f9621de..0000000000 --- a/test/units/testsuite-03.service +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-03-JOBS -After=multi-user.target - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-04.service b/test/units/testsuite-04.service deleted file mode 100644 index 63a010417e..0000000000 --- a/test/units/testsuite-04.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-04-JOURNAL - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-05.service b/test/units/testsuite-05.service deleted file mode 100644 index cf32accb8c..0000000000 --- a/test/units/testsuite-05.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-05-LIMITS - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-06.service b/test/units/testsuite-06.service deleted file mode 100644 index c4c1d87fed..0000000000 --- a/test/units/testsuite-06.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-06-SELINUX - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-08.service b/test/units/testsuite-08.service deleted file mode 100644 index 2db35cf5b0..0000000000 --- a/test/units/testsuite-08.service +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-08-INITRD -After=multi-user.target - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-09.service b/test/units/testsuite-09.service deleted file mode 100644 index 6c957ecbd1..0000000000 --- a/test/units/testsuite-09.service +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-09-REBOOT -After=multi-user.target - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-13.service b/test/units/testsuite-13.service deleted file mode 100644 index 95c9a02fe1..0000000000 --- a/test/units/testsuite-13.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-13-NSPAWN - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-15.service b/test/units/testsuite-15.service deleted file mode 100644 index 10af93f0f7..0000000000 --- a/test/units/testsuite-15.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-15-DROPIN - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-17.service b/test/units/testsuite-17.service deleted file mode 100644 index d218d7266f..0000000000 --- a/test/units/testsuite-17.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-17-UDEV - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-18.service b/test/units/testsuite-18.service deleted file mode 100644 index 16d90a12c2..0000000000 --- a/test/units/testsuite-18.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-18-FAILUREACTION - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-19.service b/test/units/testsuite-19.service deleted file mode 100644 index 9ee5fc97d2..0000000000 --- a/test/units/testsuite-19.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-19-DELEGATE - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-21.service b/test/units/testsuite-21.service deleted file mode 100644 index a5f77d07b4..0000000000 --- a/test/units/testsuite-21.service +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=Fuzz our D-Bus interfaces with dfuzzer -After=dbus.service multi-user.target -Wants=dbus.service multi-user.target - -[Service] -ExecStartPre=rm -f /failed /skipped /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-22.service b/test/units/testsuite-22.service deleted file mode 100644 index a5ed660c62..0000000000 --- a/test/units/testsuite-22.service +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-22-TMPFILES -After=systemd-tmpfiles-setup.service -Before=getty-pre.target -Wants=getty-pre.target - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-23-short-lived.sh b/test/units/testsuite-23-short-lived.sh deleted file mode 100755 index 4a12c7f498..0000000000 --- a/test/units/testsuite-23-short-lived.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -set -ex - -if [ -f /tmp/testsuite-23.counter ] ; then - read -r counter < /tmp/testsuite-23.counter - counter=$((counter + 1)) -else - counter=0 -fi - -echo "$counter" >/tmp/testsuite-23.counter - -if [ "$counter" -eq 5 ] ; then - systemctl kill --kill-whom=main -sUSR1 testsuite-23.service -fi - -exec sleep 1.5 diff --git a/test/units/testsuite-23.JoinsNamespaceOf.sh b/test/units/testsuite-23.JoinsNamespaceOf.sh deleted file mode 100755 index 68ba465072..0000000000 --- a/test/units/testsuite-23.JoinsNamespaceOf.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later - -set -eux -set -o pipefail - -# Test JoinsNamespaceOf= with PrivateTmp=yes - -systemd-analyze log-level debug -systemd-analyze log-target journal - -# simple case -systemctl start testsuite-23-joins-namespace-of-1.service -systemctl start testsuite-23-joins-namespace-of-2.service -systemctl start testsuite-23-joins-namespace-of-3.service -systemctl stop testsuite-23-joins-namespace-of-1.service - -# inverse dependency -systemctl start testsuite-23-joins-namespace-of-4.service -systemctl start testsuite-23-joins-namespace-of-5.service -systemctl stop testsuite-23-joins-namespace-of-4.service - -# transitive dependency -systemctl start testsuite-23-joins-namespace-of-6.service -systemctl start testsuite-23-joins-namespace-of-7.service -systemctl start testsuite-23-joins-namespace-of-8.service -systemctl start testsuite-23-joins-namespace-of-9.service -systemctl stop testsuite-23-joins-namespace-of-6.service -systemctl stop testsuite-23-joins-namespace-of-8.service - -systemd-analyze log-level info diff --git a/test/units/testsuite-23.Upholds.sh b/test/units/testsuite-23.Upholds.sh deleted file mode 100755 index e62f9c64de..0000000000 --- a/test/units/testsuite-23.Upholds.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later - -set -eux -set -o pipefail - -# Test OnSuccess= + Uphold= + PropagatesStopTo= + BindsTo= - -systemd-analyze log-level debug -systemd-analyze log-target journal - -# Idea is this: -# 1. we start testsuite-23-success.service -# 2. which through OnSuccess= starts testsuite-23-fail.service, -# 3. which through OnFailure= starts testsuite-23-uphold.service, -# 4. which through Uphold= starts/keeps testsuite-23-short-lived.service running, -# 5. which will sleep 1s when invoked, and on the 5th invocation send us a SIGUSR1 -# 6. once we got that we finish cleanly - -sigusr1=0 -trap sigusr1=1 SIGUSR1 - -trap -p SIGUSR1 - -systemctl start testsuite-23-success.service - -while [ "$sigusr1" -eq 0 ] ; do - sleep .5 -done - -systemctl stop testsuite-23-uphold.service - -systemctl enable testsuite-23-upheldby-install.service - -# Idea is this: -# 1. we start testsuite-23-retry-uphold.service -# 2. which through Uphold= starts testsuite-23-retry-upheld.service -# 3. which through Requires= starts testsuite-23-retry-fail.service -# 4. which fails as /tmp/testsuite-23-retry-fail does not exist, so testsuite-23-retry-upheld.service -# is no longer restarted -# 5. we create /tmp/testsuite-23-retry-fail -# 6. now testsuite-23-retry-upheld.service will be restarted since upheld, and its dependency will -# be satisfied - -rm -f /tmp/testsuite-23-retry-fail -systemctl start testsuite-23-retry-uphold.service -systemctl is-active testsuite-23-upheldby-install.service - -until systemctl is-failed testsuite-23-retry-fail.service ; do - sleep .5 -done - -(! systemctl is-active testsuite-23-retry-upheld.service) - -touch /tmp/testsuite-23-retry-fail - -until systemctl is-active testsuite-23-retry-upheld.service ; do - sleep .5 -done - -systemctl stop testsuite-23-retry-uphold.service testsuite-23-retry-fail.service testsuite-23-retry-upheld.service - -# Idea is this: -# 1. we start testsuite-23-prop-stop-one.service -# 2. which through Wants=/After= pulls in testsuite-23-prop-stop-two.service as well -# 3. testsuite-23-prop-stop-one.service then sleeps indefinitely -# 4. testsuite-23-prop-stop-two.service sleeps a short time and exits -# 5. the StopPropagatedFrom= dependency between the two should ensure *both* will exit as result -# 6. an ExecStopPost= line on testsuite-23-prop-stop-one.service will send us a SIGUSR2 -# 7. once we got that we finish cleanly - -sigusr2=0 -trap sigusr2=1 SIGUSR2 - -systemctl start testsuite-23-prop-stop-one.service - -while [ "$sigusr2" -eq 0 ] ; do - sleep .5 -done - - -# Idea is this: -# 1. we start testsuite-23-binds-to.service -# 2. which through BindsTo=/After= pulls in testsuite-23-bound-by.service as well -# 3. testsuite-23-bound-by.service suddenly dies -# 4. testsuite-23-binds-to.service should then also be pulled down (it otherwise just hangs) -# 6. an ExecStopPost= line on testsuite-23-binds-to.service will send us a SIGRTMIN1+1 -# 7. once we got that we finish cleanly - -sigrtmin1=0 -trap sigrtmin1=1 SIGRTMIN+1 - -systemctl start testsuite-23-binds-to.service - -while [ "$sigrtmin1" -eq 0 ] ; do - sleep .5 -done - -systemd-analyze log-level info diff --git a/test/units/testsuite-23.runtime-bind-paths.sh b/test/units/testsuite-23.runtime-bind-paths.sh deleted file mode 100755 index 65c2dbf41d..0000000000 --- a/test/units/testsuite-23.runtime-bind-paths.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -# shellcheck disable=SC2016 -set -eux -set -o pipefail - -# Test adding new BindPaths while unit is already running - -at_exit() { - set +e - - rm -f /run/testsuite-23-marker-{fixed,runtime} - rm -fr /run/inaccessible -} - -trap at_exit EXIT - -echo "MARKER_FIXED" >/run/testsuite-23-marker-fixed -mkdir /run/inaccessible - -systemctl start testsuite-23-namespaced.service - -# Ensure that inaccessible paths aren't bypassed by the runtime setup, -(! systemctl bind --mkdir testsuite-23-namespaced.service /run/testsuite-23-marker-fixed /run/inaccessible/testfile-marker-fixed) - -echo "MARKER_WRONG" >/run/testsuite-23-marker-wrong -echo "MARKER_RUNTIME" >/run/testsuite-23-marker-runtime - -# Mount twice to exercise mount-beneath (on kernel 6.5+, on older kernels it will just overmount) -systemctl bind --mkdir testsuite-23-namespaced.service /run/testsuite-23-marker-wrong /tmp/testfile-marker-runtime -test "$(systemctl show -P SubState testsuite-23-namespaced.service)" = "running" -systemctl bind --mkdir testsuite-23-namespaced.service /run/testsuite-23-marker-runtime /tmp/testfile-marker-runtime - -timeout 10 bash -xec 'while [[ "$(systemctl show -P SubState testsuite-23-namespaced.service)" == running ]]; do sleep .5; done' -systemctl is-active testsuite-23-namespaced.service - -# Now test that systemctl bind fails when attempted on a non-namespaced unit -systemctl start testsuite-23-non-namespaced.service - -(! systemctl bind --mkdir testsuite-49-non-namespaced.service /run/testsuite-23-marker-runtime /tmp/testfile-marker-runtime) - -timeout 10 bash -xec 'while [[ "$(systemctl show -P SubState testsuite-23-non-namespaced.service)" == running ]]; do sleep .5; done' -(! systemctl is-active testsuite-23-non-namespaced.service) diff --git a/test/units/testsuite-23.service b/test/units/testsuite-23.service deleted file mode 100644 index 26f5226cd4..0000000000 --- a/test/units/testsuite-23.service +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -[Unit] -Description=TEST-23-TYPE-EXEC - -[Service] -ExecStartPre=rm -f /failed /testok -ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh -Type=oneshot diff --git a/test/units/testsuite-23.start-stop-no-reload.sh b/test/units/testsuite-23.start-stop-no-reload.sh deleted file mode 100755 index e40990bdbb..0000000000 --- a/test/units/testsuite-23.start-stop-no-reload.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LGPL-2.1-or-later -# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -# ex: ts=8 sw=4 sts=4 et filetype=sh -set -eux -set -o pipefail - -# Test start & stop operations without daemon-reload - -at_exit() { - set +e - - rm -f /run/systemd/system/testsuite-23-no-reload.{service,target} -} - -trap at_exit EXIT - -cat >/run/systemd/system/testsuite-23-no-reload.target </run/systemd/system/testsuite-23-no-reload.service </run/systemd/system/testsuite-23-no-reload.service </run/systemd/system/testsuite-23-no-reload.target </run/systemd/system/testsuite-23-no-reload.service <&2 "Missing container template, probably not running in TEST-13-NSPAWN?" exit 1 fi mkdir -p "$root" - cp -a /usr/share/testsuite-13-container-template/* "$root" + cp -a /usr/share/TEST-13-NSPAWN-container-template/* "$root" coverage_create_nspawn_dropin "$root" }