From 5748f13e547baa12a83cb3c3530ec1d6c99906c7 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 11 May 2024 15:55:54 +0200 Subject: [PATCH] test: Rework integration test definitions Let's make this behave more like all the rest of the meson stuff. This also is the first step to making it a bit more flexible so we can define integration tests in different ways as will be seen in the next commits. --- test/TEST-01-BASIC/meson.build | 7 + test/TEST-02-UNITTESTS/meson.build | 16 +- test/TEST-03-JOBS/meson.build | 7 + test/TEST-04-JOURNAL/meson.build | 11 +- test/TEST-05-RLIMITS/meson.build | 7 + test/TEST-06-SELINUX/meson.build | 15 +- test/TEST-07-PID1/meson.build | 7 + test/TEST-09-REBOOT/meson.build | 13 +- test/TEST-13-NSPAWN/meson.build | 7 + test/TEST-15-DROPIN/meson.build | 7 + test/TEST-16-EXTEND-TIMEOUT/meson.build | 7 + test/TEST-17-UDEV/meson.build | 7 + test/TEST-18-FAILUREACTION/meson.build | 11 +- test/TEST-19-CGROUP/meson.build | 7 + test/TEST-21-DFUZZER/meson.build | 13 +- test/TEST-22-TMPFILES/meson.build | 7 + test/TEST-23-UNIT-FILE/meson.build | 7 + test/TEST-25-IMPORT/meson.build | 7 + test/TEST-26-SYSTEMCTL/meson.build | 7 + test/TEST-29-PORTABLE/meson.build | 7 + test/TEST-30-ONCLOCKCHANGE/meson.build | 7 + test/TEST-31-DEVICE-ENUMERATION/meson.build | 7 + test/TEST-32-OOMPOLICY/meson.build | 7 + test/TEST-34-DYNAMICUSERMIGRATE/meson.build | 7 + test/TEST-35-LOGIN/meson.build | 7 + test/TEST-36-NUMAPOLICY/meson.build | 7 + test/TEST-38-FREEZER/meson.build | 7 + test/TEST-43-PRIVATEUSER-UNPRIV/meson.build | 7 + test/TEST-44-LOG-NAMESPACE/meson.build | 7 + test/TEST-45-TIMEDATE/meson.build | 7 + test/TEST-46-HOMED/meson.build | 7 + test/TEST-50-DISSECT/meson.build | 7 + test/TEST-52-HONORFIRSTSHUTDOWN/meson.build | 7 + test/TEST-53-ISSUE-16347/meson.build | 13 +- test/TEST-55-OOMD/meson.build | 13 +- test/TEST-58-REPART/meson.build | 7 + test/TEST-59-RELOADING-RESTART/meson.build | 7 + test/TEST-60-MOUNT-RATELIMIT/meson.build | 7 + test/TEST-62-RESTRICT-IFACES/meson.build | 7 + test/TEST-63-PATH/meson.build | 7 + test/TEST-65-ANALYZE/meson.build | 7 + test/TEST-66-DEVICE-ISOLATION/meson.build | 7 + test/TEST-67-INTEGRITY/meson.build | 7 + .../TEST-68-PROPAGATE-EXIT-STATUS/meson.build | 7 + test/TEST-70-TPM2/meson.build | 7 + test/TEST-71-HOSTNAME/meson.build | 7 + test/TEST-72-SYSUPDATE/meson.build | 7 + test/TEST-73-LOCALE/meson.build | 7 + test/TEST-74-AUX-UTILS/meson.build | 9 +- test/TEST-75-RESOLVED/meson.build | 7 + test/TEST-76-SYSCTL/meson.build | 7 + test/TEST-78-SIGQUEUE/meson.build | 7 + test/TEST-79-MEMPRESS/meson.build | 7 + test/TEST-80-NOTIFYACCESS/meson.build | 7 + test/TEST-81-GENERATORS/meson.build | 7 + test/TEST-83-BTRFS/meson.build | 7 + test/TEST-84-STORAGETM/meson.build | 7 + test/meson.build | 195 +++++++++--------- 58 files changed, 506 insertions(+), 139 deletions(-) create mode 100644 test/TEST-01-BASIC/meson.build create mode 100644 test/TEST-03-JOBS/meson.build create mode 100644 test/TEST-05-RLIMITS/meson.build create mode 100644 test/TEST-07-PID1/meson.build create mode 100644 test/TEST-13-NSPAWN/meson.build create mode 100644 test/TEST-15-DROPIN/meson.build create mode 100644 test/TEST-16-EXTEND-TIMEOUT/meson.build create mode 100644 test/TEST-17-UDEV/meson.build create mode 100644 test/TEST-19-CGROUP/meson.build create mode 100644 test/TEST-22-TMPFILES/meson.build create mode 100644 test/TEST-23-UNIT-FILE/meson.build create mode 100644 test/TEST-25-IMPORT/meson.build create mode 100644 test/TEST-26-SYSTEMCTL/meson.build create mode 100644 test/TEST-29-PORTABLE/meson.build create mode 100644 test/TEST-30-ONCLOCKCHANGE/meson.build create mode 100644 test/TEST-31-DEVICE-ENUMERATION/meson.build create mode 100644 test/TEST-32-OOMPOLICY/meson.build create mode 100644 test/TEST-34-DYNAMICUSERMIGRATE/meson.build create mode 100644 test/TEST-35-LOGIN/meson.build create mode 100644 test/TEST-36-NUMAPOLICY/meson.build create mode 100644 test/TEST-38-FREEZER/meson.build create mode 100644 test/TEST-43-PRIVATEUSER-UNPRIV/meson.build create mode 100644 test/TEST-44-LOG-NAMESPACE/meson.build create mode 100644 test/TEST-45-TIMEDATE/meson.build create mode 100644 test/TEST-46-HOMED/meson.build create mode 100644 test/TEST-50-DISSECT/meson.build create mode 100644 test/TEST-52-HONORFIRSTSHUTDOWN/meson.build create mode 100644 test/TEST-58-REPART/meson.build create mode 100644 test/TEST-59-RELOADING-RESTART/meson.build create mode 100644 test/TEST-60-MOUNT-RATELIMIT/meson.build create mode 100644 test/TEST-62-RESTRICT-IFACES/meson.build create mode 100644 test/TEST-63-PATH/meson.build create mode 100644 test/TEST-65-ANALYZE/meson.build create mode 100644 test/TEST-66-DEVICE-ISOLATION/meson.build create mode 100644 test/TEST-67-INTEGRITY/meson.build create mode 100644 test/TEST-68-PROPAGATE-EXIT-STATUS/meson.build create mode 100644 test/TEST-70-TPM2/meson.build create mode 100644 test/TEST-71-HOSTNAME/meson.build create mode 100644 test/TEST-72-SYSUPDATE/meson.build create mode 100644 test/TEST-73-LOCALE/meson.build create mode 100644 test/TEST-75-RESOLVED/meson.build create mode 100644 test/TEST-76-SYSCTL/meson.build create mode 100644 test/TEST-78-SIGQUEUE/meson.build create mode 100644 test/TEST-79-MEMPRESS/meson.build create mode 100644 test/TEST-80-NOTIFYACCESS/meson.build create mode 100644 test/TEST-81-GENERATORS/meson.build create mode 100644 test/TEST-83-BTRFS/meson.build create mode 100644 test/TEST-84-STORAGETM/meson.build diff --git a/test/TEST-01-BASIC/meson.build b/test/TEST-01-BASIC/meson.build new file mode 100644 index 00000000000..257dadd8900 --- /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-02-UNITTESTS/meson.build b/test/TEST-02-UNITTESTS/meson.build index 5c3c0408583..89a3edf2ad2 100644 --- a/test/TEST-02-UNITTESTS/meson.build +++ b/test/TEST-02-UNITTESTS/meson.build @@ -1,15 +1,17 @@ # 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()), + 'mkosi_args' : integration_test_template['mkosi_args'] + [ + '''--kernel-command-line-extra= + frobnicate! systemd.setenv=TEST_CMDLINE_NEWLINE=foo systemd.setenv=TEST_CMDLINE_NEWLINE=bar ''', - ]), - ], -} + ], + }, +] diff --git a/test/TEST-03-JOBS/meson.build b/test/TEST-03-JOBS/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /dev/null +++ b/test/TEST-03-JOBS/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-04-JOURNAL/meson.build b/test/TEST-04-JOURNAL/meson.build index 7f5cc704c9d..184f70ab720 100644 --- a/test/TEST-04-JOURNAL/meson.build +++ b/test/TEST-04-JOURNAL/meson.build @@ -1,5 +1,10 @@ # 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', + }, +] diff --git a/test/TEST-05-RLIMITS/meson.build b/test/TEST-05-RLIMITS/meson.build new file mode 100644 index 00000000000..d8198fdef80 --- /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/TEST-06-SELINUX/meson.build b/test/TEST-06-SELINUX/meson.build index a62d144048e..408e41ff287 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()), + 'mkosi_args' : integration_test_template['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', + }, +] diff --git a/test/TEST-07-PID1/meson.build b/test/TEST-07-PID1/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /dev/null +++ b/test/TEST-07-PID1/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-09-REBOOT/meson.build b/test/TEST-09-REBOOT/meson.build index a511a829af2..c4b41bc97b5 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 00000000000..8dec5f37e73 --- /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-15-DROPIN/meson.build b/test/TEST-15-DROPIN/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /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/TEST-16-EXTEND-TIMEOUT/meson.build b/test/TEST-16-EXTEND-TIMEOUT/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /dev/null +++ b/test/TEST-16-EXTEND-TIMEOUT/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-17-UDEV/meson.build b/test/TEST-17-UDEV/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /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 e1bca2d7a83..5edfbcad1fb 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 00000000000..8dec5f37e73 --- /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 5a27fb2f3f3..aa6652910c7 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 00000000000..8dec5f37e73 --- /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/TEST-23-UNIT-FILE/meson.build b/test/TEST-23-UNIT-FILE/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /dev/null +++ b/test/TEST-23-UNIT-FILE/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-25-IMPORT/meson.build b/test/TEST-25-IMPORT/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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/TEST-30-ONCLOCKCHANGE/meson.build b/test/TEST-30-ONCLOCKCHANGE/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /dev/null +++ b/test/TEST-30-ONCLOCKCHANGE/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-31-DEVICE-ENUMERATION/meson.build b/test/TEST-31-DEVICE-ENUMERATION/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /dev/null +++ b/test/TEST-32-OOMPOLICY/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-34-DYNAMICUSERMIGRATE/meson.build b/test/TEST-34-DYNAMICUSERMIGRATE/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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/meson.build b/test/TEST-44-LOG-NAMESPACE/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /dev/null +++ b/test/TEST-44-LOG-NAMESPACE/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-45-TIMEDATE/meson.build b/test/TEST-45-TIMEDATE/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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/TEST-52-HONORFIRSTSHUTDOWN/meson.build b/test/TEST-52-HONORFIRSTSHUTDOWN/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /dev/null +++ b/test/TEST-52-HONORFIRSTSHUTDOWN/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-53-ISSUE-16347/meson.build b/test/TEST-53-ISSUE-16347/meson.build index 0b7644f4ad2..91b6f422747 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-55-OOMD/meson.build b/test/TEST-55-OOMD/meson.build index 86a0d8f9572..132a6b30808 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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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/TEST-63-PATH/meson.build b/test/TEST-63-PATH/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /dev/null +++ b/test/TEST-63-PATH/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-65-ANALYZE/meson.build b/test/TEST-65-ANALYZE/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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/TEST-70-TPM2/meson.build b/test/TEST-70-TPM2/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 7f5cc704c9d..43a733ee64e 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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /dev/null +++ b/test/TEST-79-MEMPRESS/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-80-NOTIFYACCESS/meson.build b/test/TEST-80-NOTIFYACCESS/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /dev/null +++ b/test/TEST-80-NOTIFYACCESS/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-81-GENERATORS/meson.build b/test/TEST-81-GENERATORS/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /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/TEST-83-BTRFS/meson.build b/test/TEST-83-BTRFS/meson.build new file mode 100644 index 00000000000..8dec5f37e73 --- /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 00000000000..8dec5f37e73 --- /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/meson.build b/test/meson.build index 30a0461f0d9..37c6a671ad8 100644 --- a/test/meson.build +++ b/test/meson.build @@ -344,102 +344,101 @@ 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, } -foreach test_number, dirname : integration_tests - test_params = { - 'mkosi_args' : [], - 'timeout' : 1800, - 'storage' : 'volatile', - 'priority' : 0, - 'firmware' : 'linux', - 'slow' : false, - } - # 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_number = integration_test['name'].split('-')[1] + + 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'], + '--test-name', integration_test['name'], + '--test-number', integration_test_number, + '--storage', integration_test['storage'], + '--firmware', integration_test['firmware'], ] - if test_params['slow'] - args += ['--slow'] + if integration_test['slow'] + integration_test_args += ['--slow'] endif - args += ['--'] + test_params['mkosi_args'] + integration_test_args += ['--'] + integration_test['mkosi_args'] integration_test_env = {} @@ -451,14 +450,16 @@ 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') + # 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