]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Make it possible to run the integration tests standalone 36868/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 26 Mar 2025 13:30:20 +0000 (14:30 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 27 Mar 2025 20:37:13 +0000 (21:37 +0100)
Currently, to run the integration tests, it's still necessary to
install various other build tools besides meson: A compiler, gperf,
libcap, ... which we want to avoid in CI systems where we receive
prebuilt systemd packages and only want to test them. Examples are
Debian's autopkgtest CI and Fedora CI. Let's make it possible for
these systems to run the integration tests without having to install
any other build dependency besides meson by extracting the logic
required to run the integration tests with meson into a separate
subdirectory and adding a standalone top-level meson.build file which
can be used to configure a meson tree with as its only purpose running
the integration tests.

Practically, we do the following:
- all the integration test directories and integration-test-wrapper.py
  are moved from test/ to test/integration-test/.
- All the installation logic is kept out of test/integration-test/ or
  any of its subdirectories and moved into test/meson.build instead.
- We add test/integration-test/standalone/meson.build to run the
  integration tests standalone. This meson file includes
  test/integration-test via a cute symlink hack to trick meson into
  including a parent directory with subdir().
- Documentation is included on how to use the new standalone mode.
- TEST-64-UDEV-STORAGE and TEST-85-NETWORK are changed to generate separate
  units for each testcase to make them behave more like the other integration
  tests.

194 files changed:
.github/workflows/coverage.yml
.github/workflows/linter.yml
docs/ARCHITECTURE.md
docs/CODE_QUALITY.md
mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot
mkosi.postinst.chroot
test/TEST-52-HONORFIRSTSHUTDOWN/meson.build [deleted file]
test/integration-tests/README.md [moved from test/README.md with 95% similarity]
test/integration-tests/TEST-01-BASIC/meson.build [moved from test/TEST-01-BASIC/meson.build with 100% similarity]
test/integration-tests/TEST-02-UNITTESTS/meson.build [moved from test/TEST-02-UNITTESTS/meson.build with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.socket [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/always-activating.socket with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/counter.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/counter.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/counter.sh [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/counter.sh with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.target [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart-restartdirect.target with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.target [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/fails-on-restart.target with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/hello-after-sleep.target [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/hello-after-sleep.target with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/hello.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/hello.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-and-pullin.target [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-and-pullin.target with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-indirect.target [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-indirect.target with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-only.target [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/propagatestopto-only.target with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/restart-on-failure.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/restart-on-failure.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-restart-direct.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-restart-direct.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-restart-normal.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-restart-normal.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-simple.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/sleep-infinity-simple.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/sleep.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/sleep.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.target [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart-restartdirect.target with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.sh [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.sh with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.target [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/succeeds-on-restart.target with 100% similarity]
test/integration-tests/TEST-03-JOBS/TEST-03-JOBS.units/unstoppable.service [moved from test/TEST-03-JOBS/TEST-03-JOBS.units/unstoppable.service with 100% similarity]
test/integration-tests/TEST-03-JOBS/meson.build [moved from test/TEST-15-DROPIN/meson.build with 100% similarity]
test/integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units/delegated-cgroup-filtering.service [moved from test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/delegated-cgroup-filtering.service with 100% similarity]
test/integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units/forever-print-hola.service [moved from test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/forever-print-hola.service with 100% similarity]
test/integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units/logs-filtering.service [moved from test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/logs-filtering.service with 100% similarity]
test/integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units/silent-success.service [moved from test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/silent-success.service with 100% similarity]
test/integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units/verbose-success.service [moved from test/TEST-04-JOURNAL/TEST-04-JOURNAL.units/verbose-success.service with 100% similarity]
test/integration-tests/TEST-04-JOURNAL/meson.build [moved from test/TEST-04-JOURNAL/meson.build with 78% similarity]
test/integration-tests/TEST-05-RLIMITS/meson.build [moved from test/TEST-05-RLIMITS/meson.build with 100% similarity]
test/integration-tests/TEST-06-SELINUX/TEST-06-SELINUX.units/hola.service [moved from test/TEST-06-SELINUX/TEST-06-SELINUX.units/hola.service with 100% similarity]
test/integration-tests/TEST-06-SELINUX/meson.build [moved from test/TEST-06-SELINUX/meson.build with 90% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.service [moved from test/TEST-07-PID1/TEST-07-PID1.service with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service [moved from test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.service with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.sh [moved from test/TEST-07-PID1/TEST-07-PID1.units/issue14566-repro.sh with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-1.service [moved from test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-1.service with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-2.service [moved from test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-2.service with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-3.service [moved from test/TEST-07-PID1/TEST-07-PID1.units/issue16115-repro-3.service with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue2467.service [moved from test/TEST-07-PID1/TEST-07-PID1.units/issue2467.service with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue2467.socket [moved from test/TEST-07-PID1/TEST-07-PID1.units/issue2467.socket with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue2730-alias.mount [moved from test/TEST-07-PID1/TEST-07-PID1.units/issue2730-alias.mount with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue2730.mount [moved from test/TEST-07-PID1/TEST-07-PID1.units/issue2730.mount with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue27953.service [moved from test/TEST-07-PID1/TEST-07-PID1.units/issue27953.service with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue3166-fail-on-restart.service [moved from test/TEST-07-PID1/TEST-07-PID1.units/issue3166-fail-on-restart.service with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/local-fs.target.wants/issue2730.mount [moved from test/TEST-07-PID1/TEST-07-PID1.units/local-fs.target.wants/issue2730.mount with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-no.socket [moved from test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-no.socket with 100% similarity]
test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-yes.socket [moved from test/TEST-07-PID1/TEST-07-PID1.units/pass-fds-to-exec-yes.socket with 100% similarity]
test/integration-tests/TEST-07-PID1/meson.build [moved from test/TEST-07-PID1/meson.build with 76% similarity]
test/integration-tests/TEST-08-INITRD/meson.build [moved from test/TEST-08-INITRD/meson.build with 100% similarity]
test/integration-tests/TEST-09-REBOOT/meson.build [moved from test/TEST-09-REBOOT/meson.build with 100% similarity]
test/integration-tests/TEST-13-NSPAWN/meson.build [moved from test/TEST-13-NSPAWN/meson.build with 100% similarity]
test/integration-tests/TEST-15-DROPIN/meson.build [moved from test/TEST-19-CGROUP/meson.build with 100% similarity]
test/integration-tests/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.service [moved from test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.service with 100% similarity]
test/integration-tests/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh [moved from test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/extend-timeout.sh with 100% similarity]
test/integration-tests/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-runtime.service [moved from test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-runtime.service with 100% similarity]
test/integration-tests/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-start.service [moved from test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-start.service with 100% similarity]
test/integration-tests/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-stop.service [moved from test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/fail-stop.service with 100% similarity]
test/integration-tests/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-all.service [moved from test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-all.service with 100% similarity]
test/integration-tests/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-runtime.service [moved from test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-runtime.service with 100% similarity]
test/integration-tests/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-start.service [moved from test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-start.service with 100% similarity]
test/integration-tests/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-stop.service [moved from test/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units/success-stop.service with 100% similarity]
test/integration-tests/TEST-16-EXTEND-TIMEOUT/meson.build [moved from test/TEST-16-EXTEND-TIMEOUT/meson.build with 78% similarity]
test/integration-tests/TEST-17-UDEV/deny-list-ubuntu-ci-ppc64el [moved from test/TEST-17-UDEV/deny-list-ubuntu-ci-ppc64el with 100% similarity]
test/integration-tests/TEST-17-UDEV/meson.build [moved from test/TEST-17-UDEV/meson.build with 100% similarity]
test/integration-tests/TEST-18-FAILUREACTION/meson.build [moved from test/TEST-18-FAILUREACTION/meson.build with 100% similarity]
test/integration-tests/TEST-19-CGROUP/meson.build [moved from test/TEST-22-TMPFILES/meson.build with 100% similarity]
test/integration-tests/TEST-21-DFUZZER/meson.build [moved from test/TEST-21-DFUZZER/meson.build with 100% similarity]
test/integration-tests/TEST-22-TMPFILES/meson.build [moved from test/TEST-25-IMPORT/meson.build with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-binds-to.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-binds-to.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-bound-by.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-bound-by.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-fail.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-fail.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-1.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-1.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-2.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-2.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-3.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-3.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-4.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-4.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-5.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-5.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-6.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-6.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-7.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-7.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-8.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-8.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-9.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-joins-namespace-of-9.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-non-namespaced.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-non-namespaced.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-oneshot-restartforce.sh [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-oneshot-restartforce.sh with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server.socket [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server.socket with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server@.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-openfile-server@.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-one.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-one.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-two.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-prop-stop-two.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-upheld.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-upheld.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-uphold.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-uphold.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-short-lived.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-short-lived.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-depends-wants.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-depends-wants.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-wants.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-specifier-j-wants.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-success.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-success.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-upheldby-install.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-upheldby-install.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-uphold.service [moved from test/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-uphold.service with 100% similarity]
test/integration-tests/TEST-23-UNIT-FILE/meson.build [moved from test/TEST-26-SYSTEMCTL/meson.build with 100% similarity]
test/integration-tests/TEST-24-CRYPTSETUP/keydev.repart/00-root.conf [moved from test/TEST-24-CRYPTSETUP/keydev.repart/00-root.conf with 100% similarity]
test/integration-tests/TEST-24-CRYPTSETUP/keyfile [moved from test/TEST-24-CRYPTSETUP/keyfile with 100% similarity]
test/integration-tests/TEST-24-CRYPTSETUP/meson.build [moved from test/TEST-24-CRYPTSETUP/meson.build with 100% similarity]
test/integration-tests/TEST-24-CRYPTSETUP/template.cfg [moved from test/TEST-24-CRYPTSETUP/template.cfg with 100% similarity]
test/integration-tests/TEST-25-IMPORT/meson.build [moved from test/TEST-34-DYNAMICUSERMIGRATE/meson.build with 100% similarity]
test/integration-tests/TEST-26-SYSTEMCTL/meson.build [moved from test/TEST-35-LOGIN/meson.build with 100% similarity]
test/integration-tests/TEST-29-PORTABLE/meson.build [moved from test/TEST-29-PORTABLE/meson.build with 100% similarity]
test/integration-tests/TEST-30-ONCLOCKCHANGE/TEST-30-ONCLOCKCHANGE.units/systemd-timedated.service.d/watchdog.conf [moved from test/TEST-30-ONCLOCKCHANGE/TEST-30-ONCLOCKCHANGE.units/systemd-timedated.service.d/watchdog.conf with 100% similarity]
test/integration-tests/TEST-30-ONCLOCKCHANGE/meson.build [moved from test/TEST-31-DEVICE-ENUMERATION/meson.build with 100% similarity]
test/integration-tests/TEST-31-DEVICE-ENUMERATION/meson.build [moved from test/TEST-36-NUMAPOLICY/meson.build with 100% similarity]
test/integration-tests/TEST-32-OOMPOLICY/meson.build [moved from test/TEST-32-OOMPOLICY/meson.build with 100% similarity]
test/integration-tests/TEST-34-DYNAMICUSERMIGRATE/meson.build [moved from test/TEST-43-PRIVATEUSER-UNPRIV/meson.build with 100% similarity]
test/integration-tests/TEST-35-LOGIN/meson.build [moved from test/TEST-45-TIMEDATE/meson.build with 100% similarity]
test/integration-tests/TEST-36-NUMAPOLICY/meson.build [moved from test/TEST-38-FREEZER/meson.build with 100% similarity]
test/integration-tests/TEST-38-FREEZER/meson.build [moved from test/TEST-50-DISSECT/meson.build with 100% similarity]
test/integration-tests/TEST-43-PRIVATEUSER-UNPRIV/meson.build [moved from test/TEST-46-HOMED/meson.build with 100% similarity]
test/integration-tests/TEST-44-LOG-NAMESPACE/TEST-44-LOG-NAMESPACE.service [moved from test/TEST-44-LOG-NAMESPACE/TEST-44-LOG-NAMESPACE.service with 100% similarity]
test/integration-tests/TEST-44-LOG-NAMESPACE/meson.build [moved from test/TEST-44-LOG-NAMESPACE/meson.build with 100% similarity]
test/integration-tests/TEST-45-TIMEDATE/meson.build [moved from test/TEST-60-MOUNT-RATELIMIT/meson.build with 100% similarity]
test/integration-tests/TEST-46-HOMED/meson.build [moved from test/TEST-65-ANALYZE/meson.build with 100% similarity]
test/integration-tests/TEST-50-DISSECT/meson.build [moved from test/TEST-58-REPART/meson.build with 100% similarity]
test/integration-tests/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service [moved from test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service with 100% similarity]
test/integration-tests/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.sh [moved from test/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.sh with 100% similarity]
test/integration-tests/TEST-52-HONORFIRSTSHUTDOWN/meson.build [moved from test/TEST-68-PROPAGATE-EXIT-STATUS/meson.build with 100% similarity]
test/integration-tests/TEST-53-ISSUE-16347/meson.build [moved from test/TEST-53-ISSUE-16347/meson.build with 100% similarity]
test/integration-tests/TEST-54-CREDS/meson.build [moved from test/TEST-54-CREDS/meson.build with 100% similarity]
test/integration-tests/TEST-54-CREDS/systemd.extra-unit.my-service.service [moved from test/TEST-54-CREDS/systemd.extra-unit.my-service.service with 100% similarity]
test/integration-tests/TEST-54-CREDS/systemd.unit-dropin.my-service.service [moved from test/TEST-54-CREDS/systemd.unit-dropin.my-service.service with 100% similarity]
test/integration-tests/TEST-54-CREDS/systemd.unit-dropin.my-service.service~30-named.service [moved from test/TEST-54-CREDS/systemd.unit-dropin.my-service.service~30-named.service with 100% similarity]
test/integration-tests/TEST-55-OOMD/meson.build [moved from test/TEST-55-OOMD/meson.build with 100% similarity]
test/integration-tests/TEST-55-OOMD/systemd.unit-dropin.init.scope [moved from test/TEST-55-OOMD/systemd.unit-dropin.init.scope with 100% similarity]
test/integration-tests/TEST-58-REPART/meson.build [moved from test/TEST-62-RESTRICT-IFACES/meson.build with 100% similarity]
test/integration-tests/TEST-59-RELOADING-RESTART/meson.build [moved from test/TEST-59-RELOADING-RESTART/meson.build with 100% similarity]
test/integration-tests/TEST-60-MOUNT-RATELIMIT/meson.build [moved from test/TEST-75-RESOLVED/meson.build with 100% similarity]
test/integration-tests/TEST-62-RESTRICT-IFACES/meson.build [moved from test/TEST-66-DEVICE-ISOLATION/meson.build with 100% similarity]
test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63-glob.path [moved from test/TEST-63-PATH/TEST-63-PATH.units/test63-glob.path with 100% similarity]
test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63-glob.service [moved from test/TEST-63-PATH/TEST-63-PATH.units/test63-glob.service with 100% similarity]
test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577-dep.service [moved from test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577-dep.service with 100% similarity]
test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.path [moved from test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.path with 100% similarity]
test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.service [moved from test/TEST-63-PATH/TEST-63-PATH.units/test63-issue-24577.service with 100% similarity]
test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.path [moved from test/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.path with 100% similarity]
test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.service [moved from test/TEST-63-PATH/TEST-63-PATH.units/test63-pr-30768.service with 100% similarity]
test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63.path [moved from test/TEST-63-PATH/TEST-63-PATH.units/test63.path with 100% similarity]
test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63.service [moved from test/TEST-63-PATH/TEST-63-PATH.units/test63.service with 100% similarity]
test/integration-tests/TEST-63-PATH/meson.build [moved from test/TEST-76-SYSCTL/meson.build with 100% similarity]
test/integration-tests/TEST-64-UDEV-STORAGE/deny-list-ubuntu-ci [moved from test/TEST-64-UDEV-STORAGE/deny-list-ubuntu-ci with 100% similarity]
test/integration-tests/TEST-64-UDEV-STORAGE/meson.build [moved from test/TEST-64-UDEV-STORAGE/meson.build with 58% similarity]
test/integration-tests/TEST-65-ANALYZE/meson.build [moved from test/TEST-78-SIGQUEUE/meson.build with 100% similarity]
test/integration-tests/TEST-66-DEVICE-ISOLATION/meson.build [moved from test/TEST-67-INTEGRITY/meson.build with 100% similarity]
test/integration-tests/TEST-67-INTEGRITY/meson.build [moved from test/TEST-72-SYSUPDATE/meson.build with 100% similarity]
test/integration-tests/TEST-68-PROPAGATE-EXIT-STATUS/meson.build [moved from test/TEST-81-GENERATORS/meson.build with 100% similarity]
test/integration-tests/TEST-69-SHUTDOWN/TEST-69-SHUTDOWN.service [moved from test/TEST-69-SHUTDOWN/TEST-69-SHUTDOWN.service with 100% similarity]
test/integration-tests/TEST-69-SHUTDOWN/meson.build [moved from test/TEST-69-SHUTDOWN/meson.build with 100% similarity]
test/integration-tests/TEST-70-TPM2/meson.build [moved from test/TEST-70-TPM2/meson.build with 100% similarity]
test/integration-tests/TEST-71-HOSTNAME/meson.build [moved from test/TEST-71-HOSTNAME/meson.build with 100% similarity]
test/integration-tests/TEST-72-SYSUPDATE/meson.build [moved from test/TEST-83-BTRFS/meson.build with 100% similarity]
test/integration-tests/TEST-73-LOCALE/meson.build [moved from test/TEST-73-LOCALE/meson.build with 100% similarity]
test/integration-tests/TEST-74-AUX-UTILS/TEST-74-AUX-UTILS.units/realtime-test.service [moved from test/TEST-74-AUX-UTILS/TEST-74-AUX-UTILS.units/realtime-test.service with 100% similarity]
test/integration-tests/TEST-74-AUX-UTILS/TEST-74-AUX-UTILS.units/realtime-test.timer [moved from test/TEST-74-AUX-UTILS/TEST-74-AUX-UTILS.units/realtime-test.timer with 100% similarity]
test/integration-tests/TEST-74-AUX-UTILS/meson.build [moved from test/TEST-74-AUX-UTILS/meson.build with 77% similarity]
test/integration-tests/TEST-75-RESOLVED/meson.build [moved from test/TEST-03-JOBS/meson.build with 71% similarity]
test/integration-tests/TEST-76-SYSCTL/meson.build [moved from test/TEST-63-PATH/meson.build with 71% similarity]
test/integration-tests/TEST-78-SIGQUEUE/meson.build [moved from test/TEST-23-UNIT-FILE/meson.build with 70% similarity]
test/integration-tests/TEST-79-MEMPRESS/meson.build [moved from test/TEST-79-MEMPRESS/meson.build with 100% similarity]
test/integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-nopin.service [moved from test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-nopin.service with 100% similarity]
test/integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.service [moved from test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.service with 100% similarity]
test/integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh [moved from test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.sh with 100% similarity]
test/integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.target [moved from test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/fdstore-pin.target with 100% similarity]
test/integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/notify.service [moved from test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/notify.service with 100% similarity]
test/integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/test.sh [moved from test/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units/test.sh with 100% similarity]
test/integration-tests/TEST-80-NOTIFYACCESS/meson.build [moved from test/TEST-80-NOTIFYACCESS/meson.build with 69% similarity]
test/integration-tests/TEST-81-GENERATORS/meson.build [new file with mode: 0644]
test/integration-tests/TEST-82-SOFTREBOOT/TEST-82-SOFTREBOOT.service [moved from test/TEST-82-SOFTREBOOT/TEST-82-SOFTREBOOT.service with 100% similarity]
test/integration-tests/TEST-82-SOFTREBOOT/meson.build [moved from test/TEST-82-SOFTREBOOT/meson.build with 100% similarity]
test/integration-tests/TEST-83-BTRFS/meson.build [moved from test/TEST-84-STORAGETM/meson.build with 100% similarity]
test/integration-tests/TEST-84-STORAGETM/meson.build [moved from test/TEST-30-ONCLOCKCHANGE/meson.build with 72% similarity]
test/integration-tests/TEST-85-NETWORK/meson.build [moved from test/TEST-85-NETWORK/meson.build with 64% similarity]
test/integration-tests/TEST-86-MULTI-PROFILE-UKI/meson.build [moved from test/TEST-86-MULTI-PROFILE-UKI/meson.build with 100% similarity]
test/integration-tests/TEST-87-AUX-UTILS-VM/meson.build [moved from test/TEST-87-AUX-UTILS-VM/meson.build with 100% similarity]
test/integration-tests/integration-test-wrapper.py [moved from test/integration-test-wrapper.py with 100% similarity]
test/integration-tests/integration-tests [new symlink]
test/integration-tests/meson.build [new file with mode: 0644]
test/integration-tests/standalone/meson.build [new file with mode: 0644]
test/meson.build
test/test.service.in

index 0be4e40cab610abc03f73483f211f257b3bf0b67..c93156be315c5d8f2c91471b7651da2bc6faf976 100644 (file)
@@ -13,7 +13,7 @@ on:
       - v[0-9]+-stable
     paths:
       - .github/workflows/coverage.yml
-      - test/integration-test-wrapper.py
+      - test/integration-tests/integration-test-wrapper.py
 
 permissions:
   contents: read
index be9a84ee46ddbe1ba9444ec2b765559086e0e843..446658952c2211a4a9483b6802c2a125b8971d84 100644 (file)
@@ -37,7 +37,7 @@ jobs:
           VALIDATE_GITHUB_ACTIONS: true
 
       - name: Check that tabs are not used in Python code
-        run: sh -c '! git grep -P "\\t" -- src/boot/generate-hwids-section.py src/ukify/ukify.py test/integration-test-wrapper.py'
+        run: sh -c '! git grep -P "\\t" -- src/boot/generate-hwids-section.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py'
 
       - name: Install ruff and mypy
         run: |
@@ -47,18 +47,18 @@ jobs:
       - name: Run mypy
         run: |
           python3 -m mypy --version
-          python3 -m mypy src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-test-wrapper.py
+          python3 -m mypy src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
 
       - name: Run ruff check
         run: |
           ruff --version
-          ruff check src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-test-wrapper.py
+          ruff check src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
 
       - name: Run ruff format
         run: |
           ruff --version
-          if ! ruff format --check src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-test-wrapper.py
+          if ! ruff format --check src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
           then
               echo "Please run 'ruff format' on the above files or apply the diffs below manually"
-              ruff format --check --quiet --diff  src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-test-wrapper.py
+              ruff format --check --quiet --diff  src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
           fi
index 9db8e7120308cef1ec40d352f1e90b1c8e915554..7994bbe56961f1bff4510b9d20031892f7222498 100644 (file)
@@ -122,7 +122,7 @@ Sources in `test/TEST-*` implement system-level testing for executables, librari
 Most of those tests should be able to run via `systemd-nspawn`, which is orders-of-magnitude faster than `qemu`, but some tests require privileged operations like using `dm-crypt` or `loopdev`.
 They are clearly marked if that is the case.
 
-See [`test/README.md`](https://github.com/systemd/systemd/blob/main/test/README.md) for more specific details.
+See [`test/integration-tests/README.md`](https://github.com/systemd/systemd/blob/main/test/integration-tests/README.md) for more specific details.
 
 ## hwdb
 
index a977e25b68c804d8f9dfb596eff94e51da5f50ea..df4ade3b416f85b8a91f9ed8f4b03cd09c6d6298 100644 (file)
@@ -22,9 +22,9 @@ available functionality:
    configure -C build -D…".)
 
 2. Run the full integration test suite as described in
-   [test/README.md](/../test/README.md). This will build OS images with a number
-   of integration tests and run them using `systemd-nspawn` and `qemu`. Requires
-   root.
+   [test/integration-tests/README.md](/../test/integration-tests/README.md).
+   This will build OS images with a number of integration tests and run them
+   using `systemd-nspawn` and `qemu`. Requires root.
 
 3. Use `./coccinelle/run-coccinelle.sh` to run all
    [Coccinelle](http://coccinelle.lip6.fr/) semantic patch scripts we ship. The
index f845f288c0064890206c8b2b01b61ebbf4ffb7cd..2363b92ad5c881337f89db198570e2fcd4030e7e 100755 (executable)
@@ -64,6 +64,12 @@ if ((COVERAGE)); then
     MKOSI_CFLAGS="$MKOSI_CFLAGS -fprofile-dir=/coverage"
 fi
 
+# The opensuse spec tars up stuff in test/ and unpacks it in test/integration-tests, which we now use for our
+# own purposes, so let's get rid of that specific bit of logic in the opensuse spec until they've had a chance
+# to adapt.
+sed "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec" -e '1062,1075d' -e '/integration-tests\/README/d' >/tmp/systemd.spec
+mount --bind /tmp/systemd.spec "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}/systemd.spec"
+
 build() {
     IFS=
     # shellcheck disable=SC2046
index 914502a473605c788293a59d754514f8dea0d981..3a021bffd9c11b22b5b201469aff331f0c922740 100755 (executable)
@@ -58,8 +58,8 @@ SYSTEMD_REPART_MKFS_OPTIONS_EXT4="" \
     --dry-run=no \
     --size=auto \
     --offline=true \
-    --root test/TEST-24-CRYPTSETUP \
-    --definitions test/TEST-24-CRYPTSETUP/keydev.repart \
+    --root test/integration-tests/TEST-24-CRYPTSETUP \
+    --definitions test/integration-tests/TEST-24-CRYPTSETUP/keydev.repart \
     "$OUTPUTDIR/keydev.raw"
 
 can_test_pkcs11() {
@@ -132,7 +132,7 @@ EOF
     certtool --generate-self-signed \
       --load-privkey="pkcs11:token=TestToken;object=RSATestKey;type=private" \
       --load-pubkey="pkcs11:token=TestToken;object=RSATestKey;type=public" \
-      --template "test/TEST-24-CRYPTSETUP/template.cfg" \
+      --template "test/integration-tests/TEST-24-CRYPTSETUP/template.cfg" \
       --outder --outfile "/tmp/rsa_test.crt"
 
     pkcs11-tool --module "$SOFTHSM_MODULE" --token-label "TestToken" --pin "env:GNUTLS_PIN" --so-pin "env:GNUTLS_SO_PIN" --write-object "/tmp/rsa_test.crt" --type cert --label "RSATestKey"
@@ -144,7 +144,7 @@ EOF
     certtool --generate-self-signed \
       --load-privkey="pkcs11:token=TestToken;object=ECTestKey;type=private" \
       --load-pubkey="pkcs11:token=TestToken;object=ECTestKey;type=public" \
-      --template "test/TEST-24-CRYPTSETUP/template.cfg" \
+      --template "test/integration-tests/TEST-24-CRYPTSETUP/template.cfg" \
       --outder --outfile "/tmp/ec_test.crt"
 
     pkcs11-tool --module "$SOFTHSM_MODULE" --token-label "TestToken" --pin "env:GNUTLS_PIN" --so-pin "env:GNUTLS_SO_PIN" --write-object "/tmp/ec_test.crt" --type cert --label "ECTestKey"
diff --git a/test/TEST-52-HONORFIRSTSHUTDOWN/meson.build b/test/TEST-52-HONORFIRSTSHUTDOWN/meson.build
deleted file mode 100644 (file)
index 08503e8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# 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']
similarity index 95%
rename from test/README.md
rename to test/integration-tests/README.md
index 5dade6b421da4e341e4010b7fc9ffa13e77966f6..9cd3ea74805883bd3def59387b9da61d659d82c8 100644 (file)
@@ -151,6 +151,31 @@ options to provide mkosi with a directory containing the systemd packages or a
 repository file that points to a repository with the systemd packages that
 should be installed.
 
+If the rpms are installed on the host system that the tests are running on,
+you'll probably want to disable usage of the tools tree so that the tools from
+the host system are used to build the image by adding the following to
+`mkosi.local.conf`:
+
+```conf
+[Build]
+ToolsTree=
+```
+
+On the other hand, if the rpms are available but not installed on the host
+system, you'll want to make sure they're installed into the mkosi tools tree so
+that they're used to build the image by using either
+`ToolsTreePackageDirectories=` or `ToolsTreeSandboxTrees=` similarly to
+`PackageDirectories=` or `SandboxTrees=` mentioned above.
+
+Finally, we'll make use of the standalone mode of running the integration tests
+to avoid having to install any build dependencies.
+
+```sh
+$ mkosi -f sandbox -- meson setup testsuite test/integration-tests/standalone
+$ mkosi -f
+$ mkosi sandbox -- meson test -C testsuite --num-processes "$(($(nproc) / 4))"
+```
+
 ### SELinux AVCs
 
 To have `TEST-06-SELINUX` check for SELinux denials, write the following to
similarity index 78%
rename from test/TEST-04-JOURNAL/meson.build
rename to test/integration-tests/TEST-04-JOURNAL/meson.build
index 5a0b073c02bc5a1392a2bfddc37ee243721af89b..184f70ab720bbfab14df975559b48a53f762949f 100644 (file)
@@ -8,5 +8,3 @@ integration_tests += [
                 'storage' : 'persistent',
         },
 ]
-
-testdata_subdirs += [meson.current_source_dir() / 'TEST-04-JOURNAL.units']
similarity index 90%
rename from test/TEST-06-SELINUX/meson.build
rename to test/integration-tests/TEST-06-SELINUX/meson.build
index fd670ae40da3e2eff136ad8e0119af245bc3dd52..e2f329d17c13862790898a9eccc3dce44904be4e 100644 (file)
@@ -13,5 +13,3 @@ integration_tests += [
                 'mkosi-args' : integration_test_template['mkosi-args'] + ['--runtime-build-sources=no'],
         },
 ]
-
-testdata_subdirs += [meson.current_source_dir() / 'TEST-06-SELINUX.units']
similarity index 76%
rename from test/TEST-07-PID1/meson.build
rename to test/integration-tests/TEST-07-PID1/meson.build
index 311860dc89f59bb868662ca53067a5bb1c1c77f6..3b3178210833ef544f0625a3f7f9fec17bfe008e 100644 (file)
@@ -6,5 +6,3 @@ integration_tests += [
                 'unit' : files('TEST-07-PID1.service'),
         },
 ]
-
-testdata_subdirs += [meson.current_source_dir() / 'TEST-07-PID1.units']
similarity index 78%
rename from test/TEST-16-EXTEND-TIMEOUT/meson.build
rename to test/integration-tests/TEST-16-EXTEND-TIMEOUT/meson.build
index 2a06f9a151fa3dca561a1df3743d14b44a02eb8b..e18b8474710c73b419a5a16806f08fd496e2db0f 100644 (file)
@@ -7,5 +7,3 @@ integration_tests += [
                 'coredump-exclude-regex' : '/(bash|sleep)$',
         },
 ]
-
-testdata_subdirs += [meson.current_source_dir() / 'TEST-16-EXTEND-TIMEOUT.units']
similarity index 58%
rename from test/TEST-64-UDEV-STORAGE/meson.build
rename to test/integration-tests/TEST-64-UDEV-STORAGE/meson.build
index acd6b191d0c712973cc1b71925c0848b83c90893..cbd6b6977721053f16ca587a79137951a96cee19 100644 (file)
@@ -1,17 +1,17 @@
 # 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),
-        # Disable user service manager by default for performance.
-        configuration : integration_test_template['configuration'] + {
-              'wants' : '',
-              'after' : '',
-        },
-)
-
 udev_storage_tests = []
+udev_storage_test_template = {
+        'enabled' : true,
+}
+
+qemu = find_program('qemu-system-@0@'.format(host_machine.cpu_family()), 'qemu-kvm', dirs : ['/usr/libexec'], native : true, required : false)
+if qemu.found()
+        devices = run_command(qemu, '-device', 'help', check : true).stdout().strip()
+else
+        devices = ''
+endif
 
 cmdline = []
 qemu_args = ['-device', 'virtio-scsi-pci,id=scsi0']
@@ -23,7 +23,7 @@ foreach i : range(4)
         qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefbtrfs@i@']
 endforeach
 
-udev_storage_tests += {
+udev_storage_tests += udev_storage_test_template + {
         'name' : 'btrfs_basic',
         'cmdline' : cmdline,
         'qemu-args' : qemu_args,
@@ -39,7 +39,7 @@ foreach i : range(4)
         qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefiscsi@i@']
 endforeach
 
-udev_storage_tests += {
+udev_storage_tests += udev_storage_test_template + {
         'name' : 'iscsi_lvm',
         'cmdline' : cmdline,
         'qemu-args' : qemu_args,
@@ -60,7 +60,7 @@ endforeach
 
 qemu_args += ['-device', 'virtio-blk-pci,drive=drive0,bus=pci_bridge25,addr=1,serial=long-sysfs-path']
 
-udev_storage_tests += {
+udev_storage_tests += udev_storage_test_template + {
         'name' : 'long_sysfs_path',
         'cmdline' : cmdline,
         'qemu-args' : qemu_args,
@@ -75,7 +75,7 @@ foreach i : range(4)
         qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeeflvm@i@']
 endforeach
 
-udev_storage_tests += {
+udev_storage_tests += udev_storage_test_template + {
         'name' : 'lvm_basic',
         'cmdline' : cmdline,
         'qemu-args' : qemu_args,
@@ -90,7 +90,7 @@ foreach i : range(5)
         qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefmdadm@i@']
 endforeach
 
-udev_storage_tests += {
+udev_storage_tests += udev_storage_test_template + {
         'name' : 'mdadm_basic',
         'cmdline' : cmdline,
         'qemu-args' : qemu_args,
@@ -105,7 +105,7 @@ foreach i : range(5)
         qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefmdadmlvm@i@']
 endforeach
 
-udev_storage_tests += {
+udev_storage_tests += udev_storage_test_template + {
         'name' : 'mdadm_lvm',
         'cmdline' : cmdline,
         'qemu-args' : qemu_args,
@@ -127,7 +127,7 @@ foreach ndisk : range(16)
         endforeach
 endforeach
 
-udev_storage_tests += {
+udev_storage_tests += udev_storage_test_template + {
         'name' : 'multipath_basic_failover',
         'cmdline' : cmdline,
         'qemu-args' : qemu_args,
@@ -142,7 +142,7 @@ foreach i : range(10)
         qemu_args += ['-device', f'scsi-hd,drive=@id@,serial=deadbeeftest@i@']
 endforeach
 
-udev_storage_tests += {
+udev_storage_tests += udev_storage_test_template + {
         'name' : 'simultaneous_events',
         'cmdline' : cmdline,
         'qemu-args' : qemu_args,
@@ -163,87 +163,81 @@ foreach i : range(128)
         qemu_args += ['-device', f'scsi-hd,drive=@id@,serial=@id@,bus=scsi@div@.0,channel=0,scsi-id=@mod@,lun=0']
 endforeach
 
-udev_storage_tests += {
+udev_storage_tests += udev_storage_test_template + {
         'name' : 'virtio_scsi_basic',
         'cmdline' : cmdline,
         'qemu-args' : qemu_args,
 }
 
-qemu = find_program('qemu-system-@0@'.format(host_machine.cpu_family()), 'qemu-kvm', dirs : ['/usr/libexec'], native : true, required : false)
-if qemu.found()
-        devices = run_command(qemu, '-device', 'help', check : true).stdout().strip()
-        if devices.contains('name "nvme"')
-                cmdline = []
-                qemu_args = []
-
-                foreach i : range(20)
-                        cmdline += [f'--drive=nvme@i@:1M::']
-                endforeach
-
-                foreach i : range(5)
-                        qemu_args += ['-device', f'nvme,drive=nvme@i@,serial=deadbeef@i@,max_ioqpairs=8']
-                endforeach
-
-                foreach i : range(5, 10)
-                        qemu_args += ['-device', f'"nvme,drive=nvme@i@,serial=    deadbeef  @i@   ,max_ioqpairs=8"']
-                endforeach
-
-                foreach i : range(10, 15)
-                        qemu_args += ['-device', f'"nvme,drive=nvme@i@,serial=    dead/beef/@i@   ,max_ioqpairs=8"']
-                endforeach
-
-                foreach i : range(15, 20)
-                        qemu_args += ['-device', f'"nvme,drive=nvme@i@,serial=dead/../../beef/@i@,max_ioqpairs=8"']
-                endforeach
-
-                udev_storage_tests += {
-                        'name' : 'nvme_basic',
-                        'cmdline' : cmdline,
-                        'qemu-args' : qemu_args,
-                }
-
-                cmdline = []
-
-                foreach id : ['nvme0', 'nvme1']
-                        cmdline += [f'--drive=@id@:1M::']
-                endforeach
-
-                qemu_args = [
-                        # 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',
-                ]
-
-                udev_storage_tests += {
-                        'name' : 'nvme_subsystem',
-                        'cmdline' : cmdline,
-                        'qemu-args' : qemu_args,
-                }
-        endif
-
-        if devices.contains('name "virtio-scsi-pci"')
-                cmdline = []
-                qemu_args = ['-device', 'virtio-scsi-pci,id=scsi0,num_queues=4']
-
-                foreach i : range(16)
-                        id = f'drive@i@'
-                        cmdline += [f'--drive=@id@:40M::']
-                        qemu_args += ['-device', f'scsi-hd,drive=@id@,serial=@id@,bus=scsi0.0,channel=0,scsi-id=0,lun=@i@']
-                endforeach
-
-                udev_storage_tests += {
-                        'name' : 'virtio_scsi_identically_named_partitions',
-                        'cmdline' : cmdline,
-                        'qemu-args' : qemu_args,
-                }
-        endif
-endif
+cmdline = []
+qemu_args = []
+
+foreach i : range(20)
+        cmdline += [f'--drive=nvme@i@:1M::']
+endforeach
+
+foreach i : range(5)
+        qemu_args += ['-device', f'nvme,drive=nvme@i@,serial=deadbeef@i@,max_ioqpairs=8']
+endforeach
 
+foreach i : range(5, 10)
+        qemu_args += ['-device', f'"nvme,drive=nvme@i@,serial=    deadbeef  @i@   ,max_ioqpairs=8"']
+endforeach
+
+foreach i : range(10, 15)
+        qemu_args += ['-device', f'"nvme,drive=nvme@i@,serial=    dead/beef/@i@   ,max_ioqpairs=8"']
+endforeach
+
+foreach i : range(15, 20)
+        qemu_args += ['-device', f'"nvme,drive=nvme@i@,serial=dead/../../beef/@i@,max_ioqpairs=8"']
+endforeach
+
+udev_storage_tests += udev_storage_test_template + {
+        'name' : 'nvme_basic',
+        'cmdline' : cmdline,
+        'qemu-args' : qemu_args,
+        'enabled' : devices.contains('name "nvme"'),
+}
+
+cmdline = []
+
+foreach id : ['nvme0', 'nvme1']
+        cmdline += [f'--drive=@id@:1M::']
+endforeach
+
+qemu_args = [
+        # 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',
+]
+
+udev_storage_tests += udev_storage_test_template + {
+        'name' : 'nvme_subsystem',
+        'cmdline' : cmdline,
+        'qemu-args' : qemu_args,
+        'enabled' : devices.contains('name "nvme"'),
+}
+
+cmdline = []
+qemu_args = ['-device', 'virtio-scsi-pci,id=scsi0,num_queues=4']
+
+foreach i : range(16)
+        id = f'drive@i@'
+        cmdline += [f'--drive=@id@:40M::']
+        qemu_args += ['-device', f'scsi-hd,drive=@id@,serial=@id@,bus=scsi0.0,channel=0,scsi-id=0,lun=@i@']
+endforeach
+
+udev_storage_tests += udev_storage_test_template + {
+        'name' : 'virtio_scsi_identically_named_partitions',
+        'cmdline' : cmdline,
+        'qemu-args' : qemu_args,
+        'enabled' : devices.contains('name "virtio-scsi-pci"'),
+}
 
 foreach testcase : udev_storage_tests
         qemu_args = ' '.join(testcase['qemu-args'])
@@ -252,17 +246,22 @@ foreach testcase : udev_storage_tests
         integration_tests += [
                 integration_test_template + {
                         'name' : '@0@-@1@'.format(name, testcase['name']),
-                        # 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['name'])
-                        ],
+                        # Disable user service manager by default for performance.
+                        'configuration' : integration_test_template['configuration'] + {
+                                'wants' : '',
+                                'after' : '',
+                                'command' : f'/usr/lib/systemd/tests/testdata/units/@name@.sh',
+                                'env' : integration_test_template['configuration']['env'] + {
+                                        'TEST_FUNCTION_NAME': 'testcase_@0@'.format(testcase['name']),
+                                },
+                        },
                         'mkosi-args' : integration_test_template['mkosi-args'] + cmdline,
                         'priority' : 10,
                         'vm' : true,
                         # Suppress ASan error
                         # 'multipathd[1820]: ==1820==ERROR: AddressSanitizer: Joining already joined thread, aborting.'
-                        'sanitizer-exclude-regex' : 'multipathd'
+                        'sanitizer-exclude-regex' : 'multipathd',
+                        'enabled' : testcase['enabled'],
                 },
         ]
 endforeach
similarity index 77%
rename from test/TEST-74-AUX-UTILS/meson.build
rename to test/integration-tests/TEST-74-AUX-UTILS/meson.build
index 698d03b055f7a25d19fe76212164a201accbfd9b..0db9fe974f7c173d2972eda7ede7a2b393e47232 100644 (file)
@@ -6,5 +6,3 @@ integration_tests += [
                 'name' : fs.name(meson.current_source_dir()),
         },
 ]
-
-testdata_subdirs += [meson.current_source_dir() / 'TEST-74-AUX-UTILS.units']
similarity index 71%
rename from test/TEST-03-JOBS/meson.build
rename to test/integration-tests/TEST-75-RESOLVED/meson.build
index 3484d21ba2f156a16bbaebe18740f6c25932336c..8dec5f37e73a80d31833a772fa16883b02a07615 100644 (file)
@@ -5,5 +5,3 @@ integration_tests += [
                 'name' : fs.name(meson.current_source_dir()),
         },
 ]
-
-testdata_subdirs += [meson.current_source_dir() / 'TEST-03-JOBS.units']
similarity index 71%
rename from test/TEST-63-PATH/meson.build
rename to test/integration-tests/TEST-76-SYSCTL/meson.build
index 4aa3afdf7a39656cdd387a53d35396204fde4f37..8dec5f37e73a80d31833a772fa16883b02a07615 100644 (file)
@@ -5,5 +5,3 @@ integration_tests += [
                 'name' : fs.name(meson.current_source_dir()),
         },
 ]
-
-testdata_subdirs += [meson.current_source_dir() / 'TEST-63-PATH.units']
similarity index 70%
rename from test/TEST-23-UNIT-FILE/meson.build
rename to test/integration-tests/TEST-78-SIGQUEUE/meson.build
index 3f44662ae3a9bfcb3df079651c7c49edf28e4d5d..8dec5f37e73a80d31833a772fa16883b02a07615 100644 (file)
@@ -5,5 +5,3 @@ integration_tests += [
                 'name' : fs.name(meson.current_source_dir()),
         },
 ]
-
-testdata_subdirs += [meson.current_source_dir() / 'TEST-23-UNIT-FILE.units']
similarity index 69%
rename from test/TEST-80-NOTIFYACCESS/meson.build
rename to test/integration-tests/TEST-80-NOTIFYACCESS/meson.build
index f78c6fd732ec4cef1e8bc1276dd2c8208f860937..8dec5f37e73a80d31833a772fa16883b02a07615 100644 (file)
@@ -5,5 +5,3 @@ integration_tests += [
                 'name' : fs.name(meson.current_source_dir()),
         },
 ]
-
-testdata_subdirs += [meson.current_source_dir() / 'TEST-80-NOTIFYACCESS.units']
diff --git a/test/integration-tests/TEST-81-GENERATORS/meson.build b/test/integration-tests/TEST-81-GENERATORS/meson.build
new file mode 100644 (file)
index 0000000..8dec5f3
--- /dev/null
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+integration_tests += [
+        integration_test_template + {
+                'name' : fs.name(meson.current_source_dir()),
+        },
+]
similarity index 72%
rename from test/TEST-30-ONCLOCKCHANGE/meson.build
rename to test/integration-tests/TEST-84-STORAGETM/meson.build
index cd0f1f6574a2fbcaada4548fc3f92b2405a9c46d..77370ce4588c492616a081a23117e5b55dce4f3b 100644 (file)
@@ -6,5 +6,3 @@ integration_tests += [
                 'vm' : true,
         },
 ]
-
-testdata_subdirs += [meson.current_source_dir() / 'TEST-30-ONCLOCKCHANGE.units']
similarity index 64%
rename from test/TEST-85-NETWORK/meson.build
rename to test/integration-tests/TEST-85-NETWORK/meson.build
index 223f2a231003c6878788fa4aaa72cc8e2ac8d14c..7bce51abbe7b0e3d49183ffe813a419ac6f4f4ad 100644 (file)
@@ -1,13 +1,6 @@
 # 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'] + {
-                'command' : '@0@ --no-journal'.format(testdata_dir / 'test-network/systemd-networkd-tests.py')
-        },
-)
 
 foreach testcase : [
         'NetworkctlTests',
@@ -33,10 +26,12 @@ foreach testcase : [
         integration_tests += [
                 integration_test_template + {
                         'name' : '@0@-@1@'.format(name, testcase),
-                        'unit' : unit,
-                        'cmdline' : integration_test_template['cmdline'] + [
-                                'systemd.setenv=TEST_MATCH_TESTCASE=@0@'.format(testcase)
-                        ],
+                        'configuration' : integration_test_template['configuration'] + {
+                                'command' : '/usr/lib/systemd/tests/testdata/test-network/systemd-networkd-tests.py --no-journal',
+                                'env' : integration_test_template['configuration']['env'] + {
+                                        'TEST_MATCH_TESTCASE': testcase,
+                                }
+                        },
                         'priority' : 10,
                         'vm' : true,
                 },
diff --git a/test/integration-tests/integration-tests b/test/integration-tests/integration-tests
new file mode 120000 (symlink)
index 0000000..a96aa0e
--- /dev/null
@@ -0,0 +1 @@
+..
\ No newline at end of file
diff --git a/test/integration-tests/meson.build b/test/integration-tests/meson.build
new file mode 100644 (file)
index 0000000..ecf3df7
--- /dev/null
@@ -0,0 +1,172 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+integration_test_wrapper = find_program('integration-test-wrapper.py')
+integration_tests = []
+integration_test_template = {
+        'mkosi-args' : [],
+        'timeout' : 1800,
+        'storage' : 'volatile',
+        'priority' : 0,
+        'firmware' : 'linux',
+        'enabled' : true,
+        'configuration' : {
+                'memory-accounting' : 'no',
+                'command' : '/usr/lib/systemd/tests/testdata/units/%N.sh',
+                'wants' : 'multi-user.target user@4711.service',
+                'after' : 'user@4711.service',
+                'env' : {},
+        },
+        'cmdline' : [],
+        'credentials' : [],
+        'qemu-args' : [],
+        'exit-code' : 123,
+        'vm' : false,
+        'coredump-exclude-regex' : '',
+        'sanitizer-exclude-regex' : '',
+        'rtc' : false,
+}
+
+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',
+        'TEST-85-NETWORK',
+        'TEST-86-MULTI-PROFILE-UKI',
+        'TEST-87-AUX-UTILS-VM',
+]
+        subdir(dirname)
+endforeach
+
+foreach integration_test : integration_tests
+        integration_test_args = [
+                # We don't use meson.project_source_root() because that doesn't work for running the tests
+                # standalone (see standalone/meson.build).
+                '--meson-source-dir', meson.current_source_dir() / '../..',
+                '--meson-build-dir', meson.project_build_root(),
+                '--name', integration_test['name'],
+                '--storage', integration_test['storage'],
+                '--firmware', integration_test['firmware'],
+                '--exit-code', integration_test['exit-code'].to_string(),
+                '--coredump-exclude-regex', integration_test['coredump-exclude-regex'],
+                '--sanitizer-exclude-regex', integration_test['sanitizer-exclude-regex'],
+        ]
+
+        if 'unit' in integration_test
+                integration_test_args += ['--unit', fs.name(integration_test['unit'])]
+        else
+                integration_test_args += ['--unit', '@0@.service'.format(integration_test['name'])]
+        endif
+
+        if integration_test['vm']
+                integration_test_args += ['--vm']
+        endif
+
+        if integration_test['rtc']
+                integration_test_args += ['--rtc']
+        endif
+
+        if not mkosi.found()
+                continue
+        endif
+
+        integration_test_args += ['--mkosi', mkosi.full_path(), '--']
+
+        if integration_test['cmdline'].length() > 0
+                integration_test_args += [
+                        '--kernel-command-line-extra=@0@'.format(' '.join(integration_test['cmdline']))
+                ]
+        endif
+
+        foreach credential : integration_test['credentials']
+                integration_test_args += ['--credential', credential]
+        endforeach
+
+        if integration_test['qemu-args'].length() > 0
+                integration_test_args += ['--qemu-args=@0@'.format(' '.join(integration_test['qemu-args']))]
+        endif
+
+        integration_test_args += integration_test['mkosi-args']
+
+        integration_test_env = {}
+
+        if want_integration_tests
+                integration_test_env += {'SYSTEMD_INTEGRATION_TESTS': '1'}
+        endif
+
+        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
diff --git a/test/integration-tests/standalone/meson.build b/test/integration-tests/standalone/meson.build
new file mode 100644 (file)
index 0000000..76d11af
--- /dev/null
@@ -0,0 +1,23 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+# This meson file can be used to run the integration tests without having to install any other dependencies
+# as follows:
+#
+# mkosi -f sandbox -- meson setup testsuite test/integration-tests/standalone
+# mkosi genkey
+# mkosi -f
+# mkosi sandbox -- meson test -C testsuite
+#
+project('systemd-testsuite',
+        version : files('../../../meson.version'),
+        license : 'LGPLv2+',
+        default_options: ['warning_level=2'],
+        meson_version : '>= 0.62.0',
+)
+
+fs = import('fs')
+mkosi = find_program('mkosi', required : true)
+want_integration_tests = true
+
+# meson refuses .. in subdir() so we use a symlink to trick it into accepting it anyway.
+subdir('integration-tests')
index f5f4d8d85eceb8f68991dbf5b02eb00a1b292a44..9ec9e515e9c94e73fe71534c46deaa43ea42f130 100644 (file)
@@ -278,199 +278,60 @@ endif
 ############################################################
 
 if want_tests != 'false'
-        integration_test_wrapper = find_program('integration-test-wrapper.py')
-        integration_tests = []
-        integration_test_template = {
-                'mkosi-args' : [],
-                'timeout' : 1800,
-                'storage' : 'volatile',
-                'priority' : 0,
-                'firmware' : 'linux',
-                'enabled' : true,
-                'configuration' : {
-                        'memory-accounting' : 'no',
-                        'command' : testdata_dir / 'units/%N.sh',
-                        'wants' : 'multi-user.target user@4711.service',
-                        'after' : 'user@4711.service',
-                },
-                'cmdline' : [],
-                'credentials' : [],
-                'qemu-args' : [],
-                'exit-code' : 123,
-                'vm' : false,
-                'coredump-exclude-regex' : '',
-                'sanitizer-exclude-regex' : '',
-                'rtc' : 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',
-        ]
-
-        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',
-                'TEST-85-NETWORK',
-                'TEST-86-MULTI-PROFILE-UKI',
-                'TEST-87-AUX-UTILS-VM',
-        ]
-                subdir(dirname)
-        endforeach
+        subdir('integration-tests')
+endif
 
+if install_tests
         foreach integration_test : integration_tests
-                integration_test_args = [
-                        '--meson-source-dir', meson.project_source_root(),
-                        '--meson-build-dir', meson.project_build_root(),
-                        '--name', integration_test['name'],
-                        '--storage', integration_test['storage'],
-                        '--firmware', integration_test['firmware'],
-                        '--exit-code', integration_test['exit-code'].to_string(),
-                        '--coredump-exclude-regex', integration_test['coredump-exclude-regex'],
-                        '--sanitizer-exclude-regex', integration_test['sanitizer-exclude-regex'],
-                ]
-
                 if 'unit' in integration_test
                         integration_test_unit = integration_test['unit']
                 else
+                        integration_test_unit_env = []
+
+                        foreach key, value : integration_test['configuration']['env']
+                                integration_test_unit_env += [f'@key@=@value@']
+                        endforeach
+
                         integration_test_unit = configure_file(
                                 input : 'test.service.in',
                                 output : '@0@.service'.format(integration_test['name']),
-                                configuration : integration_test['configuration'],
+                                configuration : integration_test['configuration'] + {
+                                        'env' : ' '.join(integration_test_unit_env)
+                                },
                         )
                 endif
 
-                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['vm']
-                        integration_test_args += ['--vm']
-                endif
-
-                if integration_test['rtc']
-                        integration_test_args += ['--rtc']
-                endif
-
-                if not mkosi.found()
-                        continue
-                endif
-
-                integration_test_args += ['--mkosi', mkosi.full_path(), '--']
-
-                if integration_test['cmdline'].length() > 0
-                        integration_test_args += [
-                                '--kernel-command-line-extra=@0@'.format(' '.join(integration_test['cmdline']))
-                        ]
-                endif
-
-                foreach credential : integration_test['credentials']
-                        integration_test_args += ['--credential', credential]
-                endforeach
-
-                if integration_test['qemu-args'].length() > 0
-                        integration_test_args += ['--qemu-args=@0@'.format(' '.join(integration_test['qemu-args']))]
-                endif
-
-                integration_test_args += integration_test['mkosi-args']
-
-                integration_test_env = {}
-
-                if want_integration_tests
-                        integration_test_env += {'SYSTEMD_INTEGRATION_TESTS': '1'}
-                endif
-
-                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
-endif
 
-if install_tests
+        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',
+                'integration-tests/TEST-07-PID1/TEST-07-PID1.units',
+                'integration-tests/TEST-03-JOBS/TEST-03-JOBS.units',
+                'integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units',
+                'integration-tests/TEST-06-SELINUX/TEST-06-SELINUX.units',
+                'integration-tests/TEST-16-EXTEND-TIMEOUT/TEST-16-EXTEND-TIMEOUT.units',
+                'integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units',
+                'integration-tests/TEST-30-ONCLOCKCHANGE/TEST-30-ONCLOCKCHANGE.units',
+                'integration-tests/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units',
+                'integration-tests/TEST-63-PATH/TEST-63-PATH.units',
+                'integration-tests/TEST-74-AUX-UTILS/TEST-74-AUX-UTILS.units',
+                'integration-tests/TEST-80-NOTIFYACCESS/TEST-80-NOTIFYACCESS.units',
+        ]
+
         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.
index 0c3bd28c6b8d9e6b5fc2d40199333d13f52d9bbc..223df0399a4a39d07c2e8189a52f265d74636459 100644 (file)
@@ -9,4 +9,4 @@ ExecStartPre=rm -f /failed /testok
 ExecStart=@command@
 Type=oneshot
 MemoryAccounting=@memory-accounting@
-Environment=SYSTEMD_PAGER=
+Environment=SYSTEMD_PAGER= @env@