test: Disable tests via 'enabled' field

This allows doing other stuff with the test without actually defining
the test, such as generating a service unit automatically.
This commit is contained in:
Daan De Meyer 2024-05-11 20:22:10 +02:00
parent f483e08313
commit 4ce12c3933
7 changed files with 59 additions and 6 deletions

View file

@ -0,0 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
integration_tests += [
integration_test_template + {
'name' : fs.name(meson.current_source_dir()),
'enabled' : false,
},
]

View file

@ -0,0 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
integration_tests += [
integration_test_template + {
'name' : fs.name(meson.current_source_dir()),
'enabled' : false,
},
]

View file

@ -0,0 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
integration_tests += [
integration_test_template + {
'name' : fs.name(meson.current_source_dir()),
'enabled' : false,
},
]

View file

@ -0,0 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
integration_tests += [
integration_test_template + {
'name' : fs.name(meson.current_source_dir()),
'enabled' : false,
},
]

View file

@ -0,0 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
integration_tests += [
integration_test_template + {
'name' : fs.name(meson.current_source_dir()),
'enabled' : false,
},
]

View file

@ -0,0 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
integration_tests += [
integration_test_template + {
'name' : fs.name(meson.current_source_dir()),
'enabled' : false,
},
]

View file

@ -282,6 +282,7 @@ integration_test_template = {
'priority' : 0,
'firmware' : 'linux',
'slow' : false,
'enabled' : true,
}
testdata_subdirs = [
'auxv',
@ -306,7 +307,7 @@ foreach dirname : [
'TEST-05-RLIMITS',
'TEST-06-SELINUX',
'TEST-07-PID1',
# 'TEST-08-INITRD',
'TEST-08-INITRD',
'TEST-09-REBOOT',
'TEST-13-NSPAWN',
'TEST-15-DROPIN',
@ -317,7 +318,7 @@ foreach dirname : [
'TEST-21-DFUZZER',
'TEST-22-TMPFILES',
'TEST-23-UNIT-FILE',
# 'TEST-24-CRYPTSETUP',
'TEST-24-CRYPTSETUP',
'TEST-25-IMPORT',
'TEST-26-SYSTEMCTL',
'TEST-29-PORTABLE',
@ -335,19 +336,19 @@ foreach dirname : [
'TEST-50-DISSECT',
'TEST-52-HONORFIRSTSHUTDOWN',
'TEST-53-ISSUE-16347',
# 'TEST-54-CREDS',
'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-64-UDEV-STORAGE',
'TEST-65-ANALYZE',
'TEST-66-DEVICE-ISOLATION',
'TEST-67-INTEGRITY',
'TEST-68-PROPAGATE-EXIT-STATUS',
# 'TEST-69-SHUTDOWN',
'TEST-69-SHUTDOWN',
'TEST-70-TPM2',
'TEST-71-HOSTNAME',
'TEST-72-SYSUPDATE',
@ -359,7 +360,7 @@ foreach dirname : [
'TEST-79-MEMPRESS',
'TEST-80-NOTIFYACCESS',
'TEST-81-GENERATORS',
# 'TEST-82-SOFTREBOOT',
'TEST-82-SOFTREBOOT',
'TEST-83-BTRFS',
'TEST-84-STORAGETM',
]
@ -391,6 +392,10 @@ foreach integration_test : integration_tests
integration_test_env += {'SYSTEMD_SLOW_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.