Merge pull request #28628 from yuwata/meson-use-template-part6
meson: use template to declare executables (part 6)
This commit is contained in:
+166
-358
@@ -1689,6 +1689,9 @@ if dbus_interfaces_dir == '' or dbus_interfaces_dir == 'yes'
|
||||
endif
|
||||
endif
|
||||
|
||||
dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'loongarch64', 'mips']
|
||||
conf.set10('HAVE_DMI', host_machine.cpu_family() in dmi_arches)
|
||||
|
||||
# We support one or the other. If gcrypt is available, we assume it's there to
|
||||
# be used, and use it in preference.
|
||||
opt = get_option('cryptolib')
|
||||
@@ -2169,14 +2172,14 @@ man_page_depends = []
|
||||
|
||||
############################################################
|
||||
|
||||
tests = []
|
||||
simple_tests = []
|
||||
fuzzers = []
|
||||
libsystemd_tests = []
|
||||
simple_fuzzers = []
|
||||
catalogs = []
|
||||
modules = [] # nss, pam, and other plugins
|
||||
executables = []
|
||||
executables_by_name = {}
|
||||
fuzzer_exes = []
|
||||
|
||||
# binaries that have --help and are intended for use by humans,
|
||||
# usually, but not always, installed in /bin.
|
||||
@@ -2300,6 +2303,27 @@ install_libudev_static = static_library(
|
||||
|
||||
############################################################
|
||||
|
||||
runtest_env = custom_target(
|
||||
'systemd-runtest.env',
|
||||
output : 'systemd-runtest.env',
|
||||
command : [sh, '-c',
|
||||
'{ echo SYSTEMD_TEST_DATA=@0@; echo SYSTEMD_CATALOG_DIR=@1@; } >@OUTPUT@'.format(
|
||||
project_source_root / 'test',
|
||||
project_build_root / 'catalog')],
|
||||
depends : catalogs,
|
||||
build_by_default : true)
|
||||
|
||||
test_cflags = ['-DTEST_CODE=1']
|
||||
# We intentionally do not do inline initializations with definitions for a
|
||||
# bunch of _cleanup_ variables in tests, to ensure valgrind is triggered if we
|
||||
# use the variable unexpectedly. This triggers a lot of maybe-uninitialized
|
||||
# false positives when the combination of -O2 and -flto is used. Suppress them.
|
||||
if '-O2' in c_args and '-flto=auto' in c_args
|
||||
test_cflags += cc.first_supported_argument('-Wno-maybe-uninitialized')
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
executable_template = {
|
||||
'include_directories' : includes,
|
||||
'link_with' : libshared,
|
||||
@@ -2319,6 +2343,40 @@ executable_additional_kwargs = {
|
||||
'dependencies' : userspace,
|
||||
}
|
||||
|
||||
test_template = executable_template + {
|
||||
'build_by_default' : want_tests != 'false',
|
||||
'install' : install_tests,
|
||||
'install_dir' : unittestsdir,
|
||||
}
|
||||
|
||||
test_additional_kwargs = {
|
||||
'c_args' : test_cflags,
|
||||
'link_depends' : runtest_env,
|
||||
}
|
||||
|
||||
fuzz_template = executable_template + {
|
||||
'build_by_default' : fuzzer_build,
|
||||
'install' : false,
|
||||
}
|
||||
|
||||
if want_ossfuzz or (want_libfuzzer and fuzzing_engine.found())
|
||||
fuzz_additional_kwargs = {
|
||||
'dependencies' : fuzzing_engine,
|
||||
}
|
||||
elif want_libfuzzer and not fuzzing_engine.found()
|
||||
fuzz_additional_kwargs = {
|
||||
'link_args' : ['-fsanitize=fuzzer'],
|
||||
}
|
||||
else
|
||||
fuzz_additional_kwargs = {
|
||||
'sources' : files('src/fuzz/fuzz-main.c'),
|
||||
}
|
||||
endif
|
||||
fuzz_additional_kwargs += {
|
||||
'include_directories' : include_directories('src/fuzz'),
|
||||
'c_args' : test_cflags,
|
||||
}
|
||||
|
||||
nss_template = {
|
||||
'version' : '2',
|
||||
'include_directories' : includes,
|
||||
@@ -2466,16 +2524,34 @@ subdir('src/systemd')
|
||||
|
||||
subdir('src/test')
|
||||
subdir('src/fuzz')
|
||||
subdir('rules.d')
|
||||
subdir('test')
|
||||
subdir('src/ukify/test') # needs to be last for test_env variable
|
||||
subdir('test/fuzz')
|
||||
|
||||
alias_target('devel', libsystemd_pc, libudev_pc, systemd_pc, udev_pc)
|
||||
|
||||
############################################################
|
||||
|
||||
foreach test : simple_tests
|
||||
executables += test_template + { 'sources' : [test] }
|
||||
endforeach
|
||||
|
||||
foreach test : libsystemd_tests
|
||||
executables += test_template + test
|
||||
endforeach
|
||||
|
||||
foreach fuzzer : simple_fuzzers
|
||||
executables += fuzz_template + { 'sources' : [fuzzer] }
|
||||
endforeach
|
||||
|
||||
foreach dict : executables
|
||||
name = dict.get('name')
|
||||
name = dict.get('name', '')
|
||||
if name == ''
|
||||
name = fs.stem(dict.get('sources')[0])
|
||||
assert(name.split('-')[0] in ['test', 'fuzz'])
|
||||
endif
|
||||
|
||||
is_test = name.startswith('test-')
|
||||
is_fuzz = name.startswith('fuzz-')
|
||||
|
||||
build = true
|
||||
foreach cond : dict.get('conditions', [])
|
||||
@@ -2490,9 +2566,11 @@ foreach dict : executables
|
||||
|
||||
kwargs = {}
|
||||
foreach key, val : dict
|
||||
if key in ['name', 'dbus', 'public', 'conditions']
|
||||
if key in ['name', 'dbus', 'public', 'conditions',
|
||||
'type', 'suite', 'timeout', 'parallel']
|
||||
continue
|
||||
endif
|
||||
|
||||
kwargs += { key : val }
|
||||
endforeach
|
||||
|
||||
@@ -2500,6 +2578,19 @@ foreach dict : executables
|
||||
kwargs += { key : [ kwargs.get(key, []), val ]}
|
||||
endforeach
|
||||
|
||||
if is_test
|
||||
kwargs += { 'install_dir' : kwargs.get('install_dir') / dict.get('type', '') }
|
||||
foreach key, val : test_additional_kwargs
|
||||
kwargs += { key : [ kwargs.get(key, []), val ] }
|
||||
endforeach
|
||||
endif
|
||||
|
||||
if is_fuzz
|
||||
foreach key, val : fuzz_additional_kwargs
|
||||
kwargs += { key : [ kwargs.get(key, []), val ] }
|
||||
endforeach
|
||||
endif
|
||||
|
||||
exe = executable(
|
||||
name,
|
||||
kwargs : kwargs,
|
||||
@@ -2515,20 +2606,59 @@ foreach dict : executables
|
||||
public_programs += exe
|
||||
endif
|
||||
endif
|
||||
|
||||
if is_test
|
||||
type = dict.get('type', '')
|
||||
suite = dict.get('suite', '')
|
||||
if suite == ''
|
||||
suite = fs.name(fs.parent(dict.get('sources')[0]))
|
||||
if suite.startswith('sd-')
|
||||
suite = 'libsystemd'
|
||||
endif
|
||||
endif
|
||||
|
||||
if type == 'manual'
|
||||
message('@0@/@1@ is a manual test'.format(suite, name))
|
||||
elif type == 'unsafe' and want_tests != 'unsafe'
|
||||
message('@0@/@1@ is an unsafe test'.format(suite, name))
|
||||
elif dict.get('build_by_default')
|
||||
test(name, exe,
|
||||
env : test_env,
|
||||
timeout : dict.get('timeout', 30),
|
||||
suite : suite,
|
||||
is_parallel : dict.get('parallel', true))
|
||||
endif
|
||||
endif
|
||||
|
||||
if is_fuzz
|
||||
fuzzer_exes += exe
|
||||
|
||||
if want_tests != 'false'
|
||||
# Run the fuzz regression tests without any sanitizers enabled.
|
||||
# Additional invocations with sanitizers may be added below.
|
||||
fuzz_ins = fuzz_regression_tests.get(name, {})
|
||||
foreach directive : fuzz_ins.get('directives', [])
|
||||
test('@0@_@1@'.format(name, fs.name(directive.full_path())),
|
||||
exe,
|
||||
suite : 'fuzz',
|
||||
args : directive.full_path(),
|
||||
depends : directive)
|
||||
endforeach
|
||||
foreach file : fuzz_ins.get('files', [])
|
||||
test('@0@_@1@'.format(name, fs.name(file)),
|
||||
exe,
|
||||
suite : 'fuzz',
|
||||
args : file)
|
||||
endforeach
|
||||
endif
|
||||
endif
|
||||
endforeach
|
||||
|
||||
alias_target('fuzzers', fuzzer_exes)
|
||||
|
||||
############################################################
|
||||
|
||||
# only static linking apart from libdl, to make sure that the
|
||||
# module is linked to all libraries that it uses.
|
||||
test_dlopen = executable(
|
||||
'test-dlopen',
|
||||
test_dlopen_c,
|
||||
include_directories : includes,
|
||||
link_with : [libbasic],
|
||||
dependencies : [libdl,
|
||||
userspace],
|
||||
build_by_default : want_tests != 'false')
|
||||
test_dlopen = executables_by_name.get('test-dlopen')
|
||||
|
||||
foreach dict : modules
|
||||
name = dict.get('name')
|
||||
@@ -2582,117 +2712,13 @@ foreach dict : modules
|
||||
test_dlopen,
|
||||
# path to dlopen must include a slash
|
||||
args : lib.full_path(),
|
||||
depends : lib)
|
||||
depends : lib,
|
||||
suite : is_nss ? 'nss' : 'pam')
|
||||
endif
|
||||
endforeach
|
||||
|
||||
############################################################
|
||||
|
||||
if want_tests != 'false'
|
||||
exe = executables_by_name.get('systemd-analyze')
|
||||
test('test-compare-versions',
|
||||
test_compare_versions_sh,
|
||||
args : exe.full_path())
|
||||
endif
|
||||
|
||||
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,
|
||||
depends : exe)
|
||||
endif
|
||||
|
||||
if conf.get('HAVE_BLKID') == 1 and conf.get('ENABLE_BOOTLOADER') == 1
|
||||
if want_tests != 'false'
|
||||
exe = executables_by_name.get('bootctl')
|
||||
test('test-bootctl-json',
|
||||
test_bootctl_json_sh,
|
||||
args : exe.full_path(),
|
||||
depends : exe)
|
||||
endif
|
||||
endif
|
||||
|
||||
if want_tests != 'false'
|
||||
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()])
|
||||
endif
|
||||
|
||||
if enable_sysusers
|
||||
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())
|
||||
endif
|
||||
|
||||
if have_standalone_binaries
|
||||
if want_tests != 'false'
|
||||
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())
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if conf.get('ENABLE_TMPFILES') == 1
|
||||
if want_tests != 'false'
|
||||
exe = executables_by_name.get('systemd-tmpfiles')
|
||||
test('test-systemd-tmpfiles',
|
||||
test_systemd_tmpfiles_py,
|
||||
# https://github.com/mesonbuild/meson/issues/2681
|
||||
args : exe.full_path())
|
||||
endif
|
||||
|
||||
if have_standalone_binaries
|
||||
if want_tests != 'false'
|
||||
exe = executables_by_name.get('systemd-tmpfiles.standalone')
|
||||
test('test-systemd-tmpfiles.standalone',
|
||||
test_systemd_tmpfiles_py,
|
||||
# https://github.com/mesonbuild/meson/issues/2681
|
||||
args : exe.full_path())
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if conf.get('ENABLE_HWDB') == 1
|
||||
if want_tests != 'false'
|
||||
exe = executables_by_name.get('systemd-hwdb')
|
||||
test('hwdb-test',
|
||||
hwdb_test_sh,
|
||||
suite : 'dist',
|
||||
args : exe.full_path(),
|
||||
timeout : 90)
|
||||
endif
|
||||
endif
|
||||
|
||||
if want_tests != 'false'
|
||||
exe = executables_by_name.get('udevadm')
|
||||
test('udev-rules-check',
|
||||
exe,
|
||||
suite : 'dist',
|
||||
args : ['verify', '--resolve-names=never', all_rules])
|
||||
endif
|
||||
|
||||
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(),
|
||||
depends : exe)
|
||||
endif
|
||||
|
||||
ukify = custom_target(
|
||||
'ukify',
|
||||
input : 'src/ukify/ukify.py',
|
||||
@@ -2705,234 +2731,10 @@ if want_ukify
|
||||
public_programs += ukify
|
||||
endif
|
||||
|
||||
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,
|
||||
depends: deps)
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
runtest_env = custom_target(
|
||||
'systemd-runtest.env',
|
||||
output : 'systemd-runtest.env',
|
||||
command : [sh, '-c',
|
||||
'{ echo SYSTEMD_TEST_DATA=@0@; echo SYSTEMD_CATALOG_DIR=@1@; } >@OUTPUT@'.format(
|
||||
project_source_root / 'test',
|
||||
project_build_root / 'catalog')],
|
||||
depends : catalogs,
|
||||
build_by_default : true)
|
||||
|
||||
test_cflags = ['-DTEST_CODE=1']
|
||||
# We intentionally do not do inline initializations with definitions for a
|
||||
# bunch of _cleanup_ variables in tests, to ensure valgrind is triggered if we
|
||||
# use the variable unexpectedly. This triggers a lot of maybe-uninitialized
|
||||
# false positives when the combination of -O2 and -flto is used. Suppress them.
|
||||
if '-O2' in c_args and '-flto=auto' in c_args
|
||||
test_cflags += cc.first_supported_argument('-Wno-maybe-uninitialized')
|
||||
endif
|
||||
|
||||
foreach test : simple_tests
|
||||
tests += { 'sources' : [test] }
|
||||
endforeach
|
||||
|
||||
TESTS = {}
|
||||
foreach test : tests
|
||||
sources = test.get('sources')
|
||||
condition = test.get('condition', '')
|
||||
type = test.get('type', '')
|
||||
base = test.get('base', {})
|
||||
deps = [
|
||||
base.get('dependencies', []),
|
||||
test.get('dependencies', []),
|
||||
]
|
||||
|
||||
name = fs.name(sources[0])
|
||||
if name.endswith('.cc')
|
||||
deps += [versiondep]
|
||||
else
|
||||
deps += [userspace]
|
||||
endif
|
||||
name = fs.stem(name)
|
||||
|
||||
suite = fs.name(fs.parent(sources[0])).replace('sd-', '')
|
||||
|
||||
if condition != '' and conf.get(condition) == 0
|
||||
message('Not compiling @0@ because @1@ is not true'.format(name, condition))
|
||||
continue
|
||||
endif
|
||||
|
||||
exe = executable(
|
||||
name,
|
||||
sources,
|
||||
include_directories : [base.get('includes', []), test.get('includes', includes)],
|
||||
link_with : [base.get('link_with', []), test.get('link_with', libshared)],
|
||||
dependencies : deps,
|
||||
c_args : [test_cflags, test.get('c_args', [])],
|
||||
build_by_default : want_tests != 'false',
|
||||
install_rpath : pkglibdir,
|
||||
install : install_tests,
|
||||
install_dir : unittestsdir / type,
|
||||
link_depends : runtest_env)
|
||||
|
||||
if type == 'manual'
|
||||
message('@0@ is a manual test'.format(name))
|
||||
elif type == 'unsafe' and want_tests != 'unsafe'
|
||||
message('@0@ is an unsafe test'.format(name))
|
||||
elif want_tests != 'false'
|
||||
test(name, exe,
|
||||
env : test_env,
|
||||
timeout : test.get('timeout', 30),
|
||||
suite : suite,
|
||||
is_parallel : test.get('parallel', true))
|
||||
endif
|
||||
|
||||
TESTS += { name : exe }
|
||||
endforeach
|
||||
|
||||
exe = executable(
|
||||
'test-libsystemd-sym',
|
||||
test_libsystemd_sym_c,
|
||||
include_directories : includes,
|
||||
link_with : [libsystemd],
|
||||
dependencies : userspace,
|
||||
build_by_default : want_tests != 'false',
|
||||
install : install_tests,
|
||||
install_dir : unittestsdir)
|
||||
if want_tests != 'false'
|
||||
test('test-libsystemd-sym', exe)
|
||||
endif
|
||||
|
||||
exe = executable(
|
||||
'test-libsystemd-static-sym',
|
||||
test_libsystemd_sym_c,
|
||||
include_directories : includes,
|
||||
link_with : [install_libsystemd_static],
|
||||
dependencies : [
|
||||
# threads is already included in dependencies on the library,
|
||||
# but does not seem to get propagated. Add here as a work-around.
|
||||
threads,
|
||||
userspace,
|
||||
],
|
||||
build_by_default : want_tests != 'false' and static_libsystemd != 'false',
|
||||
install : install_tests and static_libsystemd != 'false',
|
||||
install_dir : unittestsdir)
|
||||
if want_tests != 'false' and static_libsystemd != 'false'
|
||||
test('test-libsystemd-static-sym', exe)
|
||||
endif
|
||||
|
||||
exe = executable(
|
||||
'test-libudev-sym',
|
||||
test_libudev_sym_c,
|
||||
include_directories : libudev_includes,
|
||||
c_args : ['-Wno-deprecated-declarations'] + test_cflags,
|
||||
link_with : [libudev],
|
||||
dependencies : userspace,
|
||||
build_by_default : want_tests != 'false',
|
||||
install : install_tests,
|
||||
install_dir : unittestsdir)
|
||||
if want_tests != 'false'
|
||||
test('test-libudev-sym', exe)
|
||||
endif
|
||||
|
||||
exe = executable(
|
||||
'test-libudev-static-sym',
|
||||
test_libudev_sym_c,
|
||||
include_directories : libudev_includes,
|
||||
c_args : ['-Wno-deprecated-declarations'] + test_cflags,
|
||||
link_with : [install_libudev_static],
|
||||
dependencies : userspace,
|
||||
build_by_default : want_tests != 'false' and static_libudev != 'false',
|
||||
install : install_tests and static_libudev != 'false',
|
||||
install_dir : unittestsdir)
|
||||
if want_tests != 'false' and static_libudev != 'false'
|
||||
test('test-libudev-static-sym', exe)
|
||||
endif
|
||||
|
||||
if want_tests != 'false'
|
||||
exe = TESTS.get('udev-rule-runner')
|
||||
test('test-udev',
|
||||
test_udev_py,
|
||||
args : ['-v'],
|
||||
env : ['UDEV_RULE_RUNNER=' + exe.full_path()],
|
||||
depends : exe,
|
||||
timeout : 180)
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
foreach fuzzer : simple_fuzzers
|
||||
fuzzers += { 'sources' : [fuzzer] }
|
||||
endforeach
|
||||
|
||||
fuzzer_exes = []
|
||||
|
||||
foreach fuzzer : fuzzers
|
||||
sources = fuzzer.get('sources')
|
||||
base = fuzzer.get('base', {})
|
||||
dependencies = [base.get('dependencies', []), fuzzer.get('dependencies', [])]
|
||||
link_args = []
|
||||
|
||||
if want_ossfuzz
|
||||
dependencies += fuzzing_engine
|
||||
elif want_libfuzzer
|
||||
if fuzzing_engine.found()
|
||||
dependencies += fuzzing_engine
|
||||
else
|
||||
link_args += ['-fsanitize=fuzzer']
|
||||
endif
|
||||
else
|
||||
sources += files('src/fuzz/fuzz-main.c')
|
||||
endif
|
||||
sources += fuzz_generated_directives
|
||||
|
||||
name = fs.stem(sources[0])
|
||||
|
||||
exe = executable(
|
||||
name,
|
||||
sources,
|
||||
include_directories : [
|
||||
base.get('includes', []),
|
||||
fuzzer.get('includes', includes),
|
||||
include_directories('src/fuzz'),
|
||||
],
|
||||
link_with : [base.get('link_with', []), fuzzer.get('link_with', libshared)],
|
||||
dependencies : [
|
||||
dependencies,
|
||||
userspace,
|
||||
],
|
||||
c_args : [test_cflags, fuzzer.get('c_args', [])],
|
||||
link_args: link_args,
|
||||
install : false,
|
||||
build_by_default : fuzzer_build)
|
||||
fuzzer_exes += exe
|
||||
|
||||
if want_tests != 'false' and name in fuzz_regression_tests
|
||||
# Run the fuzz regression tests without any sanitizers enabled.
|
||||
# Additional invocations with sanitizers may be added below.
|
||||
foreach tuple : fuzz_regression_tests[name]
|
||||
fuzz_dir = tuple[0]
|
||||
fuzz_in = tuple[1]
|
||||
test('@0@_@1@'.format(name, fuzz_in),
|
||||
exe,
|
||||
suite : 'fuzz',
|
||||
args : [fuzz_dir != '' ? project_source_root / fuzz_dir / name / fuzz_in
|
||||
: fuzz_generated_in_dir / '@0@_@1@'.format(name, fuzz_in)])
|
||||
endforeach
|
||||
endif
|
||||
endforeach
|
||||
|
||||
alias_target('fuzzers', fuzzer_exes)
|
||||
subdir('rules.d')
|
||||
subdir('test')
|
||||
|
||||
############################################################
|
||||
|
||||
@@ -3035,24 +2837,28 @@ foreach tuple : fuzz_sanitizers
|
||||
exe = custom_target(
|
||||
name,
|
||||
output : name,
|
||||
depends : [build] + fuzz_generated_directives,
|
||||
depends : build,
|
||||
command : [ln, '-fs',
|
||||
build.full_path() / fuzzer,
|
||||
'@OUTPUT@'],
|
||||
build_by_default : true)
|
||||
|
||||
foreach tuple : fuzz_ins
|
||||
fuzz_dir = tuple[0]
|
||||
fuzz_in = tuple[1]
|
||||
|
||||
test('@0@_@1@_@2@'.format(fuzzer, fuzz_in, sanitizer),
|
||||
foreach directive : fuzz_ins.get('directives', [])
|
||||
test('@0@_@1@_@2@'.format(fuzzer, fs.name(directive.full_path()), sanitizer),
|
||||
env,
|
||||
suite : 'fuzz+san',
|
||||
env : ['UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1'],
|
||||
timeout : 60,
|
||||
args : [exe.full_path(),
|
||||
fuzz_dir != '' ? project_source_root / fuzz_dir / fuzzer / fuzz_in
|
||||
: fuzz_generated_in_dir / '@0@_@1@'.format(fuzzer, fuzz_in)])
|
||||
args : [exe.full_path(), directive.full_path()],
|
||||
depends : directive)
|
||||
endforeach
|
||||
foreach file : fuzz_ins.get('files', [])
|
||||
test('@0@_@1@_@2@'.format(fuzzer, fs.name(file), sanitizer),
|
||||
env,
|
||||
suite : 'fuzz+san',
|
||||
env : ['UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1'],
|
||||
timeout : 60,
|
||||
args : [exe.full_path(), file])
|
||||
endforeach
|
||||
endforeach
|
||||
endif
|
||||
@@ -3083,7 +2889,8 @@ if git.found()
|
||||
test('check-includes',
|
||||
files('tools/check-includes.py'),
|
||||
args: all_files,
|
||||
env : ['PROJECT_SOURCE_ROOT=@0@'.format(project_source_root)])
|
||||
env : ['PROJECT_SOURCE_ROOT=@0@'.format(project_source_root)],
|
||||
suite : 'headers')
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -3286,6 +3093,7 @@ foreach tuple : [
|
||||
['xdg-autostart'],
|
||||
|
||||
# optional features
|
||||
['dmi'],
|
||||
['idn'],
|
||||
['polkit'],
|
||||
['nscd'],
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ rules = [
|
||||
conf.get('HAVE_KMOD') == 1],
|
||||
|
||||
[files('70-memory.rules'),
|
||||
dmi_arches.contains(host_machine.cpu_family())],
|
||||
conf.get('HAVE_DMI') == 1],
|
||||
|
||||
[files('70-power-switch.rules'),
|
||||
enable_logind],
|
||||
|
||||
@@ -46,14 +46,10 @@ executables += [
|
||||
'dependencies' : libseccomp,
|
||||
'install' : conf.get('ENABLE_ANALYZE') == 1,
|
||||
},
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files(
|
||||
'test-verify.c',
|
||||
'analyze-verify-util.c',
|
||||
),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -23,31 +23,26 @@ if efi_arch != ''
|
||||
libshared,
|
||||
],
|
||||
}
|
||||
efi_test_template = test_template + efitest_base
|
||||
efi_fuzz_template = fuzz_template + efitest_base
|
||||
|
||||
tests += [
|
||||
{
|
||||
executables += [
|
||||
efi_test_template + {
|
||||
'sources' : files('test-bcd.c'),
|
||||
'dependencies' : libzstd,
|
||||
'condition' : 'HAVE_ZSTD',
|
||||
'base' : efitest_base,
|
||||
'conditions' : ['HAVE_ZSTD'],
|
||||
},
|
||||
{
|
||||
efi_test_template + {
|
||||
'sources' : files('test-efi-string.c'),
|
||||
'base' : efitest_base,
|
||||
},
|
||||
]
|
||||
fuzzers += [
|
||||
{
|
||||
efi_fuzz_template + {
|
||||
'sources' : files('fuzz-bcd.c'),
|
||||
'base' : efitest_base,
|
||||
},
|
||||
{
|
||||
efi_fuzz_template + {
|
||||
'sources' : files('fuzz-efi-string.c'),
|
||||
'base' : efitest_base,
|
||||
},
|
||||
{
|
||||
efi_fuzz_template + {
|
||||
'sources' : files('fuzz-efi-printf.c'),
|
||||
'base' : efitest_base,
|
||||
},
|
||||
]
|
||||
endif
|
||||
|
||||
@@ -11,10 +11,7 @@ executables += [
|
||||
'public' : true,
|
||||
'sources' : busctl_sources,
|
||||
},
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-busctl-introspect.c',
|
||||
'busctl-introspect.c',
|
||||
|
||||
+22
-21
@@ -153,6 +153,21 @@ executables += [
|
||||
],
|
||||
'dependencies' : libseccomp,
|
||||
},
|
||||
fuzz_template + {
|
||||
'sources' : files('fuzz-unit-file.c'),
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared
|
||||
],
|
||||
'dependencies' : libmount,
|
||||
},
|
||||
fuzz_template + {
|
||||
'sources' : files('fuzz-manager-serialize.c'),
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
in_files = [['system.conf', pkgsysconfdir],
|
||||
@@ -203,25 +218,11 @@ meson.add_install_script(meson_make_symlink,
|
||||
|
||||
############################################################
|
||||
|
||||
test_core_base = {
|
||||
'link_with' : [libcore, libshared],
|
||||
'includes' : core_includes,
|
||||
core_test_template = test_template + {
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared,
|
||||
],
|
||||
'include_directories' : core_includes,
|
||||
'suite' : 'core',
|
||||
}
|
||||
|
||||
fuzzers += [
|
||||
{
|
||||
'sources' : files('fuzz-unit-file.c'),
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared
|
||||
],
|
||||
'dependencies' : libmount,
|
||||
},
|
||||
{
|
||||
'sources' : files('fuzz-manager-serialize.c'),
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
@@ -33,15 +33,7 @@ executables += [
|
||||
'link_with' : common_link_with,
|
||||
'dependencies' : common_dependencies,
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_COREDUMP') == 1 and install_sysconfdir_samples
|
||||
install_data('coredump.conf',
|
||||
install_dir : pkgsysconfdir)
|
||||
endif
|
||||
|
||||
tests += [
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-coredump-vacuum.c',
|
||||
'coredump-vacuum.c',
|
||||
@@ -49,3 +41,8 @@ tests += [
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_COREDUMP') == 1 and install_sysconfdir_samples
|
||||
install_data('coredump.conf',
|
||||
install_dir : pkgsysconfdir)
|
||||
endif
|
||||
|
||||
+9
-12
@@ -100,6 +100,15 @@ executables += [
|
||||
'link_with' : common_libs,
|
||||
'dependencies' : common_deps,
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-qcow2.c',
|
||||
'qcow2-util.c',
|
||||
),
|
||||
'dependencies' : libz,
|
||||
'conditions' : ['HAVE_ZLIB'],
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_IMPORTD') == 1
|
||||
@@ -114,15 +123,3 @@ if conf.get('ENABLE_IMPORTD') == 1
|
||||
install_dir : libexecdir)
|
||||
# TODO: shouldn't this be in pkgdatadir?
|
||||
endif
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files(
|
||||
'test-qcow2.c',
|
||||
'qcow2-util.c',
|
||||
),
|
||||
'dependencies' : libz,
|
||||
'condition' : 'HAVE_ZLIB',
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -81,6 +81,14 @@ executables += [
|
||||
'sources' : systemd_journal_gatewayd_sources,
|
||||
'dependencies' : common_deps + [libmicrohttpd],
|
||||
},
|
||||
fuzz_template + {
|
||||
'sources' : files('fuzz-journal-remote.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libsystemd_journal_remote,
|
||||
],
|
||||
'include_directories' : journal_includes,
|
||||
},
|
||||
]
|
||||
|
||||
in_files = [
|
||||
@@ -112,16 +120,3 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
|
||||
chmod 755 $DESTDIR/var/log/journal/remote || :''')
|
||||
endif
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
fuzzers += [
|
||||
{
|
||||
'sources' : files('fuzz-journal-remote.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libsystemd_journal_remote,
|
||||
],
|
||||
'includes' : journal_includes,
|
||||
},
|
||||
]
|
||||
|
||||
+88
-104
@@ -41,6 +41,21 @@ else
|
||||
]
|
||||
endif
|
||||
|
||||
journal_test_template = test_template + {
|
||||
'link_with' : [
|
||||
libjournal_core,
|
||||
libshared,
|
||||
],
|
||||
}
|
||||
|
||||
journal_fuzz_template = fuzz_template + {
|
||||
'link_with' : [
|
||||
libjournal_core,
|
||||
libshared,
|
||||
],
|
||||
'dependencies' : libselinux,
|
||||
}
|
||||
|
||||
executables += [
|
||||
libexec_template + {
|
||||
'name' : 'systemd-journald',
|
||||
@@ -80,6 +95,79 @@ executables += [
|
||||
threads,
|
||||
],
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-append.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-config.c'),
|
||||
'dependencies' : [
|
||||
liblz4,
|
||||
libselinux,
|
||||
libxz,
|
||||
],
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-flush.c'),
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-interleaving.c'),
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-stream.c'),
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-syslog.c'),
|
||||
'dependencies' : [
|
||||
liblz4,
|
||||
libselinux,
|
||||
libxz,
|
||||
threads,
|
||||
],
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal-verify.c'),
|
||||
'timeout' : 90,
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-journal.c'),
|
||||
},
|
||||
journal_fuzz_template + {
|
||||
'sources' : files(
|
||||
'fuzz-journald-audit.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
},
|
||||
journal_fuzz_template + {
|
||||
'sources' : files(
|
||||
'fuzz-journald-kmsg.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
},
|
||||
journal_fuzz_template + {
|
||||
'sources' : files(
|
||||
'fuzz-journald-native.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
},
|
||||
journal_fuzz_template + {
|
||||
'sources' : files(
|
||||
'fuzz-journald-native-fd.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
},
|
||||
journal_fuzz_template + {
|
||||
'sources' : files(
|
||||
'fuzz-journald-stream.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
},
|
||||
journal_fuzz_template + {
|
||||
'sources' : files(
|
||||
'fuzz-journald-syslog.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
},
|
||||
]
|
||||
|
||||
if install_sysconfdir_samples
|
||||
@@ -106,107 +194,3 @@ if get_option('create-log-dirs')
|
||||
'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :')
|
||||
endif
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
test_journal_base = {
|
||||
'link_with' : [libjournal_core, libshared],
|
||||
}
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files('test-journal-config.c'),
|
||||
'dependencies' : [
|
||||
liblz4,
|
||||
libselinux,
|
||||
libxz,
|
||||
],
|
||||
'base' : test_journal_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-journal-flush.c'),
|
||||
'base' : test_journal_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-journal-interleaving.c'),
|
||||
'base' : test_journal_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-journal-stream.c'),
|
||||
'base' : test_journal_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-journal-syslog.c'),
|
||||
'dependencies' : [
|
||||
liblz4,
|
||||
libselinux,
|
||||
libxz,
|
||||
threads,
|
||||
],
|
||||
'base' : test_journal_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-journal-verify.c'),
|
||||
'base' : test_journal_base,
|
||||
'timeout' : 90,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-journal.c'),
|
||||
'base' : test_journal_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-journal-append.c'),
|
||||
'base' : test_journal_base,
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
||||
fuzzer_journald_base = {
|
||||
'link_with' : [libjournal_core, libshared],
|
||||
'dependencies' : [libselinux],
|
||||
}
|
||||
|
||||
fuzzers += [
|
||||
{
|
||||
'sources' : files(
|
||||
'fuzz-journald-audit.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
'base' : fuzzer_journald_base,
|
||||
},
|
||||
{
|
||||
'sources' : files(
|
||||
'fuzz-journald-kmsg.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
'base' : fuzzer_journald_base,
|
||||
},
|
||||
{
|
||||
'sources' : files(
|
||||
'fuzz-journald-native.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
'base' : fuzzer_journald_base,
|
||||
},
|
||||
{
|
||||
'sources' : files(
|
||||
'fuzz-journald-native-fd.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
'base' : fuzzer_journald_base,
|
||||
},
|
||||
{
|
||||
'sources' : files(
|
||||
'fuzz-journald-stream.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
'base' : fuzzer_journald_base,
|
||||
},
|
||||
{
|
||||
'sources' : files(
|
||||
'fuzz-journald-syslog.c',
|
||||
'fuzz-journald.c',
|
||||
),
|
||||
'base' : fuzzer_journald_base,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -39,86 +39,73 @@ libsystemd_network_includes = [includes, include_directories('.')]
|
||||
|
||||
############################################################
|
||||
|
||||
test_libsystemd_network_base = {
|
||||
'link_with' : [libshared, libsystemd_network],
|
||||
network_test_template = test_template + {
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libsystemd_network,
|
||||
],
|
||||
'suite' : 'network',
|
||||
}
|
||||
|
||||
tests += [
|
||||
{
|
||||
network_fuzz_template = fuzz_template + {
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libsystemd_network,
|
||||
],
|
||||
}
|
||||
|
||||
executables += [
|
||||
network_test_template + {
|
||||
'sources' : files('test-acd.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-dhcp-client.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-dhcp-option.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-dhcp-server.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-dhcp6-client.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-ipv4ll-manual.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-ipv4ll.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-lldp-rx.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-ndisc-ra.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-ndisc-rs.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
{
|
||||
network_test_template + {
|
||||
'sources' : files('test-sd-dhcp-lease.c'),
|
||||
'base' : test_libsystemd_network_base,
|
||||
},
|
||||
]
|
||||
|
||||
fuzzer_network_base = {
|
||||
'link_with' : [libshared, libsystemd_network],
|
||||
}
|
||||
|
||||
fuzzers += [
|
||||
{
|
||||
network_fuzz_template + {
|
||||
'sources' : files('fuzz-dhcp-client.c'),
|
||||
'base' : fuzzer_network_base,
|
||||
},
|
||||
{
|
||||
network_fuzz_template + {
|
||||
'sources' : files('fuzz-dhcp6-client.c'),
|
||||
'base' : fuzzer_network_base,
|
||||
},
|
||||
{
|
||||
network_fuzz_template + {
|
||||
'sources' : files('fuzz-dhcp-server.c'),
|
||||
'base' : fuzzer_network_base,
|
||||
},
|
||||
{
|
||||
network_fuzz_template + {
|
||||
'sources' : files('fuzz-dhcp-server-relay.c'),
|
||||
'base' : fuzzer_network_base,
|
||||
},
|
||||
{
|
||||
network_fuzz_template + {
|
||||
'sources' : files('fuzz-lldp-rx.c'),
|
||||
'base' : fuzzer_network_base,
|
||||
},
|
||||
{
|
||||
network_fuzz_template + {
|
||||
'sources' : files('fuzz-ndisc-rs.c'),
|
||||
'base' : fuzzer_network_base,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -154,7 +154,7 @@ simple_tests += files(
|
||||
'sd-journal/test-mmap-cache.c',
|
||||
)
|
||||
|
||||
tests += [
|
||||
libsystemd_tests += [
|
||||
{
|
||||
'sources' : files('sd-journal/test-journal-enum.c'),
|
||||
'timeout' : 360,
|
||||
@@ -176,7 +176,7 @@ simple_tests += files(
|
||||
'sd-netlink/test-netlink.c',
|
||||
)
|
||||
|
||||
tests += [
|
||||
libsystemd_tests += [
|
||||
{
|
||||
'sources' : files('sd-bus/test-bus-address.c'),
|
||||
'dependencies' : threads
|
||||
|
||||
@@ -42,15 +42,3 @@ libudev_pc = custom_target(
|
||||
install : pkgconfiglibdir != 'no',
|
||||
install_tag : 'devel',
|
||||
install_dir : pkgconfiglibdir)
|
||||
|
||||
############################################################
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files('test-libudev.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libudev_basic,
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
+8
-11
@@ -33,6 +33,14 @@ executables += [
|
||||
'conditions' : ['ENABLE_LOCALED'],
|
||||
'sources' : files('localectl.c'),
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-localed-util.c',
|
||||
'localed-util.c',
|
||||
'xkbcommon-util.c',
|
||||
),
|
||||
'dependencies' : libxkbcommon_deps,
|
||||
},
|
||||
]
|
||||
|
||||
# If you know a way that allows the same variables to be used
|
||||
@@ -52,14 +60,3 @@ if conf.get('ENABLE_LOCALED') == 1
|
||||
'language-fallback-map',
|
||||
install_dir : pkgdatadir)
|
||||
endif
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files(
|
||||
'test-localed-util.c',
|
||||
'localed-util.c',
|
||||
'xkbcommon-util.c',
|
||||
),
|
||||
'dependencies' : libxkbcommon_deps,
|
||||
},
|
||||
]
|
||||
|
||||
+20
-25
@@ -82,8 +82,28 @@ executables += [
|
||||
'conditions' : ['ENABLE_LOGIND'],
|
||||
'sources' : files('user-runtime-dir.c'),
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-inhibit.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-login-tables.c'),
|
||||
'link_with' : [
|
||||
liblogind_core,
|
||||
libshared,
|
||||
],
|
||||
'dependencies' : threads,
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-session-properties.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
||||
simple_tests += files(
|
||||
'test-login-shared.c'
|
||||
)
|
||||
|
||||
modules += [
|
||||
pam_template + {
|
||||
'name' : 'pam_systemd',
|
||||
@@ -122,28 +142,3 @@ if enable_logind
|
||||
install_data('org.freedesktop.login1.policy',
|
||||
install_dir : polkitpolicydir)
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
simple_tests += files(
|
||||
'test-login-shared.c'
|
||||
)
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files('test-inhibit.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
'sources' : files('test-login-tables.c'),
|
||||
'link_with' : [
|
||||
liblogind_core,
|
||||
libshared,
|
||||
],
|
||||
'dependencies' : threads,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-session-properties.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
||||
+8
-11
@@ -41,6 +41,14 @@ executables += [
|
||||
threads,
|
||||
],
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-machine-tables.c'),
|
||||
'link_with': [
|
||||
libmachine_core,
|
||||
libshared
|
||||
],
|
||||
'dependencies': threads,
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_MACHINED') == 1
|
||||
@@ -51,14 +59,3 @@ if conf.get('ENABLE_MACHINED') == 1
|
||||
install_data('org.freedesktop.machine1.policy',
|
||||
install_dir : polkitpolicydir)
|
||||
endif
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files('test-machine-tables.c'),
|
||||
'link_with': [
|
||||
libmachine_core,
|
||||
libshared
|
||||
],
|
||||
'dependencies': threads,
|
||||
},
|
||||
]
|
||||
|
||||
+54
-57
@@ -114,6 +114,9 @@ network_generator_sources = files(
|
||||
'generator/network-generator.c',
|
||||
)
|
||||
|
||||
networkd_network_gperf_gperf = files('networkd-network-gperf.gperf')
|
||||
networkd_netdev_gperf_gperf = files('netdev/netdev-gperf.gperf')
|
||||
|
||||
sources += custom_target(
|
||||
'networkd-gperf.c',
|
||||
input : 'networkd-gperf.gperf',
|
||||
@@ -122,13 +125,13 @@ sources += custom_target(
|
||||
|
||||
sources += custom_target(
|
||||
'networkd-network-gperf.c',
|
||||
input : 'networkd-network-gperf.gperf',
|
||||
input : networkd_network_gperf_gperf,
|
||||
output : 'networkd-network-gperf.c',
|
||||
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
|
||||
|
||||
sources += custom_target(
|
||||
'netdev-gperf.c',
|
||||
input : 'netdev/netdev-gperf.gperf',
|
||||
input : networkd_netdev_gperf_gperf,
|
||||
output : 'netdev-gperf.c',
|
||||
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
|
||||
|
||||
@@ -150,6 +153,23 @@ libnetworkd_core = static_library(
|
||||
link_with : networkd_link_with,
|
||||
build_by_default : false)
|
||||
|
||||
network_test_template = test_template + {
|
||||
'link_with' : [
|
||||
libnetworkd_core,
|
||||
libsystemd_network,
|
||||
],
|
||||
'include_directories' : network_includes,
|
||||
}
|
||||
|
||||
network_fuzz_template = fuzz_template + {
|
||||
'link_with' : [
|
||||
libnetworkd_core,
|
||||
libsystemd_network,
|
||||
],
|
||||
'dependencies' : threads,
|
||||
'include_directories' : network_includes,
|
||||
}
|
||||
|
||||
executables += [
|
||||
libexec_template + {
|
||||
'name' : 'systemd-networkd',
|
||||
@@ -187,6 +207,38 @@ executables += [
|
||||
'sources' : network_generator_sources,
|
||||
'link_with' : networkd_link_with,
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'generator/test-network-generator.c',
|
||||
'generator/network-generator.c',
|
||||
),
|
||||
'suite' : 'network',
|
||||
},
|
||||
network_test_template + {
|
||||
'sources' : files('test-network-tables.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
network_test_template + {
|
||||
'sources' : files('test-network.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
network_test_template + {
|
||||
'sources' : files('test-networkd-address.c'),
|
||||
'dependencies' : libatomic,
|
||||
},
|
||||
network_test_template + {
|
||||
'sources' : files('test-networkd-conf.c'),
|
||||
'dependencies' : libatomic,
|
||||
},
|
||||
network_test_template + {
|
||||
'sources' : files('test-networkd-util.c'),
|
||||
},
|
||||
network_fuzz_template + {
|
||||
'sources' : files('fuzz-netdev-parser.c'),
|
||||
},
|
||||
network_fuzz_template + {
|
||||
'sources' : files('fuzz-network-parser.c'),
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_NETWORKD') == 1
|
||||
@@ -210,58 +262,3 @@ if conf.get('ENABLE_NETWORKD') == 1
|
||||
install_dir : pkgsysconfdir)
|
||||
endif
|
||||
endif
|
||||
|
||||
fuzzer_network_base = {
|
||||
'link_with' : [libnetworkd_core, libsystemd_network, networkd_link_with],
|
||||
'dependencies' : threads,
|
||||
'includes' : network_includes,
|
||||
}
|
||||
|
||||
fuzzers += [
|
||||
{
|
||||
'sources' : files('fuzz-netdev-parser.c'),
|
||||
'base' : fuzzer_network_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('fuzz-network-parser.c'),
|
||||
'base' : fuzzer_network_base,
|
||||
},
|
||||
]
|
||||
|
||||
test_network_base = {
|
||||
'link_with' : [libnetworkd_core, libsystemd_network],
|
||||
'includes' : network_includes,
|
||||
}
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files(
|
||||
'generator/test-network-generator.c',
|
||||
'generator/network-generator.c',
|
||||
)
|
||||
},
|
||||
{
|
||||
'sources' : files('test-network-tables.c'),
|
||||
'dependencies' : threads,
|
||||
'base' : test_network_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-network.c'),
|
||||
'dependencies' : threads,
|
||||
'base' : test_network_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-networkd-address.c'),
|
||||
'dependencies' : libatomic,
|
||||
'base' : test_network_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-networkd-conf.c'),
|
||||
'dependencies' : libatomic,
|
||||
'base' : test_network_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-networkd-util.c'),
|
||||
'base' : test_network_base,
|
||||
},
|
||||
]
|
||||
|
||||
+13
-34
@@ -40,6 +40,13 @@ nspawn_libs = [
|
||||
libshared,
|
||||
]
|
||||
|
||||
nspawn_common_template = {
|
||||
'link_with' : nspawn_libs,
|
||||
'dependencies' : libseccomp,
|
||||
}
|
||||
nspawn_test_template = test_template + nspawn_common_template
|
||||
nspawn_fuzz_template = fuzz_template + nspawn_common_template
|
||||
|
||||
executables += [
|
||||
executable_template + {
|
||||
'name' : 'systemd-nspawn',
|
||||
@@ -51,50 +58,22 @@ executables += [
|
||||
libseccomp,
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
############################################################
|
||||
|
||||
tests += [
|
||||
{
|
||||
nspawn_test_template + {
|
||||
'sources' : files('test-nspawn-tables.c'),
|
||||
'link_with' : [
|
||||
libnspawn_core,
|
||||
libshared,
|
||||
],
|
||||
'dependencies' : libseccomp,
|
||||
},
|
||||
{
|
||||
nspawn_test_template + {
|
||||
'sources' : files('test-nspawn-util.c'),
|
||||
'link_with' : [
|
||||
libnspawn_core,
|
||||
libshared,
|
||||
],
|
||||
'dependencies' : libseccomp,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-patch-uid.c'),
|
||||
'link_with' : [
|
||||
libnspawn_core,
|
||||
libshared,
|
||||
],
|
||||
'link_with' : nspawn_libs,
|
||||
'dependencies' : libacl,
|
||||
'type' : 'manual',
|
||||
},
|
||||
]
|
||||
|
||||
fuzzer_nspawn_base = {
|
||||
'link_with' : [libshared, libnspawn_core],
|
||||
'dependencies' : libseccomp
|
||||
}
|
||||
|
||||
fuzzers += [
|
||||
{
|
||||
nspawn_fuzz_template + {
|
||||
'sources' : files('fuzz-nspawn-settings.c'),
|
||||
'base' : fuzzer_nspawn_base,
|
||||
},
|
||||
{
|
||||
nspawn_fuzz_template + {
|
||||
'sources' : files('fuzz-nspawn-oci.c'),
|
||||
'base' : fuzzer_nspawn_base,
|
||||
},
|
||||
]
|
||||
|
||||
+7
-10
@@ -21,6 +21,13 @@ executables += [
|
||||
'conditions' : ['ENABLE_OOMD'],
|
||||
'sources' : files('oomctl.c'),
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-oomd-util.c',
|
||||
'oomd-util.c',
|
||||
),
|
||||
'dependencies' : libatomic,
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_OOMD') == 1
|
||||
@@ -35,13 +42,3 @@ if conf.get('ENABLE_OOMD') == 1
|
||||
install_dir : pkgsysconfdir)
|
||||
endif
|
||||
endif
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files(
|
||||
'test-oomd-util.c',
|
||||
'oomd-util.c',
|
||||
),
|
||||
'dependencies' : libatomic,
|
||||
},
|
||||
]
|
||||
|
||||
+61
-75
@@ -123,6 +123,19 @@ link_with = [
|
||||
libsystemd_resolve_core,
|
||||
]
|
||||
|
||||
resolve_common_template = {
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libsystemd_resolve_core,
|
||||
],
|
||||
'dependencies' : [
|
||||
lib_openssl_or_gcrypt,
|
||||
libm,
|
||||
],
|
||||
}
|
||||
resolve_test_template = test_template + resolve_common_template
|
||||
resolve_fuzz_template = fuzz_template + resolve_common_template
|
||||
|
||||
executables += [
|
||||
libexec_template + {
|
||||
'name' : 'systemd-resolved',
|
||||
@@ -147,6 +160,54 @@ executables += [
|
||||
threads,
|
||||
],
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files('test-resolve-tables.c'),
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files('test-dns-packet.c'),
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files(
|
||||
'test-resolved-etc-hosts.c',
|
||||
'resolved-etc-hosts.c',
|
||||
),
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files('test-resolved-packet.c'),
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files('test-dnssec.c'),
|
||||
'conditions' : ['HAVE_OPENSSL_OR_GCRYPT'],
|
||||
},
|
||||
resolve_test_template + {
|
||||
'sources' : files('test-dnssec-complex.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
test_template + {
|
||||
'sources' : [
|
||||
files('test-resolved-stream.c'),
|
||||
basic_dns_sources,
|
||||
systemd_resolved_sources,
|
||||
],
|
||||
'dependencies' : [
|
||||
lib_openssl_or_gcrypt,
|
||||
libm,
|
||||
systemd_resolved_dependencies,
|
||||
],
|
||||
'include_directories' : resolve_includes,
|
||||
},
|
||||
resolve_fuzz_template + {
|
||||
'sources' : files('fuzz-dns-packet.c'),
|
||||
},
|
||||
resolve_fuzz_template + {
|
||||
'sources' : files(
|
||||
'fuzz-etc-hosts.c',
|
||||
'resolved-etc-hosts.c',
|
||||
),
|
||||
},
|
||||
resolve_fuzz_template + {
|
||||
'sources' : files('fuzz-resource-record.c'),
|
||||
},
|
||||
]
|
||||
|
||||
if conf.get('ENABLE_RESOLVE') == 1
|
||||
@@ -175,78 +236,3 @@ custom_target(
|
||||
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
|
||||
install : conf.get('ENABLE_RESOLVE') == 1 and install_sysconfdir_samples,
|
||||
install_dir : pkgsysconfdir)
|
||||
|
||||
############################################################
|
||||
|
||||
test_resolve_base = {
|
||||
'link_with' : [libsystemd_resolve_core, libshared],
|
||||
'dependencies' : [lib_openssl_or_gcrypt, libm],
|
||||
}
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files('test-resolve-tables.c'),
|
||||
'base' : test_resolve_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-dns-packet.c'),
|
||||
'base' : test_resolve_base,
|
||||
},
|
||||
{
|
||||
'sources' : files(
|
||||
'test-resolved-etc-hosts.c',
|
||||
'resolved-etc-hosts.c',
|
||||
),
|
||||
'base' : test_resolve_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-resolved-packet.c'),
|
||||
'base' : test_resolve_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-dnssec.c'),
|
||||
'base' : test_resolve_base,
|
||||
'condition' : 'HAVE_OPENSSL_OR_GCRYPT',
|
||||
},
|
||||
{
|
||||
'sources' : files('test-dnssec-complex.c'),
|
||||
'base' : test_resolve_base,
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
'sources' : [
|
||||
files('test-resolved-stream.c'),
|
||||
basic_dns_sources,
|
||||
systemd_resolved_sources,
|
||||
],
|
||||
'dependencies' : [
|
||||
lib_openssl_or_gcrypt,
|
||||
libm,
|
||||
systemd_resolved_dependencies,
|
||||
],
|
||||
'includes' : resolve_includes,
|
||||
},
|
||||
]
|
||||
|
||||
fuzzer_resolve_base = {
|
||||
'link_with' : [libsystemd_resolve_core, libshared],
|
||||
'dependencies' : [lib_openssl_or_gcrypt, libm],
|
||||
}
|
||||
|
||||
fuzzers += [
|
||||
{
|
||||
'sources' : files('fuzz-dns-packet.c'),
|
||||
'base' : fuzzer_resolve_base,
|
||||
},
|
||||
{
|
||||
'sources' : files(
|
||||
'fuzz-etc-hosts.c',
|
||||
'resolved-etc-hosts.c',
|
||||
),
|
||||
'base' : fuzzer_resolve_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('fuzz-resource-record.c'),
|
||||
'base' : fuzzer_resolve_base,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -28,13 +28,10 @@ executables += [
|
||||
'build_by_default' : have_standalone_binaries,
|
||||
'install' : have_standalone_binaries,
|
||||
},
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'detach-swap.c',
|
||||
'test-umount.c',
|
||||
'detach-swap.c',
|
||||
'umount.c',
|
||||
),
|
||||
'dependencies' : libmount,
|
||||
|
||||
@@ -63,6 +63,14 @@ executables += [
|
||||
threads,
|
||||
],
|
||||
},
|
||||
fuzz_template + {
|
||||
'sources' : [
|
||||
files('fuzz-systemctl-parse-argv.c'),
|
||||
systemctl_sources,
|
||||
],
|
||||
'link_with' : systemctl_link_with,
|
||||
'c_args' : ['-DFUZZ_SYSTEMCTL_PARSE_ARGV'],
|
||||
},
|
||||
]
|
||||
|
||||
foreach alias : (['halt', 'poweroff', 'reboot', 'shutdown'] +
|
||||
@@ -71,14 +79,3 @@ foreach alias : (['halt', 'poweroff', 'reboot', 'shutdown'] +
|
||||
bindir / 'systemctl',
|
||||
sbindir / alias)
|
||||
endforeach
|
||||
|
||||
fuzzers += [
|
||||
{
|
||||
'sources' : [
|
||||
files('fuzz-systemctl-parse-argv.c'),
|
||||
systemctl_sources,
|
||||
],
|
||||
'link_with' : systemctl_link_with,
|
||||
'c_args' : '-DFUZZ_SYSTEMCTL_PARSE_ARGV',
|
||||
},
|
||||
]
|
||||
|
||||
+138
-134
@@ -39,8 +39,6 @@ test_libudev_sym_c = custom_target(
|
||||
capture : true,
|
||||
build_by_default : want_tests != 'false')
|
||||
|
||||
test_dlopen_c = files('test-dlopen.c')
|
||||
|
||||
############################################################
|
||||
|
||||
simple_tests += files(
|
||||
@@ -195,49 +193,49 @@ common_test_dependencies = [
|
||||
threads,
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
executables += [
|
||||
test_template + {
|
||||
'sources' : files('test-acl-util.c'),
|
||||
'condition' : 'HAVE_ACL',
|
||||
'conditions' : ['HAVE_ACL'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-af-list.c') +
|
||||
generated_gperf_headers,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-arphrd-util.c') +
|
||||
generated_gperf_headers,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-ask-password-api.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-async.c'),
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-boot-timestamps.c'),
|
||||
'condition' : 'ENABLE_EFI',
|
||||
'conditions' : ['ENABLE_EFI'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-btrfs.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-cap-list.c') +
|
||||
generated_gperf_headers,
|
||||
'dependencies' : libcap,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-capability.c'),
|
||||
'dependencies' : libcap,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-chase-manual.c'),
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-compress-benchmark.c'),
|
||||
'link_with' : [
|
||||
libbasic_compress,
|
||||
@@ -245,144 +243,152 @@ tests += [
|
||||
],
|
||||
'timeout' : 90,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-compress.c'),
|
||||
'link_with' : [
|
||||
libbasic_compress,
|
||||
libshared,
|
||||
],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-cryptolib.c'),
|
||||
'link_with' : libshared,
|
||||
'dependencies' : lib_openssl_or_gcrypt,
|
||||
'condition' : 'HAVE_OPENSSL_OR_GCRYPT',
|
||||
'conditions' : ['HAVE_OPENSSL_OR_GCRYPT'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-dlopen-so.c'),
|
||||
'dependencies' : libp11kit_cflags
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
# only static linking apart from libdl, to make sure that the
|
||||
# module is linked to all libraries that it uses.
|
||||
'sources' : files('test-dlopen.c'),
|
||||
'link_with' : libbasic,
|
||||
'dependencies' : libdl,
|
||||
'install' : false,
|
||||
'type' : 'manual',
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-errno-list.c') +
|
||||
generated_gperf_headers,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-fd-util.c'),
|
||||
'dependencies' : libseccomp,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-hashmap.c',
|
||||
'test-hashmap-plain.c',
|
||||
) + [
|
||||
test_hashmap_ordered_c,
|
||||
],
|
||||
'test-hashmap.c',
|
||||
'test-hashmap-plain.c',
|
||||
) + [
|
||||
test_hashmap_ordered_c,
|
||||
],
|
||||
'timeout' : 180,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-ip-protocol-list.c') +
|
||||
shared_generated_gperf_headers,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-ipcrm.c'),
|
||||
'type' : 'unsafe',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-json.c'),
|
||||
'dependencies' : libm,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-libcrypt-util.c'),
|
||||
'dependencies' : libcrypt,
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-libmount.c'),
|
||||
'dependencies' : [
|
||||
libmount,
|
||||
threads,
|
||||
],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-loopback.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-math-util.c'),
|
||||
'dependencies' : libm,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-mempress.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-mount-util.c'),
|
||||
'dependencies' : libmount,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-netlink-manual.c'),
|
||||
'dependencies' : libkmod,
|
||||
'condition' : 'HAVE_KMOD',
|
||||
'conditions' : ['HAVE_KMOD'],
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-nscd-flush.c'),
|
||||
'condition' : 'ENABLE_NSCD',
|
||||
'conditions' : ['ENABLE_NSCD'],
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-nss-hosts.c',
|
||||
'nss-test-util.c',
|
||||
),
|
||||
'dependencies' : libdl,
|
||||
'condition' : 'ENABLE_NSS',
|
||||
'conditions' : ['ENABLE_NSS'],
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-nss-users.c',
|
||||
'nss-test-util.c',
|
||||
),
|
||||
'dependencies' : libdl,
|
||||
'condition' : 'ENABLE_NSS',
|
||||
'conditions' : ['ENABLE_NSS'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-parse-util.c'),
|
||||
'dependencies' : libm,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-process-util.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-qrcode-util.c'),
|
||||
'dependencies' : libdl,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-random-util.c'),
|
||||
'dependencies' : libm,
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-sbat.c'),
|
||||
'condition' : 'ENABLE_BOOTLOADER',
|
||||
'conditions' : ['ENABLE_BOOTLOADER'],
|
||||
'c_args' : '-I@0@'.format(efi_config_h_dir),
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-seccomp.c'),
|
||||
'dependencies' : libseccomp,
|
||||
'condition' : 'HAVE_SECCOMP',
|
||||
'conditions' : ['HAVE_SECCOMP'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-set-disable-mempool.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-sizeof.c'),
|
||||
'link_with' : libbasic,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-tables.c'),
|
||||
'link_with' : [
|
||||
libcore,
|
||||
@@ -399,192 +405,190 @@ tests += [
|
||||
libxz,
|
||||
threads,
|
||||
],
|
||||
'includes' : [
|
||||
'include_directories' : [
|
||||
core_includes,
|
||||
journal_includes,
|
||||
udev_includes,
|
||||
],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-time-util.c'),
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
'sources' : files('udev-rule-runner.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libudevd_core,
|
||||
],
|
||||
'dependencies' : [
|
||||
libacl,
|
||||
libblkid,
|
||||
libkmod,
|
||||
librt,
|
||||
libselinux,
|
||||
threads,
|
||||
],
|
||||
'includes' : udev_includes,
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-utmp.c'),
|
||||
'condition' : 'ENABLE_UTMP',
|
||||
'conditions' : ['ENABLE_UTMP'],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-varlink.c'),
|
||||
'dependencies' : threads,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('test-watchdog.c'),
|
||||
'type' : 'unsafe',
|
||||
},
|
||||
|
||||
# Symbol tests
|
||||
test_template + {
|
||||
'name' : 'test-libsystemd-sym',
|
||||
'sources' : test_libsystemd_sym_c,
|
||||
'link_with' : libsystemd,
|
||||
'suite' : 'libsystemd',
|
||||
},
|
||||
test_template + {
|
||||
'name' : 'test-libsystemd-static-sym',
|
||||
'sources' : test_libsystemd_sym_c,
|
||||
'link_with' : install_libsystemd_static,
|
||||
'build_by_default' : want_tests != 'false' and static_libsystemd != 'false',
|
||||
'install' : install_tests and static_libsystemd != 'false',
|
||||
'suite' : 'libsystemd',
|
||||
},
|
||||
test_template + {
|
||||
'name' : 'test-libudev-sym',
|
||||
'sources' : test_libudev_sym_c,
|
||||
'include_directories' : libudev_includes,
|
||||
'c_args' : ['-Wno-deprecated-declarations'] + test_cflags,
|
||||
'link_with' : libudev,
|
||||
'suite' : 'libudev',
|
||||
},
|
||||
test_template + {
|
||||
'name' : 'test-libudev-static-sym',
|
||||
'sources' : test_libudev_sym_c,
|
||||
'include_directories' : libudev_includes,
|
||||
'c_args' : ['-Wno-deprecated-declarations'] + test_cflags,
|
||||
'link_with' : install_libudev_static,
|
||||
'build_by_default' : want_tests != 'false' and static_libudev != 'false',
|
||||
'install' : install_tests and static_libudev != 'false',
|
||||
'suite' : 'libudev',
|
||||
},
|
||||
|
||||
# Tests that link to libcore, i.e. tests for pid1 code.
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-bpf-devices.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-bpf-firewall.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-bpf-foreign-programs.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-bpf-lsm.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-cgroup-cpu.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-cgroup-mask.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-cgroup-unit-default.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-chown-rec.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-core-unit.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-emergency-action.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-engine.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-execute.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
'timeout' : 360,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-install.c'),
|
||||
'base' : test_core_base,
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-job-type.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-load-fragment.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-loop-block.c'),
|
||||
'dependencies' : [threads, libblkid],
|
||||
'base' : test_core_base,
|
||||
'parallel' : false,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-manager.c'),
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-namespace.c'),
|
||||
'dependencies' : [
|
||||
libblkid,
|
||||
threads,
|
||||
],
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-ns.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
'type' : 'manual',
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-path.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
'timeout' : 120,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-sched-prio.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-socket-bind.c'),
|
||||
'dependencies' : libdl,
|
||||
'condition' : 'BPF_FRAMEWORK',
|
||||
'base' : test_core_base,
|
||||
'conditions' : ['BPF_FRAMEWORK'],
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-unit-name.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-unit-serialize.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
{
|
||||
core_test_template + {
|
||||
'sources' : files('test-watch-pid.c'),
|
||||
'dependencies' : common_test_dependencies,
|
||||
'base' : test_core_base,
|
||||
},
|
||||
|
||||
# Tests from other directories that have link_with deps that were not defined earlier
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('../libsystemd/sd-bus/test-bus-error.c'),
|
||||
'link_with' : [
|
||||
libshared_static,
|
||||
libsystemd_static,
|
||||
],
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('../libsystemd/sd-device/test-sd-device-thread.c'),
|
||||
'link_with' : libsystemd,
|
||||
'dependencies' : threads,
|
||||
},
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files('../libudev/test-udev-device-thread.c'),
|
||||
'link_with' : libudev,
|
||||
'dependencies' : threads,
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('../libudev/test-libudev.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libudev_basic,
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
@@ -50,6 +50,14 @@ executables += [
|
||||
'sources' : files('wait-sync.c'),
|
||||
'link_with' : libtimesyncd_core,
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('test-timesync.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libtimesyncd_core,
|
||||
],
|
||||
'dependencies' : libm,
|
||||
},
|
||||
]
|
||||
|
||||
custom_target(
|
||||
@@ -70,16 +78,3 @@ if conf.get('ENABLE_TIMESYNCD') == 1
|
||||
install_data('org.freedesktop.timesync1.policy',
|
||||
install_dir : polkitpolicydir)
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files('test-timesync.c'),
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libtimesyncd_core,
|
||||
],
|
||||
'dependencies' : libm,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -29,10 +29,7 @@ executables += [
|
||||
'build_by_default' : have_standalone_binaries,
|
||||
'install' : have_standalone_binaries,
|
||||
},
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-offline-passwd.c',
|
||||
'offline-passwd.c',
|
||||
|
||||
+122
-107
@@ -84,9 +84,11 @@ keyboard_keys_from_name_h = custom_target(
|
||||
|
||||
############################################################
|
||||
|
||||
udev_link_gperf_gperf = files('net/link-config-gperf.gperf')
|
||||
|
||||
link_config_gperf_c = custom_target(
|
||||
'link-config-gperf.c',
|
||||
input : 'net/link-config-gperf.gperf',
|
||||
input : udev_link_gperf_gperf,
|
||||
output : 'link-config-gperf.c',
|
||||
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
|
||||
|
||||
@@ -116,57 +118,135 @@ libudevd_core = static_library(
|
||||
userspace],
|
||||
build_by_default : false)
|
||||
|
||||
udev_dependencies = [
|
||||
libacl,
|
||||
libblkid,
|
||||
libidn,
|
||||
libkmod,
|
||||
threads,
|
||||
]
|
||||
|
||||
udev_plugin_template = executable_template + {
|
||||
'public' : true,
|
||||
'link_with' : udev_link_with,
|
||||
'install_rpath' : udev_rpath,
|
||||
'install_dir' : udevlibexecdir,
|
||||
}
|
||||
|
||||
udev_common_template = {
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libudevd_core,
|
||||
],
|
||||
'dependencies' : [
|
||||
libacl,
|
||||
threads,
|
||||
],
|
||||
}
|
||||
udev_test_template = test_template + udev_common_template
|
||||
udev_fuzz_template = fuzz_template + udev_common_template
|
||||
|
||||
executables += [
|
||||
executable_template + {
|
||||
'name' : 'udevadm',
|
||||
'public' : true,
|
||||
'sources' : udevadm_sources,
|
||||
'link_with' : [libudevd_core],
|
||||
'dependencies' : [
|
||||
libacl,
|
||||
libblkid,
|
||||
libidn,
|
||||
libkmod,
|
||||
threads,
|
||||
],
|
||||
'dependencies' : udev_dependencies,
|
||||
'install_rpath' : udev_rpath,
|
||||
},
|
||||
udev_plugin_template + {
|
||||
'name' : 'ata_id',
|
||||
'sources' : files('ata_id/ata_id.c'),
|
||||
},
|
||||
udev_plugin_template + {
|
||||
'name' : 'cdrom_id',
|
||||
'sources' : files('cdrom_id/cdrom_id.c'),
|
||||
},
|
||||
udev_plugin_template + {
|
||||
'name' : 'dmi_memory_id',
|
||||
'conditions' : ['HAVE_DMI'],
|
||||
'sources' : files('dmi_memory_id/dmi_memory_id.c'),
|
||||
},
|
||||
udev_plugin_template + {
|
||||
'name' : 'fido_id',
|
||||
'sources' : files(
|
||||
'fido_id/fido_id.c',
|
||||
'fido_id/fido_id_desc.c',
|
||||
),
|
||||
},
|
||||
udev_plugin_template + {
|
||||
'name' : 'iocost',
|
||||
'sources' : files('iocost/iocost.c'),
|
||||
},
|
||||
udev_plugin_template + {
|
||||
'name' : 'mtd_probe',
|
||||
'sources' : files(
|
||||
'mtd_probe/mtd_probe.c',
|
||||
'mtd_probe/probe_smartmedia.c',
|
||||
),
|
||||
},
|
||||
udev_plugin_template + {
|
||||
'name' : 'scsi_id',
|
||||
'sources' : files(
|
||||
'scsi_id/scsi_id.c',
|
||||
'scsi_id/scsi_serial.c',
|
||||
),
|
||||
},
|
||||
udev_plugin_template + {
|
||||
'name' : 'v4l_id',
|
||||
'sources' : files('v4l_id/v4l_id.c'),
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'fido_id/test-fido-id-desc.c',
|
||||
'fido_id/fido_id_desc.c',
|
||||
),
|
||||
'suite' : 'udev',
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-builtin.c'),
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-format.c'),
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-manager.c'),
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-node.c'),
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-rule-runner.c'),
|
||||
'dependencies' : udev_dependencies + [
|
||||
libselinux,
|
||||
],
|
||||
'type' : 'manual',
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-rules.c'),
|
||||
},
|
||||
udev_test_template + {
|
||||
'sources' : files('test-udev-spawn.c'),
|
||||
},
|
||||
fuzz_template + {
|
||||
'sources' : files(
|
||||
'fido_id/fuzz-fido-id-desc.c',
|
||||
'fido_id/fido_id_desc.c',
|
||||
),
|
||||
},
|
||||
udev_fuzz_template + {
|
||||
'sources' : files('net/fuzz-link-parser.c'),
|
||||
'include_directories' : udev_includes,
|
||||
},
|
||||
udev_fuzz_template + {
|
||||
'sources' : files('fuzz-udev-rule-parse-value.c'),
|
||||
},
|
||||
udev_fuzz_template + {
|
||||
'sources' : files('fuzz-udev-rules.c'),
|
||||
},
|
||||
]
|
||||
|
||||
udev_progs = [['ata_id/ata_id.c'],
|
||||
['cdrom_id/cdrom_id.c'],
|
||||
['fido_id/fido_id.c',
|
||||
'fido_id/fido_id_desc.c'],
|
||||
['iocost/iocost.c'],
|
||||
['scsi_id/scsi_id.c',
|
||||
'scsi_id/scsi_serial.c'],
|
||||
['v4l_id/v4l_id.c'],
|
||||
['mtd_probe/mtd_probe.c',
|
||||
'mtd_probe/probe_smartmedia.c']]
|
||||
|
||||
dmi_arches = ['x86', 'x86_64', 'aarch64', 'arm', 'ia64', 'loongarch64', 'mips']
|
||||
if dmi_arches.contains(host_machine.cpu_family())
|
||||
udev_progs += [['dmi_memory_id/dmi_memory_id.c']]
|
||||
endif
|
||||
|
||||
udev_prog_paths = {}
|
||||
foreach prog : udev_progs
|
||||
name = fs.stem(prog[0])
|
||||
|
||||
exe = executable(
|
||||
name,
|
||||
prog,
|
||||
include_directories : includes,
|
||||
dependencies : [userspace],
|
||||
link_with : udev_link_with,
|
||||
install_rpath : udev_rpath,
|
||||
install : true,
|
||||
install_dir : udevlibexecdir)
|
||||
|
||||
udev_prog_paths += {name : exe}
|
||||
public_programs += exe
|
||||
endforeach
|
||||
|
||||
meson.add_install_script(meson_make_symlink,
|
||||
bindir / 'udevadm',
|
||||
libexecdir / 'systemd-udevd')
|
||||
@@ -191,68 +271,3 @@ if install_sysconfdir
|
||||
meson.add_install_script('sh', '-c',
|
||||
mkdir_p.format(sysconfdir / 'udev/rules.d'))
|
||||
endif
|
||||
|
||||
fuzzer_udev_base = {
|
||||
'link_with' : [libudevd_core, libshared],
|
||||
'dependencies' : [threads, libacl],
|
||||
}
|
||||
|
||||
fuzzers += [
|
||||
{
|
||||
'sources' : files('net/fuzz-link-parser.c'),
|
||||
'includes' : udev_includes,
|
||||
'base' : fuzzer_udev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('fuzz-udev-rule-parse-value.c'),
|
||||
'base' : fuzzer_udev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('fuzz-udev-rules.c'),
|
||||
'base' : fuzzer_udev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files(
|
||||
'fido_id/fuzz-fido-id-desc.c',
|
||||
'fido_id/fido_id_desc.c',
|
||||
),
|
||||
},
|
||||
]
|
||||
|
||||
test_libudev_base = {
|
||||
'link_with' : [libudevd_core, libshared],
|
||||
'dependencies' : [threads, libacl],
|
||||
}
|
||||
|
||||
tests += [
|
||||
{
|
||||
'sources' : files(
|
||||
'fido_id/test-fido-id-desc.c',
|
||||
'fido_id/fido_id_desc.c',
|
||||
),
|
||||
},
|
||||
{
|
||||
'sources' : files('test-udev-builtin.c'),
|
||||
'base' : test_libudev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-udev-format.c'),
|
||||
'base' : test_libudev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-udev-manager.c'),
|
||||
'base' : test_libudev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-udev-node.c'),
|
||||
'base' : test_libudev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-udev-rules.c'),
|
||||
'base' : test_libudev_base,
|
||||
},
|
||||
{
|
||||
'sources' : files('test-udev-spawn.c'),
|
||||
'base' : test_libudev_base,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -15,5 +15,6 @@ if want_ukify and want_tests != 'false'
|
||||
test('test-ukify',
|
||||
files('test_ukify.py'),
|
||||
args: args,
|
||||
env : test_env)
|
||||
env : test_env,
|
||||
suite : 'ukify')
|
||||
endif
|
||||
|
||||
@@ -17,19 +17,13 @@ executables += [
|
||||
'conditions' : ['ENABLE_XDG_AUTOSTART'],
|
||||
'sources' : files('xdg-autostart-condition.c'),
|
||||
},
|
||||
]
|
||||
|
||||
tests += [
|
||||
{
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
'test-xdg-autostart.c',
|
||||
'xdg-autostart-service.c',
|
||||
),
|
||||
},
|
||||
]
|
||||
|
||||
fuzzers += [
|
||||
{
|
||||
fuzz_template + {
|
||||
'sources' : files(
|
||||
'fuzz-xdg-desktop.c',
|
||||
'xdg-autostart-service.c',
|
||||
|
||||
+22
-34
@@ -1,32 +1,38 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
generate_directives_py = find_program('generate-directives.py')
|
||||
fuzz_generated_in_dir = meson.current_build_dir()
|
||||
|
||||
fuzz_generated_directives = []
|
||||
fuzz_regression_tests = {}
|
||||
|
||||
directives = [['fuzz-network-parser_directives', 'src/network/networkd-network-gperf.gperf'],
|
||||
['fuzz-netdev-parser_directives.netdev', 'src/network/netdev/netdev-gperf.gperf'],
|
||||
['fuzz-link-parser_directives.link', 'src/udev/net/link-config-gperf.gperf'],
|
||||
directives = [['fuzz-network-parser', 'directives.network', networkd_network_gperf_gperf],
|
||||
['fuzz-netdev-parser', 'directives.netdev', networkd_netdev_gperf_gperf],
|
||||
['fuzz-link-parser', 'directives.link', udev_link_gperf_gperf],
|
||||
]
|
||||
|
||||
foreach tuple : directives
|
||||
fuzz_generated_directives += custom_target(
|
||||
tuple[0],
|
||||
output: tuple[0],
|
||||
command: [generate_directives_py, files(project_source_root / tuple[1])],
|
||||
directive = custom_target(
|
||||
tuple[1],
|
||||
output: tuple[1],
|
||||
command: [generate_directives_py, tuple[2]],
|
||||
capture: true)
|
||||
|
||||
dict = { 'directives' : [directive] }
|
||||
fuzz_regression_tests += { tuple[0] : dict }
|
||||
endforeach
|
||||
|
||||
unit_directives = []
|
||||
foreach section : ['Automount', 'Mount', 'Path', 'Scope', 'Service', 'Slice', 'Socket', 'Swap', 'Timer']
|
||||
unit_type = section.to_lower()
|
||||
sec_rx = section == 'Service' ? '(Service|Unit|Install)' : section
|
||||
fuzz_generated_directives += custom_target(
|
||||
'fuzz-unit-file_directives.@0@'.format(unit_type),
|
||||
output: 'fuzz-unit-file_directives.@0@'.format(unit_type),
|
||||
name = 'directives.@0@'.format(unit_type)
|
||||
unit_directives += custom_target(
|
||||
name,
|
||||
output: name,
|
||||
command: [generate_directives_py, load_fragment_gperf_gperf, sec_rx, unit_type],
|
||||
capture: true)
|
||||
endforeach
|
||||
dict = { 'directives' : unit_directives }
|
||||
fuzz_regression_tests += { 'fuzz-unit-file' : dict }
|
||||
|
||||
############################################################
|
||||
|
||||
@@ -58,21 +64,6 @@ else
|
||||
out = run_command(sh, '-c', 'cd "@0@"; echo @1@/*/*'.format(project_source_root, fuzz_testsdir), check: true)
|
||||
endif
|
||||
|
||||
# Fuzz inputs that we generate (see above fuzz_generated_directives)
|
||||
fuzz_regression_tests = {
|
||||
'fuzz-link-parser': [['', 'directives.link']],
|
||||
'fuzz-netdev-parser': [['', 'directives.netdev']],
|
||||
'fuzz-network-parser': [['', 'directives']],
|
||||
'fuzz-unit-file': [['', 'directives.automount'],
|
||||
['', 'directives.mount'],
|
||||
['', 'directives.path'],
|
||||
['', 'directives.scope'],
|
||||
['', 'directives.service'],
|
||||
['', 'directives.slice'],
|
||||
['', 'directives.socket'],
|
||||
['', 'directives.swap'],
|
||||
['', 'directives.timer']]}
|
||||
|
||||
# Add crafted fuzz inputs we have in the repo
|
||||
foreach p : out.stdout().split()
|
||||
# Remove the last entry which is ''.
|
||||
@@ -84,11 +75,8 @@ foreach p : out.stdout().split()
|
||||
endif
|
||||
fuzzer = fs.name(fs.parent(p))
|
||||
fuzz_in = fs.name(p)
|
||||
if fuzzer not in fuzz_regression_tests
|
||||
fuzz_regression_tests += {fuzzer: []}
|
||||
endif
|
||||
# Meson parser provision for: fuzz_regression_tests[fuzzer] += [fuzz_in]
|
||||
l = fuzz_regression_tests[fuzzer]
|
||||
l += [[fuzz_testsdir, fuzz_in]]
|
||||
fuzz_regression_tests += {fuzzer: l}
|
||||
|
||||
dict = fuzz_regression_tests.get(fuzzer, {})
|
||||
dict += { 'files' : dict.get('files', []) + files(fuzzer / fuzz_in) }
|
||||
fuzz_regression_tests += { fuzzer : dict }
|
||||
endforeach
|
||||
|
||||
+180
-22
@@ -49,30 +49,126 @@ if install_tests
|
||||
unittestsdir / 'testdata')
|
||||
endif
|
||||
|
||||
test_bootctl_json_sh = find_program('test-bootctl-json.sh')
|
||||
test_fstab_generator_sh = find_program('test-fstab-generator.sh')
|
||||
test_network_generator_conversion_sh = find_program('test-network-generator-conversion.sh')
|
||||
test_systemctl_enable_sh = find_program('test-systemctl-enable.sh')
|
||||
test_systemd_tmpfiles_py = find_program('test-systemd-tmpfiles.py')
|
||||
hwdb_test_sh = find_program('hwdb-test.sh')
|
||||
############################################################
|
||||
|
||||
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(),
|
||||
depends : exe,
|
||||
suite : 'sysusers')
|
||||
|
||||
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(),
|
||||
depends : exe,
|
||||
suite : 'sysusers')
|
||||
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
|
||||
|
||||
############################################################
|
||||
|
||||
test_sysusers_sh = configure_file(
|
||||
input : 'test-sysusers.sh.in',
|
||||
output : 'test-sysusers.sh',
|
||||
configuration : conf)
|
||||
if install_tests and conf.get('ENABLE_SYSUSERS') == 1
|
||||
install_data(test_sysusers_sh,
|
||||
install_dir : unittestsdir)
|
||||
install_subdir('test-sysusers',
|
||||
exclude_files : '.gitattributes',
|
||||
install_dir : testdata_dir)
|
||||
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()],
|
||||
depends : [systemctl, systemd_id128],
|
||||
suite : 'systemctl')
|
||||
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,
|
||||
depends : exe,
|
||||
suite : 'sysv')
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
if want_tests != 'false' and conf.get('HAVE_BLKID') == 1 and conf.get('ENABLE_BOOTLOADER') == 1
|
||||
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(),
|
||||
depends : exe,
|
||||
suite : 'boot')
|
||||
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(),
|
||||
depends : exe,
|
||||
suite : 'tmpfiles')
|
||||
|
||||
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(),
|
||||
depends : exe,
|
||||
suite : 'tmpfiles')
|
||||
endif
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
test_compare_versions_sh = files('test-compare-versions.sh')
|
||||
if want_tests != 'false'
|
||||
exe = executables_by_name.get('systemd-analyze')
|
||||
test('test-compare-versions',
|
||||
test_compare_versions_sh,
|
||||
args : exe.full_path(),
|
||||
depends : exe,
|
||||
suite : 'test')
|
||||
endif
|
||||
if install_tests
|
||||
install_data(test_compare_versions_sh,
|
||||
install_dir : unittestsdir)
|
||||
@@ -86,6 +182,12 @@ if want_tests != 'false'
|
||||
rule_syntax_check_py,
|
||||
suite : 'dist',
|
||||
args : all_rules)
|
||||
|
||||
exe = executables_by_name.get('udevadm')
|
||||
test('udev-rules-check',
|
||||
exe,
|
||||
suite : 'udev',
|
||||
args : ['verify', '--resolve-names=never', all_rules])
|
||||
endif
|
||||
|
||||
############################################################
|
||||
@@ -94,11 +196,40 @@ if install_tests
|
||||
install_data('run-unit-tests.py',
|
||||
install_mode : 'rwxr-xr-x',
|
||||
install_dir : testsdir)
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
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,
|
||||
depends : exe,
|
||||
suite : 'fstab')
|
||||
endif
|
||||
if install_tests
|
||||
install_data('test-fstab-generator.sh',
|
||||
install_mode : 'rwxr-xr-x',
|
||||
install_dir : unittestsdir)
|
||||
endif
|
||||
|
||||
############################################################
|
||||
|
||||
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(),
|
||||
depends : exe,
|
||||
suite : 'network')
|
||||
endif
|
||||
if install_tests
|
||||
install_data('test-network-generator-conversion.sh',
|
||||
install_mode : 'rwxr-xr-x',
|
||||
install_dir : unittestsdir)
|
||||
@@ -108,7 +239,16 @@ endif
|
||||
|
||||
sys_script_py = files('sys-script.py')
|
||||
test_udev_py = files('test-udev.py')
|
||||
|
||||
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,
|
||||
timeout : 180,
|
||||
suite : 'udev')
|
||||
endif
|
||||
if install_tests
|
||||
install_data(
|
||||
sys_script_py,
|
||||
@@ -135,8 +275,9 @@ endif
|
||||
|
||||
############################################################
|
||||
|
||||
if want_tests != 'false' and dmi_arches.contains(host_machine.cpu_family())
|
||||
if want_tests != 'false' and conf.get('HAVE_DMI') == 1
|
||||
udev_dmi_memory_id_test = find_program('udev-dmi-memory-id-test.sh')
|
||||
exe = executables_by_name.get('dmi_memory_id')
|
||||
|
||||
if git.found() and fs.is_dir(project_source_root / '.git')
|
||||
out = run_command(
|
||||
@@ -154,12 +295,29 @@ if want_tests != 'false' and dmi_arches.contains(host_machine.cpu_family())
|
||||
source = project_source_root / p
|
||||
test('dmidecode_' + fs.stem(p),
|
||||
udev_dmi_memory_id_test,
|
||||
suite : 'dist',
|
||||
args : [udev_prog_paths['dmi_memory_id'].full_path(),
|
||||
suite : 'udev',
|
||||
args : [exe.full_path(),
|
||||
source,
|
||||
source + '.txt'],
|
||||
depends : udev_prog_paths['dmi_memory_id'])
|
||||
depends : exe)
|
||||
endforeach
|
||||
endif
|
||||
|
||||
subdir('fuzz')
|
||||
############################################################
|
||||
|
||||
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,
|
||||
depends : deps,
|
||||
suite : 'kernel-install')
|
||||
endif
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ SYS_SCRIPT = Path(__file__).with_name('sys-script.py')
|
||||
try:
|
||||
UDEV_BIN = Path(os.environ['UDEV_RULE_RUNNER'])
|
||||
except KeyError:
|
||||
UDEV_BIN = Path(__file__).parent / 'manual/udev-rule-runner'
|
||||
UDEV_BIN = Path(__file__).parent / 'manual/test-udev-rule-runner'
|
||||
UDEV_BIN = UDEV_BIN.absolute()
|
||||
|
||||
# Those will be set by the udev_setup() fixture
|
||||
|
||||
Reference in New Issue
Block a user