]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/meson.build
license: LGPL-2.1+ -> LGPL-2.1-or-later
[thirdparty/systemd.git] / test / meson.build
index 856e4a434d0365a4320d048d5b06e45f5b67deac..cc461febf102102722793f9e749132c059285b0f 100644 (file)
-# SPDX-License-Identifier: LGPL-2.1+
+# SPDX-License-Identifier: LGPL-2.1-or-later
 
-test_data_files = '''
-        a.service
-        a-conj.service
-        b.service
-        basic.target
-        c.service
-        d.service
-        daughter.service
-        dml.slice
-        dml-passthrough.slice
-        dml-passthrough-empty.service
-        dml-passthrough-set-dml.service
-        dml-passthrough-set-ml.service
-        dml-override.slice
-        dml-override-empty.service
-        dml-discard.slice
-        dml-discard-empty.service
-        dml-discard-set-ml.service
-        e.service
-        end.service
-        f.service
-        g.service
-        grandchild.service
-        h.service
-        hello-after-sleep.target
-        hello.service
-        hwdb.d/10-bad.hwdb
-        i.service
-        journal-data/journal-1.txt
-        journal-data/journal-2.txt
-        nomem.slice
-        nomemleaf.service
-        parent-deep.slice
-        parent.slice
-        sched_idle_bad.service
-        sched_idle_ok.service
-        sched_rr_bad.service
-        sched_rr_change.service
-        sched_rr_ok.service
-        shutdown.target
-        sleep.service
-        sockets.target
-        son.service
-        sysinit.target
-        test-execute/exec-basic.service
-        test-execute/exec-ambientcapabilities-merge-nfsnobody.service
-        test-execute/exec-ambientcapabilities-merge-nobody.service
-        test-execute/exec-ambientcapabilities-merge.service
-        test-execute/exec-ambientcapabilities-nfsnobody.service
-        test-execute/exec-ambientcapabilities-nobody.service
-        test-execute/exec-ambientcapabilities.service
-        test-execute/exec-bindpaths.service
-        test-execute/exec-capabilityboundingset-invert.service
-        test-execute/exec-capabilityboundingset-merge.service
-        test-execute/exec-capabilityboundingset-reset.service
-        test-execute/exec-capabilityboundingset-simple.service
-        test-execute/exec-condition-failed.service
-        test-execute/exec-condition-skip.service
-        test-execute/exec-cpuaffinity1.service
-        test-execute/exec-cpuaffinity2.service
-        test-execute/exec-cpuaffinity3.service
-        test-execute/exec-dynamicuser-fixeduser-adm.service
-        test-execute/exec-dynamicuser-fixeduser-games.service
-        test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service
-        test-execute/exec-dynamicuser-fixeduser.service
-        test-execute/exec-dynamicuser-statedir-migrate-step1.service
-        test-execute/exec-dynamicuser-statedir-migrate-step2.service
-        test-execute/exec-dynamicuser-statedir.service
-        test-execute/exec-dynamicuser-supplementarygroups.service
-        test-execute/exec-environment-no-substitute.service
-        test-execute/exec-environment-empty.service
-        test-execute/exec-environment-multiple.service
-        test-execute/exec-environment.service
-        test-execute/exec-environmentfile.service
-        test-execute/exec-group-nfsnobody.service
-        test-execute/exec-group-nobody.service
-        test-execute/exec-group-nogroup.service
-        test-execute/exec-group.service
-        test-execute/exec-ignoresigpipe-no.service
-        test-execute/exec-ignoresigpipe-yes.service
-        test-execute/exec-inaccessiblepaths-mount-propagation.service
-        test-execute/exec-inaccessiblepaths-sys.service
-        test-execute/exec-ioschedulingclass-best-effort.service
-        test-execute/exec-ioschedulingclass-idle.service
-        test-execute/exec-ioschedulingclass-none.service
-        test-execute/exec-ioschedulingclass-realtime.service
-        test-execute/exec-oomscoreadjust-negative.service
-        test-execute/exec-oomscoreadjust-positive.service
-        test-execute/exec-passenvironment-absent.service
-        test-execute/exec-passenvironment-empty.service
-        test-execute/exec-passenvironment-repeated.service
-        test-execute/exec-passenvironment.service
-        test-execute/exec-personality-aarch64.service
-        test-execute/exec-personality-ppc64.service
-        test-execute/exec-personality-ppc64le.service
-        test-execute/exec-personality-s390.service
-        test-execute/exec-personality-x86-64.service
-        test-execute/exec-personality-x86.service
-        test-execute/exec-privatedevices-disabled-by-prefix.service
-        test-execute/exec-privatedevices-no-capability-mknod.service
-        test-execute/exec-privatedevices-no-capability-sys-rawio.service
-        test-execute/exec-privatedevices-no.service
-        test-execute/exec-privatedevices-yes-with-group.service
-        test-execute/exec-privatedevices-yes-capability-mknod.service
-        test-execute/exec-privatedevices-yes-capability-sys-rawio.service
-        test-execute/exec-privatedevices-yes.service
-        test-execute/exec-privatenetwork-yes.service
-        test-execute/exec-privatetmp-no.service
-        test-execute/exec-privatetmp-yes.service
-        test-execute/exec-protecthome-tmpfs-vs-protectsystem-strict.service
-        test-execute/exec-protectkernellogs-yes-capabilities.service
-        test-execute/exec-protectkernellogs-no-capabilities.service
-        test-execute/exec-protectkernelmodules-no-capabilities.service
-        test-execute/exec-protectkernelmodules-yes-capabilities.service
-        test-execute/exec-protectkernelmodules-yes-mount-propagation.service
-        test-execute/exec-readonlypaths-mount-propagation.service
-        test-execute/exec-readonlypaths-simple.service
-        test-execute/exec-readonlypaths-with-bindpaths.service
-        test-execute/exec-readonlypaths.service
-        test-execute/exec-readwritepaths-mount-propagation.service
-        test-execute/exec-restrictnamespaces-merge-all.service
-        test-execute/exec-restrictnamespaces-merge-and.service
-        test-execute/exec-restrictnamespaces-merge-or.service
-        test-execute/exec-restrictnamespaces-mnt-blacklist.service
-        test-execute/exec-restrictnamespaces-mnt.service
-        test-execute/exec-restrictnamespaces-no.service
-        test-execute/exec-restrictnamespaces-yes.service
-        test-execute/exec-runtimedirectory-mode.service
-        test-execute/exec-runtimedirectory-owner-nfsnobody.service
-        test-execute/exec-runtimedirectory-owner-nobody.service
-        test-execute/exec-runtimedirectory-owner-nogroup.service
-        test-execute/exec-runtimedirectory-owner.service
-        test-execute/exec-runtimedirectory.service
-        test-execute/exec-specifier-interpolation.service
-        test-execute/exec-specifier.service
-        test-execute/exec-specifier@.service
-        test-execute/exec-standardinput-data.service
-        test-execute/exec-standardinput-file.service
-        test-execute/exec-standardinput-file-cat.service
-        test-execute/exec-standardoutput-file.service
-        test-execute/exec-standardoutput-append.service
-        test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service
-        test-execute/exec-supplementarygroups-multiple-groups-withgid.service
-        test-execute/exec-supplementarygroups-multiple-groups-withuid.service
-        test-execute/exec-supplementarygroups-single-group-user.service
-        test-execute/exec-supplementarygroups-single-group.service
-        test-execute/exec-supplementarygroups.service
-        test-execute/exec-systemcallerrornumber-name.service
-        test-execute/exec-systemcallerrornumber-number.service
-        test-execute/exec-systemcallfilter-failing.service
-        test-execute/exec-systemcallfilter-failing2.service
-        test-execute/exec-systemcallfilter-not-failing.service
-        test-execute/exec-systemcallfilter-not-failing2.service
-        test-execute/exec-systemcallfilter-system-user-nfsnobody.service
-        test-execute/exec-systemcallfilter-system-user-nobody.service
-        test-execute/exec-systemcallfilter-system-user.service
-        test-execute/exec-systemcallfilter-with-errno-multi.service
-        test-execute/exec-systemcallfilter-with-errno-name.service
-        test-execute/exec-systemcallfilter-with-errno-number.service
-        test-execute/exec-temporaryfilesystem-options.service
-        test-execute/exec-temporaryfilesystem-ro.service
-        test-execute/exec-temporaryfilesystem-rw.service
-        test-execute/exec-temporaryfilesystem-usr.service
-        test-execute/exec-umask-0177.service
-        test-execute/exec-umask-default.service
-        test-execute/exec-unsetenvironment.service
-        test-execute/exec-user-nfsnobody.service
-        test-execute/exec-user-nobody.service
-        test-execute/exec-user.service
-        test-execute/exec-workingdirectory.service
-        test-execute/exec-workingdirectory-trailing-dot.service
-        test-path/basic.target
-        test-path/path-changed.path
-        test-path/path-changed.service
-        test-path/path-directorynotempty.path
-        test-path/path-directorynotempty.service
-        test-path/path-exists.path
-        test-path/path-exists.service
-        test-path/path-existsglob.path
-        test-path/path-existsglob.service
-        test-path/path-makedirectory.path
-        test-path/path-makedirectory.service
-        test-path/path-modified.path
-        test-path/path-modified.service
-        test-path/path-mycustomunit.service
-        test-path/path-service.service
-        test-path/path-unit.path
-        test-path/paths.target
-        test-path/sysinit.target
-        test-umount/empty.mountinfo
-        test-umount/example.swaps
-        test-umount/garbled.mountinfo
-        test-umount/rhbug-1554943.mountinfo
-        testsuite.target
-        timers.target
-        unit-with-.service.d/20-override.conf
-        unit-with-multiple-.service.d/20-override.conf
-        unit-with-multiple-.service.d/30-override.conf
-        unit-with-multiple-dashes.service
-        unit-with-multiple-dashes.service.d/10-override.conf
-        unstoppable.service
-'''.split()
+if install_tests
+        testdata_dir = testsdir + '/testdata/'
+
+        install_subdir('journal-data',
+                       install_dir : testdata_dir)
+        install_subdir('units',
+                       install_dir : testdata_dir)
+        install_subdir('test-execute',
+                       install_dir : testdata_dir)
+        install_subdir('test-path',
+                       install_dir : testdata_dir)
+        install_subdir('test-umount',
+                       install_dir : testdata_dir)
+        install_subdir('test-network-generator-conversion',
+                       install_dir : testdata_dir)
+        install_subdir('testsuite-04.units',
+                       install_dir : testdata_dir)
+        install_subdir('testsuite-06.units',
+                       install_dir : testdata_dir)
+        install_subdir('testsuite-10.units',
+                       install_dir : testdata_dir)
+        install_subdir('testsuite-11.units',
+                       install_dir : testdata_dir)
+        install_subdir('testsuite-16.units',
+                       install_dir : testdata_dir)
+        install_subdir('testsuite-28.units',
+                       install_dir : testdata_dir)
+        install_subdir('testsuite-30.units',
+                       install_dir : testdata_dir)
+        install_subdir('testsuite-52.units',
+                       install_dir : testdata_dir)
 
