File: meson.build

package info (click to toggle)
systemd 259-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 105,132 kB
  • sloc: ansic: 726,480; xml: 121,118; python: 36,740; sh: 35,016; cpp: 946; makefile: 273; awk: 102; lisp: 13; sed: 1
file content (171 lines) | stat: -rw-r--r-- 5,637 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# SPDX-License-Identifier: LGPL-2.1-or-later

# We'd give these more descriptive names but only alphanumeric characters are allowed.
add_test_setup('integration')
add_test_setup('shell', env : {'TEST_SHELL' : '1'})

integration_test_wrapper = files('integration-test-wrapper.py')
integration_tests = []
integration_test_template = {
        'mkosi-args' : [],
        'timeout' : 1800,
        'storage' : 'volatile',
        'priority' : 0,
        'firmware' : 'linux-noinitrd',
        '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' : {},
                'service' : {},
                'unit' : {},
        },
        'cmdline' : [],
        'credentials' : [],
        'qemu-args' : [],
        'exit-code' : 123,
        'vm' : false,
        'coredump-exclude-regex' : '',
        'sanitizer-exclude-regex' : '',
        'rtc' : false,
        'tpm' : 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-10-MOUNT',
        '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-TIMER',
        '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-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',
        'TEST-88-UPGRADE',
        'TEST-89-RESOLVED-MDNS',
]
        subdir(dirname)
endforeach

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'],
                '--unit', '@0@.service'.format(integration_test['name'])
        ]

        if integration_test['vm']
                integration_test_args += ['--vm']
        endif

        if integration_test['rtc']
                integration_test_args += ['--rtc']
        endif

        if integration_test['tpm']
                integration_test_args += ['--tpm']
        endif

        if not integration_test['enabled']
                integration_test_args += ['--skip']
        endif

        if mkosi.found()
                integration_test_args += ['--mkosi', mkosi.full_path()]
        endif

        integration_test_args += ['--']

        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']

        # 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,
                args : integration_test_args,
                timeout : integration_test['timeout'],
                priority : integration_test['priority'],
                suite : 'integration-tests',
        )
endforeach