2020-11-09 07:23:58 +03:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2017-11-18 20:32:01 +03:00
2020-07-14 12:35:29 +03:00
if install_tests
2023-03-22 15:42:40 +03:00
foreach subdir : [
'auxv' ,
'journal-data' ,
2024-05-01 12:54:17 +03:00
'knot-data' ,
2024-03-22 14:08:52 +03:00
'test-journals' ,
2023-03-22 15:42:40 +03:00
'units' ,
'test-execute' ,
'test-fstab-generator' ,
'test-path' ,
'test-path-util' ,
'test-umount' ,
2023-03-29 13:15:24 +03:00
'test-network' ,
2023-03-22 15:42:40 +03:00
'test-network-generator-conversion' ,
'testsuite-03.units' ,
'testsuite-04.units' ,
'testsuite-06.units' ,
2023-05-10 14:41:03 +03:00
'testsuite-07.units' ,
2023-03-22 15:42:40 +03:00
'testsuite-16.units' ,
2023-05-10 15:02:54 +03:00
'testsuite-23.units' ,
2023-03-22 15:42:40 +03:00
'testsuite-30.units' ,
'testsuite-52.units' ,
'testsuite-63.units' ,
'testsuite-80.units' ,
]
2024-05-04 16:08:02 +03:00
# install_subdir() before meson 1.3.0 does not handle symlinks correctly (it follows them
# instead of copying the symlink) so we use rsync instead.
if meson . version ( ) . version_compare ( '<1.3.0' )
if not rsync . found ( )
error ( 'rsync is required to install the integration test data' )
endif
rsync_r = rsync . full_path ( ) + ' -rlpt --exclude .gitattributes --exclude 25-default.link -- "@0@" "${DESTDIR:-}@1@"'
2023-08-16 22:22:57 +03:00
meson . add_install_script ( sh , '-c' ,
rsync_r . format ( meson . current_source_dir ( ) / subdir , testdata_dir ) )
else
install_subdir ( subdir ,
2024-05-04 16:08:02 +03:00
exclude_files : [ '.gitattributes' , '25-default.link' ] ,
install_dir : testdata_dir ,
follow_symlinks : false )
2023-08-16 22:22:57 +03:00
endif
2023-03-22 15:42:40 +03:00
endforeach
2019-12-08 13:24:39 +03:00
2024-05-04 16:08:02 +03:00
# test-network/conf/25-default.link is a local symlink that becomes dangling when installed, so we
# exclude it and create the correct symlink here.
meson . add_install_script ( sh , '-c' , ln_s . format ( networkdir / '99-default.link' ,
testdata_dir / 'test-network/conf/25-default.link' ) )
2021-05-19 15:14:58 +03:00
install_data ( kbd_model_map ,
install_dir : testdata_dir + '/test-keymap-util' )
2023-03-02 17:41:17 +03:00
if conf . get ( 'HAVE_ZSTD' ) == 1 and efi_arch != ''
2021-12-10 13:55:38 +03:00
install_subdir ( 'test-bcd' ,
exclude_files : '.gitattributes' ,
install_dir : testdata_dir )
endif
2020-07-14 12:35:29 +03:00
if conf . get ( 'ENABLE_RESOLVE' ) == 1
install_subdir ( 'test-resolve' ,
2021-12-10 01:16:19 +03:00
exclude_files : '.gitattributes' ,
2020-07-14 12:35:29 +03:00
install_dir : testdata_dir )
endif
2019-12-10 18:05:48 +03:00
2023-03-17 16:18:50 +03:00
# The unit tests implemented as shell scripts expect to find testdata/
# in the directory where they are stored.
2023-08-08 04:38:47 +03:00
meson . add_install_script ( sh , '-c' , ln_s . format ( testdata_dir ,
unittestsdir / 'testdata' ) )
2017-04-14 03:47:20 +03:00
endif
2023-06-25 21:46:05 +03:00
############################################################
if conf . get ( 'ENABLE_SYSUSERS' ) == 1
test_sysusers_sh = configure_file (
input : 'test-sysusers.sh.in' ,
output : 'test-sysusers.sh' ,
configuration : conf )
if want_tests != 'false'
exe = executables_by_name . get ( 'systemd-sysusers' )
test ( 'test-sysusers' ,
test_sysusers_sh ,
# https://github.com/mesonbuild/meson/issues/2681
args : exe . full_path ( ) ,
2023-06-26 19:28:32 +03:00
depends : exe ,
suite : 'sysusers' )
2023-06-25 21:46:05 +03:00
if have_standalone_binaries
exe = executables_by_name . get ( 'systemd-sysusers.standalone' )
test ( 'test-sysusers.standalone' ,
test_sysusers_sh ,
# https://github.com/mesonbuild/meson/issues/2681
args : exe . full_path ( ) ,
2023-06-26 19:28:32 +03:00
depends : exe ,
suite : 'sysusers' )
2023-06-25 21:46:05 +03:00
endif
endif
if install_tests
install_data ( test_sysusers_sh ,
install_dir : unittestsdir )
install_subdir ( 'test-sysusers' ,
exclude_files : '.gitattributes' ,
install_dir : testdata_dir )
endif
endif
2020-12-31 22:56:02 +03:00
############################################################
2023-06-25 21:46:05 +03:00
if want_tests != 'false' and conf . get ( 'ENABLE_HWDB' ) == 1
hwdb_test_sh = find_program ( 'hwdb-test.sh' )
exe = executables_by_name . get ( 'systemd-hwdb' )
test ( 'hwdb-test' ,
hwdb_test_sh ,
suite : 'dist' ,
args : exe . full_path ( ) ,
depends : exe ,
timeout : 90 )
endif
############################################################
if want_tests != 'false'
test_systemctl_enable_sh = find_program ( 'test-systemctl-enable.sh' )
systemctl = executables_by_name . get ( 'systemctl' )
systemd_id128 = executables_by_name . get ( 'systemd-id128' )
test ( 'test-systemctl-enable' ,
test_systemctl_enable_sh ,
# https://github.com/mesonbuild/meson/issues/2681
args : [ systemctl . full_path ( ) ,
systemd_id128 . full_path ( ) ] ,
2023-06-26 19:28:32 +03:00
depends : [ systemctl , systemd_id128 ] ,
suite : 'systemctl' )
2023-06-25 21:46:05 +03:00
endif
############################################################
if want_tests != 'false' and conf . get ( 'HAVE_SYSV_COMPAT' ) == 1
sysv_generator_test_py = find_program ( 'sysv-generator-test.py' )
exe = executables_by_name . get ( 'systemd-sysv-generator' )
test ( 'sysv-generator-test' ,
sysv_generator_test_py ,
2023-06-26 19:28:32 +03:00
depends : exe ,
suite : 'sysv' )
2023-06-25 21:46:05 +03:00
endif
############################################################
2023-10-25 17:45:06 +03:00
if want_tests != 'false' and conf . get ( 'HAVE_BLKID' ) == 1
2023-06-25 21:46:05 +03:00
test_bootctl_json_sh = find_program ( 'test-bootctl-json.sh' )
exe = executables_by_name . get ( 'bootctl' )
test ( 'test-bootctl-json' ,
test_bootctl_json_sh ,
args : exe . full_path ( ) ,
2023-06-26 19:28:32 +03:00
depends : exe ,
suite : 'boot' )
2023-06-25 21:46:05 +03:00
endif
############################################################
if want_tests != 'false' and conf . get ( 'ENABLE_TMPFILES' ) == 1
test_systemd_tmpfiles_py = find_program ( 'test-systemd-tmpfiles.py' )
exe = executables_by_name . get ( 'systemd-tmpfiles' )
test ( 'test-systemd-tmpfiles' ,
test_systemd_tmpfiles_py ,
args : exe . full_path ( ) ,
2023-06-26 19:28:32 +03:00
depends : exe ,
suite : 'tmpfiles' )
2023-06-25 21:46:05 +03:00
if have_standalone_binaries
exe = executables_by_name . get ( 'systemd-tmpfiles.standalone' )
test ( 'test-systemd-tmpfiles.standalone' ,
test_systemd_tmpfiles_py ,
args : exe . full_path ( ) ,
2023-06-26 19:28:32 +03:00
depends : exe ,
suite : 'tmpfiles' )
2023-06-25 21:46:05 +03:00
endif
2020-09-26 12:58:24 +03:00
endif
############################################################
2022-05-18 11:40:54 +03:00
test_compare_versions_sh = files ( 'test-compare-versions.sh' )
2023-06-25 21:46:05 +03:00
if want_tests != 'false'
exe = executables_by_name . get ( 'systemd-analyze' )
test ( 'test-compare-versions' ,
test_compare_versions_sh ,
args : exe . full_path ( ) ,
2023-06-26 19:28:32 +03:00
depends : exe ,
suite : 'test' )
2023-06-25 21:46:05 +03:00
endif
2022-05-18 11:40:54 +03:00
if install_tests
install_data ( test_compare_versions_sh ,
2023-01-26 18:07:17 +03:00
install_dir : unittestsdir )
2022-05-18 11:40:54 +03:00
endif
############################################################
2017-11-22 14:42:28 +03:00
rule_syntax_check_py = find_program ( 'rule-syntax-check.py' )
2018-09-12 12:08:49 +03:00
if want_tests != 'false'
test ( 'rule-syntax-check' ,
rule_syntax_check_py ,
2023-05-18 18:16:33 +03:00
suite : 'dist' ,
2018-09-12 12:08:49 +03:00
args : all_rules )
2023-06-25 21:46:05 +03:00
exe = executables_by_name . get ( 'udevadm' )
test ( 'udev-rules-check' ,
exe ,
2023-06-26 19:28:32 +03:00
suite : 'udev' ,
2023-06-25 21:46:05 +03:00
args : [ 'verify' , '--resolve-names=never' , all_rules ] )
2018-09-12 12:08:49 +03:00
endif
2017-11-22 14:42:28 +03:00
############################################################
tests: add a runner for installed tests
We have "installed tests", but don't provide an easy way to run them.
The protocol is very simple: each test must return 0 for success, 77 means
"skipped", anything else is an error. In addition, we want to print test
output only if the test failed.
I wrote this simple script. It is pretty basic, but implements the functions
listed above. Since it is written in python it should be easy to add option
parsing (like running only specific tests, or running unsafe tests, etc.)
I looked at the following alternatives:
- Ubuntu root-unittests: this works, but just dumps all output to the terminal,
has no coloring.
- @ssahani's test runner [2]
It uses the unittest library and the test suite was implented as a class, and
doesn't implement any of the functions listed above.
- cram [3,4]
cram runs our tests, but does not understand the "ignore the output" part,
has not support for our magic skip code (it uses hardcoded 80 instead),
and seems dead upstream.
- meson test
Here the idea would be to provide an almost-empty meson.build file under
/usr/lib/systemd/tests/ that would just define all the tests. This would
allow us to reuse the test runner we use normally. Unfortunately meson requires
a build directory and configuration to be done before running tests. This
would be possible, but seems a lot of effort to just run a few binaries.
[1] https://salsa.debian.org/systemd-team/systemd/blob/242c96addb06480ec9cd75248a5660f37a17b4b9/debian/tests/root-unittests
[2] https://github.com/systemd/systemd-fedora-ci/blob/master/upstream/systemd-upstream-tests.py
[3] https://bitheap.org/cram/
[4] https://pypi.org/project/pytest-cram/
Fixes #10069.
2018-09-20 17:34:14 +03:00
if install_tests
install_data ( 'run-unit-tests.py' ,
install_mode : 'rwxr-xr-x' ,
install_dir : testsdir )
2023-06-25 21:46:05 +03:00
endif
############################################################
2021-10-20 20:43:34 +03:00
2023-06-25 21:46:05 +03:00
test_fstab_generator_sh = find_program ( 'test-fstab-generator.sh' )
if want_tests != 'false'
exe = executables_by_name . get ( 'systemd-fstab-generator' )
test ( 'test-fstab-generator' ,
test_fstab_generator_sh ,
# https://github.com/mesonbuild/meson/issues/2681
args : exe . full_path ( ) ,
env : test_env ,
2023-06-26 19:28:32 +03:00
depends : exe ,
suite : 'fstab' )
2023-06-25 21:46:05 +03:00
endif
if install_tests
2022-01-06 14:12:27 +03:00
install_data ( 'test-fstab-generator.sh' ,
install_mode : 'rwxr-xr-x' ,
2023-01-26 18:07:17 +03:00
install_dir : unittestsdir )
2023-06-25 21:46:05 +03:00
endif
############################################################
2022-01-06 14:12:27 +03:00
2023-06-25 21:46:05 +03:00
test_network_generator_conversion_sh = find_program ( 'test-network-generator-conversion.sh' )
if want_tests != 'false'
exe = executables_by_name . get ( 'systemd-network-generator' )
test ( 'test-network-generator-conversion' ,
test_network_generator_conversion_sh ,
# https://github.com/mesonbuild/meson/issues/2681
args : exe . full_path ( ) ,
2023-06-26 19:28:32 +03:00
depends : exe ,
suite : 'network' )
2023-06-25 21:46:05 +03:00
endif
if install_tests
2022-01-06 13:04:54 +03:00
install_data ( 'test-network-generator-conversion.sh' ,
install_mode : 'rwxr-xr-x' ,
2023-01-26 18:07:17 +03:00
install_dir : unittestsdir )
tests: add a runner for installed tests
We have "installed tests", but don't provide an easy way to run them.
The protocol is very simple: each test must return 0 for success, 77 means
"skipped", anything else is an error. In addition, we want to print test
output only if the test failed.
I wrote this simple script. It is pretty basic, but implements the functions
listed above. Since it is written in python it should be easy to add option
parsing (like running only specific tests, or running unsafe tests, etc.)
I looked at the following alternatives:
- Ubuntu root-unittests: this works, but just dumps all output to the terminal,
has no coloring.
- @ssahani's test runner [2]
It uses the unittest library and the test suite was implented as a class, and
doesn't implement any of the functions listed above.
- cram [3,4]
cram runs our tests, but does not understand the "ignore the output" part,
has not support for our magic skip code (it uses hardcoded 80 instead),
and seems dead upstream.
- meson test
Here the idea would be to provide an almost-empty meson.build file under
/usr/lib/systemd/tests/ that would just define all the tests. This would
allow us to reuse the test runner we use normally. Unfortunately meson requires
a build directory and configuration to be done before running tests. This
would be possible, but seems a lot of effort to just run a few binaries.
[1] https://salsa.debian.org/systemd-team/systemd/blob/242c96addb06480ec9cd75248a5660f37a17b4b9/debian/tests/root-unittests
[2] https://github.com/systemd/systemd-fedora-ci/blob/master/upstream/systemd-upstream-tests.py
[3] https://bitheap.org/cram/
[4] https://pypi.org/project/pytest-cram/
Fixes #10069.
2018-09-20 17:34:14 +03:00
endif
############################################################
2023-05-05 15:46:34 +03:00
sys_script_py = files ( 'sys-script.py' )
test_udev_py = files ( 'test-udev.py' )
2023-06-26 02:52:26 +03:00
if want_tests != 'false'
exe = executables_by_name . get ( 'test-udev-rule-runner' )
test ( 'test-udev' ,
test_udev_py ,
args : [ '-v' ] ,
env : [ 'UDEV_RULE_RUNNER=' + exe . full_path ( ) ] ,
depends : exe ,
2023-06-26 19:28:32 +03:00
timeout : 180 ,
suite : 'udev' )
2023-06-26 02:52:26 +03:00
endif
2023-05-05 15:46:34 +03:00
if install_tests
install_data (
sys_script_py ,
test_udev_py ,
install_dir : unittestsdir )
test: rewrite udev-test.pl in Python
I tried to keep this a 1:1 rewrite with the same field names.
Nevertheless, some changes were made:
- exp_add_error and exp_rem_error are dropped. Those fields meant that
"./test-udev add <devpath>" actually succeeded, but symlinks were not
created, and exp_links was ignored and could contain bogus content.
Instead, exp_links and not_exp_links are adjusted to not contain
garbage and the tests check that "./test-udev add" succeeds and that
the links are as expected from exp_links and not_exp_links.
- cleanup was only used in one rule, and that rule was expected to fail,
so cleanup wasn't actually necessary. So the cleanup field and the
logic to call cleanup from individual tests is removed.
- a bunch of fields were set, but didn't seem to be connected to any
implementation: not_exp_name, not_exp_test.
e62acc3159935781f05fa59c48e5a74e85c61ce2 did a rewrite of some of the
tests and it seems that not_exp_test was added by mistake and
not_exp_name was left behind by mistake.
In Python, the field list is declared in the class, so it's harder to
assign an unused attribute. Those uses were converted to not_exp_links.
- in most rules, r"""…""" is used, so that escaping is not necessary.
- the logic to generate devices was only used in one place, and the
generator function also had provisions to handle arguments that were
never given. all_block_devs() is made much simpler.
- Descriptions that started with a capital letter were shortened
and lowercased.
- no special test case counting is done. pytest just counts the cases
(Rules objects).
- the output for failures is also removed. If something goes wrong, the
user can use pytest --pdb or such to debug the issue.
- perl version used a semaphore to manage udev runners, and would fork,
optionally wait a bit, and then start the runner. In the python
version, we just spawn them all and wait for them to exit. It's not
very convenient to call fork() from python, so instead the runner
was modified (in previous commit) to wait.
The test can be called as:
(cd build && sudo pytest -v ../test/udev-test.py)
sudo meson test -C build udev-test.py -v
I think this generally provides functionality that is close to the perl
version. It seems some of the checks are now more fully implemented.
Support for strace/gdb/valgrind is missing.
Runtime goes down: 8.36 s → 5.78 s.
2023-05-04 23:40:38 +03:00
endif
2020-12-16 14:21:43 +03:00
############################################################
2022-03-03 22:30:43 +03:00
rpm = find_program ( 'rpm' , required : false )
rpmspec = find_program ( 'rpmspec' , required : false )
test_rpm_macros = find_program ( 'test-rpm-macros.sh' )
if rpm . found ( ) and rpmspec . found ( )
if want_tests != 'false'
test ( 'test-rpm-macros' ,
test_rpm_macros ,
2023-05-18 18:16:33 +03:00
suite : 'dist' ,
2022-03-03 22:30:43 +03:00
args : [ project_build_root ] )
endif
else
message ( 'Skipping test-rpm-macros since rpm and/or rpmspec are not available' )
endif
############################################################
2023-07-30 00:32:53 +03:00
if want_tests != 'false' and conf . get ( 'HAVE_DMI' ) == 1
2020-12-02 14:40:42 +03:00
udev_dmi_memory_id_test = find_program ( 'udev-dmi-memory-id-test.sh' )
2023-06-25 23:01:03 +03:00
exe = executables_by_name . get ( 'dmi_memory_id' )
2020-12-16 14:21:43 +03:00
2023-03-02 00:54:06 +03:00
if git . found ( ) and fs . is_dir ( project_source_root / '.git' )
2020-12-16 14:21:43 +03:00
out = run_command (
2021-05-14 15:16:17 +03:00
env , '-u' , 'GIT_WORK_TREE' ,
git , '--git-dir=@0@/.git' . format ( project_source_root ) ,
2022-01-11 12:56:22 +03:00
'ls-files' , ':/test/dmidecode-dumps/*.bin' ,
check : true )
2020-12-16 14:21:43 +03:00
else
out = run_command (
2022-05-15 18:11:24 +03:00
sh , '-c' , 'cd "$1"; echo test/dmidecode-dumps/*.bin' , '_' , project_source_root ,
2022-01-11 12:56:22 +03:00
check : true )
2020-12-16 14:21:43 +03:00
endif
foreach p : out . stdout ( ) . split ( )
2021-07-27 20:32:35 +03:00
source = project_source_root / p
2023-06-14 17:05:52 +03:00
test ( 'dmidecode_' + fs . stem ( p ) ,
2020-12-16 14:21:43 +03:00
udev_dmi_memory_id_test ,
2023-06-26 19:28:32 +03:00
suite : 'udev' ,
2023-06-25 23:01:03 +03:00
args : [ exe . full_path ( ) ,
2021-07-27 18:48:53 +03:00
source ,
2022-01-21 17:28:23 +03:00
source + '.txt' ] ,
2023-06-25 23:01:03 +03:00
depends : exe )
2020-12-16 14:21:43 +03:00
endforeach
2020-12-02 14:40:42 +03:00
endif
2023-06-25 21:46:05 +03:00
############################################################
if want_tests != 'false' and conf . get ( 'ENABLE_KERNEL_INSTALL' ) == 1
kernel_install = executables_by_name . get ( 'kernel-install' )
args = [ kernel_install . full_path ( ) , loaderentry_install . full_path ( ) , uki_copy_install ]
deps = [ kernel_install , loaderentry_install ]
if want_ukify and boot_stubs . length ( ) > 0
args + = [ ukify . full_path ( ) , ukify_install . full_path ( ) , boot_stubs [ 0 ] ]
deps + = [ ukify , ukify_install , boot_stubs [ 0 ] ]
endif
test ( 'test-kernel-install' ,
test_kernel_install_sh ,
env : test_env ,
args : args ,
2023-06-26 19:28:32 +03:00
depends : deps ,
suite : 'kernel-install' )
2023-06-25 21:46:05 +03:00
endif
2024-04-05 19:19:59 +03:00
############################################################
2024-04-24 22:18:27 +03:00
integration_test_wrapper = find_program ( 'integration-test-wrapper.py' )
integration_tests = {
'01' : 'TEST-01-BASIC' ,
'02' : 'TEST-02-UNITTESTS' ,
2024-04-18 12:39:00 +03:00
'03' : 'TEST-03-JOBS' ,
2024-05-01 10:37:55 +03:00
'04' : 'TEST-04-JOURNAL' ,
2024-04-18 12:39:00 +03:00
'05' : 'TEST-05-RLIMITS' ,
2024-04-30 19:39:52 +03:00
'06' : 'TEST-06-SELINUX' ,
2024-05-01 10:37:55 +03:00
'07' : 'TEST-07-PID1' ,
2024-04-29 15:29:21 +03:00
# '08': 'TEST-08-INITRD',
2024-04-18 17:31:56 +03:00
'09' : 'TEST-09-REBOOT' ,
'13' : 'TEST-13-NSPAWN' ,
'15' : 'TEST-15-DROPIN' ,
2024-04-18 12:39:00 +03:00
'16' : 'TEST-16-EXTEND-TIMEOUT' ,
2024-05-05 22:32:49 +03:00
'17' : 'TEST-17-UDEV' ,
2024-04-18 17:31:56 +03:00
'18' : 'TEST-18-FAILUREACTION' ,
2024-04-18 12:39:00 +03:00
'19' : 'TEST-19-CGROUP' ,
2024-05-01 10:37:55 +03:00
'21' : 'TEST-21-DFUZZER' ,
2024-04-18 17:31:56 +03:00
'22' : 'TEST-22-TMPFILES' ,
2024-05-01 10:37:55 +03:00
'23' : 'TEST-23-UNIT-FILE' ,
2024-04-29 15:29:21 +03:00
# '24': 'TEST-24-CRYPTSETUP',
2024-04-18 12:39:00 +03:00
'25' : 'TEST-25-IMPORT' ,
'26' : 'TEST-26-SYSTEMCTL' ,
2024-04-24 22:21:34 +03:00
'29' : 'TEST-29-PORTABLE' ,
2024-04-18 12:39:00 +03:00
'30' : 'TEST-30-ONCLOCKCHANGE' ,
2024-05-01 10:37:55 +03:00
'31' : 'TEST-31-DEVICE-ENUMERATION' ,
2024-04-18 12:39:00 +03:00
'32' : 'TEST-32-OOMPOLICY' ,
'34' : 'TEST-34-DYNAMICUSERMIGRATE' ,
2024-04-18 17:31:56 +03:00
'35' : 'TEST-35-LOGIN' ,
2024-04-18 12:39:00 +03:00
'36' : 'TEST-36-NUMAPOLICY' ,
'38' : 'TEST-38-FREEZER' ,
2024-04-24 22:21:34 +03:00
'43' : 'TEST-43-PRIVATEUSER-UNPRIV' ,
2024-04-18 12:39:00 +03:00
'44' : 'TEST-44-LOG-NAMESPACE' ,
'45' : 'TEST-45-TIMEDATE' ,
2024-05-01 10:37:55 +03:00
'46' : 'TEST-46-HOMED' ,
2024-04-24 22:21:34 +03:00
'50' : 'TEST-50-DISSECT' ,
2024-05-01 10:37:55 +03:00
'52' : 'TEST-52-HONORFIRSTSHUTDOWN' ,
'53' : 'TEST-53-ISSUE-16347' ,
2024-04-29 15:29:21 +03:00
# '54': 'TEST-54-CREDS',
2024-05-01 10:37:55 +03:00
'55' : 'TEST-55-OOMD' ,
'58' : 'TEST-58-REPART' ,
2024-04-18 12:39:00 +03:00
'59' : 'TEST-59-RELOADING-RESTART' ,
'60' : 'TEST-60-MOUNT-RATELIMIT' ,
'62' : 'TEST-62-RESTRICT-IFACES' ,
'63' : 'TEST-63-PATH' ,
2024-05-05 23:00:29 +03:00
# '64': 'TEST-64-UDEV-STORAGE',
2024-04-18 17:31:56 +03:00
'65' : 'TEST-65-ANALYZE' ,
2024-04-18 12:39:00 +03:00
'66' : 'TEST-66-DEVICE-ISOLATION' ,
'67' : 'TEST-67-INTEGRITY' ,
'68' : 'TEST-68-PROPAGATE-EXIT-STATUS' ,
2024-05-05 22:59:01 +03:00
# '69': 'TEST-69-SHUTDOWN',
2024-04-18 17:31:56 +03:00
'70' : 'TEST-70-TPM2' ,
'71' : 'TEST-71-HOSTNAME' ,
2024-04-18 12:39:00 +03:00
'72' : 'TEST-72-SYSUPDATE' ,
2024-05-01 10:37:55 +03:00
'73' : 'TEST-73-LOCALE' ,
'74' : 'TEST-74-AUX-UTILS' ,
'75' : 'TEST-75-RESOLVED' ,
2024-04-18 12:39:00 +03:00
'76' : 'TEST-76-SYSCTL' ,
'78' : 'TEST-78-SIGQUEUE' ,
'79' : 'TEST-79-MEMPRESS' ,
'80' : 'TEST-80-NOTIFYACCESS' ,
'81' : 'TEST-81-GENERATORS' ,
2024-04-29 15:29:21 +03:00
# '82': 'TEST-82-SOFTREBOOT',
2024-04-18 17:31:56 +03:00
'83' : 'TEST-83-BTRFS' ,
2024-04-18 12:39:00 +03:00
'84' : 'TEST-84-STORAGETM' ,
2024-04-24 22:18:27 +03:00
}
foreach test_number , dirname : integration_tests
test_params = {
'mkosi_args' : [ ] ,
2024-04-29 17:01:57 +03:00
'timeout' : 1800 ,
2024-05-02 09:52:50 +03:00
'storage' : 'volatile' ,
2024-05-05 14:29:54 +03:00
'priority' : 0 ,
2024-05-05 19:14:44 +03:00
'firmware' : 'linux' ,
2024-05-07 16:20:44 +03:00
'slow' : false ,
2024-04-05 19:19:59 +03:00
}
2024-04-19 10:17:58 +03:00
2024-04-24 22:18:27 +03:00
# 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
args = [
'--meson-source-dir' , meson . project_source_root ( ) ,
'--meson-build-dir' , meson . project_build_root ( ) ,
'--test-name' , dirname ,
'--test-number' , test_number ,
2024-04-30 20:06:00 +03:00
'--storage' , test_params [ 'storage' ] ,
2024-05-05 19:14:44 +03:00
'--firmware' , test_params [ 'firmware' ] ,
2024-05-07 16:20:44 +03:00
]
if test_params [ 'slow' ]
args + = [ '--slow' ]
endif
args + = [ '--' ] + test_params [ 'mkosi_args' ]
2024-04-24 22:18:27 +03:00
2024-05-02 21:21:29 +03:00
integration_test_env = { }
if want_integration_tests
2024-05-07 16:20:44 +03:00
integration_test_env + = { 'SYSTEMD_INTEGRATION_TESTS' : '1' }
endif
if want_slow_tests
integration_test_env + = { 'SYSTEMD_SLOW_TESTS' : '1' }
2024-05-02 21:21:29 +03:00
endif
2024-04-24 22:18:27 +03:00
# 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 ,
2024-05-02 09:52:50 +03:00
integration_test_wrapper ,
2024-05-02 21:21:29 +03:00
env : integration_test_env ,
2024-05-02 09:52:50 +03:00
args : args ,
timeout : test_params [ 'timeout' ] ,
2024-05-05 14:29:54 +03:00
priority : test_params [ 'priority' ] ,
2024-05-02 09:52:50 +03:00
suite : 'integration-tests' )
2024-04-24 22:18:27 +03:00
endforeach