-if conf.get('ENABLE_RESOLVE') == 1
-        test_data_files += '''
-                test-resolve/_openpgpkey.fedoraproject.org.pkts
-                test-resolve/fedoraproject.org.pkts
-                test-resolve/gandi.net.pkts
-                test-resolve/google.com.pkts
-                test-resolve/root.pkts
-                test-resolve/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts
-                test-resolve/teamits.com.pkts
-                test-resolve/zbyszek@fedoraproject.org.pkts
-                test-resolve/_443._tcp.fedoraproject.org.pkts
-                test-resolve/kyhwana.org.pkts
-                test-resolve/fake-caa.pkts
-        '''.split()
+        testsuite08_dir = testdata_dir + '/testsuite-08.units'
+        install_data('testsuite-08.units/-.mount',
+                     install_dir : testsuite08_dir)
+        install_data('testsuite-08.units/systemd-remount-fs.service',
+                     install_dir : testsuite08_dir)
+        meson.add_install_script(meson_make_symlink,
+                                 './-.mount',
+                                 testsuite08_dir + '/root.mount')
+        meson.add_install_script(meson_make_symlink,
+                                 '../-.mount',
+                                 testsuite08_dir + '/local-fs.target.wants/-.mount')
+
+        if conf.get('ENABLE_RESOLVE') == 1
+                install_subdir('test-resolve',
+                               install_dir : testdata_dir)
+        endif
+
+        install_data('create-busybox-container',
+                     install_mode : 'rwxr-xr-x',
+                     install_dir : testdata_dir)
 endif
 
-if install_tests
-        foreach file : test_data_files
-                subdir = file.split('/')[0]
-                if subdir == file
-                        subdir = ''
-                endif
+test_network_generator_conversion_sh = find_program('test-network-generator-conversion.sh')
 
-                install_data(file,
-                             install_dir : testsdir + '/testdata/' + subdir)
-        endforeach
+############################################################
+
+test_sysusers_dir = join_paths(meson.current_source_dir(), 'test-sysusers')
+
+test_sysusers_sh = configure_file(
+        input : 'test-sysusers.sh.in',
+        output : 'test-sysusers.sh',
+        configuration : substs)
+if install_tests and conf.get('ENABLE_SYSUSERS') == 1
+        install_data(test_sysusers_sh,
+                     install_dir : testsdir)
+        install_subdir('test-sysusers',
+                       install_dir : testdata_dir)
 endif
 
 ############################################################
@@ -256,6 +96,9 @@ if install_tests
         install_data('run-unit-tests.py',
                      install_mode : 'rwxr-xr-x',
                      install_dir : testsdir)
+        install_data('test-network-generator-conversion.sh',
+                     install_mode : 'rwxr-xr-x',
+                     install_dir : testsdir)
 endif
 
 ############################################################