1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 10:51:20 +03:00
systemd/test/fuzz/meson.build

42 lines
1.5 KiB
Meson
Raw Normal View History

# SPDX-License-Identifier: LGPL-2.1-or-later
# The 'optimization' option was introduced in meson 0.48.0, so let's keep
# the code compatible with older versions as well
if meson.version().version_compare('>=0.48.0')
optimization = '--optimization=@0@'.format(get_option('optimization'))
else
optimization = ''
endif
sanitize_address_undefined = custom_target(
'sanitize-address-undefined-fuzzers',
output : 'sanitize-address-undefined-fuzzers',
command : [meson_build_sh,
project_source_root,
'@OUTPUT@',
'fuzzers',
'-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined @0@'.format(optimization),
' '.join(cc.cmd_array()),
cxx_cmd])
sanitizers = [['address,undefined', sanitize_address_undefined]]
meson: treat all fuzz cases as unit tests 318/365 fuzz-bus-message:crash-26bba7182dedc8848939931d9fcefcb7922f2e56:address OK 0.03 s 319/365 fuzz-bus-message:crash-29ed3c202e0ffade3cad42c8bbeb6cc68a21eb8e:address OK 0.03 s 320/365 fuzz-bus-message:crash-b88ad9ecf4aacf4a0caca5b5543953265367f084:address OK 0.03 s 321/365 fuzz-bus-message:crash-c1b37b4729b42c0c05b23cba4eed5d8102498a1e:address OK 0.03 s 322/365 fuzz-bus-message:crash-d8f3941c74219b4c03532c9b244d5ea539c61af5:address OK 0.03 s 323/365 fuzz-bus-message:crash-e1b811da5ca494e494b77c6bd8e1c2f2989425c5:address OK 0.03 s 324/365 fuzz-bus-message:leak-c09c0e2256d43bc5e2d02748c8d8760e7bc25d20:address OK 0.04 s 325/365 fuzz-bus-message:message1:address OK 0.03 s 326/365 fuzz-bus-message:timeout-08ee8f6446a4064db064e8e0b3d220147f7d0b5b:address OK 0.03 s 327/365 fuzz-dhcp-server:discover-existing:address OK 0.04 s 328/365 fuzz-dhcp-server:discover-new:address OK 0.03 s 329/365 fuzz-dhcp-server:release:address OK 0.04 s 330/365 fuzz-dhcp-server:request-existing:address OK 0.03 s 331/365 fuzz-dhcp-server:request-new:address OK 0.03 s 332/365 fuzz-dhcp-server:request-reboot:address OK 0.03 s 333/365 fuzz-dhcp-server:request-renew:address OK 0.03 s 334/365 fuzz-dns-packet:issue-7888:address OK 0.03 s 335/365 fuzz-dns-packet:oss-fuzz-5465:address OK 0.03 s 336/365 fuzz-journal-remote:crash-5a8f03d4c3a46fcded39527084f437e8e4b54b76:address OK 0.06 s 337/365 fuzz-journal-remote:crash-96dee870ea66d03e89ac321eee28ea63a9b9aa45:address OK 0.04 s 338/365 fuzz-journal-remote:invalid-ts.txt:address OK 0.04 s 339/365 fuzz-journal-remote:oss-fuzz-8659:address OK 0.06 s 340/365 fuzz-journal-remote:oss-fuzz-8686:address OK 0.04 s 341/365 fuzz-journal-remote:sample.txt:address OK 0.07 s 342/365 fuzz-unit-file:directives.service:address OK 0.03 s 343/365 fuzz-unit-file:empty.scope:address OK 0.04 s 344/365 fuzz-unit-file:machine.slice:address OK 0.03 s 345/365 fuzz-unit-file:oss-fuzz-6884:address OK 0.05 s 346/365 fuzz-unit-file:oss-fuzz-6885:address OK 0.03 s 347/365 fuzz-unit-file:oss-fuzz-6886:address OK 0.04 s 348/365 fuzz-unit-file:oss-fuzz-6892:address OK 0.03 s 349/365 fuzz-unit-file:oss-fuzz-6897:address OK 0.05 s 350/365 fuzz-unit-file:oss-fuzz-6897-evverx:address OK 0.04 s 351/365 fuzz-unit-file:oss-fuzz-6908:address OK 0.05 s 352/365 fuzz-unit-file:oss-fuzz-6917:address OK 0.06 s 353/365 fuzz-unit-file:oss-fuzz-6977:address OK 0.08 s 354/365 fuzz-unit-file:oss-fuzz-6977-unminimized:address OK 0.10 s 355/365 fuzz-unit-file:oss-fuzz-7004:address OK 0.03 s 356/365 fuzz-unit-file:oss-fuzz-8064:address OK 0.03 s 357/365 fuzz-unit-file:oss-fuzz-8827:address OK 0.50 s 358/365 fuzz-unit-file:proc-sys-fs-binfmt_misc.automount:address OK 0.03 s 359/365 fuzz-unit-file:syslog.socket:address OK 0.03 s 360/365 fuzz-unit-file:systemd-ask-password-console.path:address OK 0.03 s 361/365 fuzz-unit-file:systemd-machined.service:address OK 0.03 s 362/365 fuzz-unit-file:systemd-resolved.service:address OK 0.03 s 363/365 fuzz-unit-file:systemd-tmpfiles-clean.timer:address OK 0.03 s 364/365 fuzz-unit-file:timers.target:address OK 0.03 s 365/365 fuzz-unit-file:var-lib-machines.mount:address OK 0.04 s This gives us slightly nicer coverage in the normal test run. When in a git repo, git ls-files is used to get a list of files known to git. This mirrors what update-man-rules does for man files. Only looking at files known to git makes it easier to not forget to commit the test file to git, and also makes bisecting easier if some files are left in repo. When outside of a git repo, we expect to be unpacked from a tarball, so just using all files reported by ls is OK.
2018-08-10 18:15:05 +03:00
if git.found()
meson: call find_program() once and reuse the variable everywhere Meson 0.58 has gotten quite bad with emitting a message every time a quoted command is used: Program /home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh found: YES (/home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program xsltproc found: YES (/usr/bin/xsltproc) Configuring custom-entities.ent using configuration Message: Skipping bootctl.1 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping journal-remote.conf.5 because HAVE_MICROHTTPD is false Message: Skipping journal-upload.conf.5 because HAVE_MICROHTTPD is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping loader.conf.5 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) ... Let's suffer one message only for each command. Hopefully we can silence even this when https://github.com/mesonbuild/meson/issues/8642 is resolved.
2021-05-14 15:16:17 +03:00
out = run_command(env, '-u', 'GIT_WORK_TREE',
git, '--git-dir=@0@/.git'.format(project_source_root),
'ls-files', ':/test/fuzz/*/*')
meson: treat all fuzz cases as unit tests 318/365 fuzz-bus-message:crash-26bba7182dedc8848939931d9fcefcb7922f2e56:address OK 0.03 s 319/365 fuzz-bus-message:crash-29ed3c202e0ffade3cad42c8bbeb6cc68a21eb8e:address OK 0.03 s 320/365 fuzz-bus-message:crash-b88ad9ecf4aacf4a0caca5b5543953265367f084:address OK 0.03 s 321/365 fuzz-bus-message:crash-c1b37b4729b42c0c05b23cba4eed5d8102498a1e:address OK 0.03 s 322/365 fuzz-bus-message:crash-d8f3941c74219b4c03532c9b244d5ea539c61af5:address OK 0.03 s 323/365 fuzz-bus-message:crash-e1b811da5ca494e494b77c6bd8e1c2f2989425c5:address OK 0.03 s 324/365 fuzz-bus-message:leak-c09c0e2256d43bc5e2d02748c8d8760e7bc25d20:address OK 0.04 s 325/365 fuzz-bus-message:message1:address OK 0.03 s 326/365 fuzz-bus-message:timeout-08ee8f6446a4064db064e8e0b3d220147f7d0b5b:address OK 0.03 s 327/365 fuzz-dhcp-server:discover-existing:address OK 0.04 s 328/365 fuzz-dhcp-server:discover-new:address OK 0.03 s 329/365 fuzz-dhcp-server:release:address OK 0.04 s 330/365 fuzz-dhcp-server:request-existing:address OK 0.03 s 331/365 fuzz-dhcp-server:request-new:address OK 0.03 s 332/365 fuzz-dhcp-server:request-reboot:address OK 0.03 s 333/365 fuzz-dhcp-server:request-renew:address OK 0.03 s 334/365 fuzz-dns-packet:issue-7888:address OK 0.03 s 335/365 fuzz-dns-packet:oss-fuzz-5465:address OK 0.03 s 336/365 fuzz-journal-remote:crash-5a8f03d4c3a46fcded39527084f437e8e4b54b76:address OK 0.06 s 337/365 fuzz-journal-remote:crash-96dee870ea66d03e89ac321eee28ea63a9b9aa45:address OK 0.04 s 338/365 fuzz-journal-remote:invalid-ts.txt:address OK 0.04 s 339/365 fuzz-journal-remote:oss-fuzz-8659:address OK 0.06 s 340/365 fuzz-journal-remote:oss-fuzz-8686:address OK 0.04 s 341/365 fuzz-journal-remote:sample.txt:address OK 0.07 s 342/365 fuzz-unit-file:directives.service:address OK 0.03 s 343/365 fuzz-unit-file:empty.scope:address OK 0.04 s 344/365 fuzz-unit-file:machine.slice:address OK 0.03 s 345/365 fuzz-unit-file:oss-fuzz-6884:address OK 0.05 s 346/365 fuzz-unit-file:oss-fuzz-6885:address OK 0.03 s 347/365 fuzz-unit-file:oss-fuzz-6886:address OK 0.04 s 348/365 fuzz-unit-file:oss-fuzz-6892:address OK 0.03 s 349/365 fuzz-unit-file:oss-fuzz-6897:address OK 0.05 s 350/365 fuzz-unit-file:oss-fuzz-6897-evverx:address OK 0.04 s 351/365 fuzz-unit-file:oss-fuzz-6908:address OK 0.05 s 352/365 fuzz-unit-file:oss-fuzz-6917:address OK 0.06 s 353/365 fuzz-unit-file:oss-fuzz-6977:address OK 0.08 s 354/365 fuzz-unit-file:oss-fuzz-6977-unminimized:address OK 0.10 s 355/365 fuzz-unit-file:oss-fuzz-7004:address OK 0.03 s 356/365 fuzz-unit-file:oss-fuzz-8064:address OK 0.03 s 357/365 fuzz-unit-file:oss-fuzz-8827:address OK 0.50 s 358/365 fuzz-unit-file:proc-sys-fs-binfmt_misc.automount:address OK 0.03 s 359/365 fuzz-unit-file:syslog.socket:address OK 0.03 s 360/365 fuzz-unit-file:systemd-ask-password-console.path:address OK 0.03 s 361/365 fuzz-unit-file:systemd-machined.service:address OK 0.03 s 362/365 fuzz-unit-file:systemd-resolved.service:address OK 0.03 s 363/365 fuzz-unit-file:systemd-tmpfiles-clean.timer:address OK 0.03 s 364/365 fuzz-unit-file:timers.target:address OK 0.03 s 365/365 fuzz-unit-file:var-lib-machines.mount:address OK 0.04 s This gives us slightly nicer coverage in the normal test run. When in a git repo, git ls-files is used to get a list of files known to git. This mirrors what update-man-rules does for man files. Only looking at files known to git makes it easier to not forget to commit the test file to git, and also makes bisecting easier if some files are left in repo. When outside of a git repo, we expect to be unpacked from a tarball, so just using all files reported by ls is OK.
2018-08-10 18:15:05 +03:00
else
meson: call find_program() once and reuse the variable everywhere Meson 0.58 has gotten quite bad with emitting a message every time a quoted command is used: Program /home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh found: YES (/home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program xsltproc found: YES (/usr/bin/xsltproc) Configuring custom-entities.ent using configuration Message: Skipping bootctl.1 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping journal-remote.conf.5 because HAVE_MICROHTTPD is false Message: Skipping journal-upload.conf.5 because HAVE_MICROHTTPD is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping loader.conf.5 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) ... Let's suffer one message only for each command. Hopefully we can silence even this when https://github.com/mesonbuild/meson/issues/8642 is resolved.
2021-05-14 15:16:17 +03:00
out = run_command(sh, '-c', 'ls @0@/test/fuzz/*/*'.format(project_source_root))
meson: treat all fuzz cases as unit tests 318/365 fuzz-bus-message:crash-26bba7182dedc8848939931d9fcefcb7922f2e56:address OK 0.03 s 319/365 fuzz-bus-message:crash-29ed3c202e0ffade3cad42c8bbeb6cc68a21eb8e:address OK 0.03 s 320/365 fuzz-bus-message:crash-b88ad9ecf4aacf4a0caca5b5543953265367f084:address OK 0.03 s 321/365 fuzz-bus-message:crash-c1b37b4729b42c0c05b23cba4eed5d8102498a1e:address OK 0.03 s 322/365 fuzz-bus-message:crash-d8f3941c74219b4c03532c9b244d5ea539c61af5:address OK 0.03 s 323/365 fuzz-bus-message:crash-e1b811da5ca494e494b77c6bd8e1c2f2989425c5:address OK 0.03 s 324/365 fuzz-bus-message:leak-c09c0e2256d43bc5e2d02748c8d8760e7bc25d20:address OK 0.04 s 325/365 fuzz-bus-message:message1:address OK 0.03 s 326/365 fuzz-bus-message:timeout-08ee8f6446a4064db064e8e0b3d220147f7d0b5b:address OK 0.03 s 327/365 fuzz-dhcp-server:discover-existing:address OK 0.04 s 328/365 fuzz-dhcp-server:discover-new:address OK 0.03 s 329/365 fuzz-dhcp-server:release:address OK 0.04 s 330/365 fuzz-dhcp-server:request-existing:address OK 0.03 s 331/365 fuzz-dhcp-server:request-new:address OK 0.03 s 332/365 fuzz-dhcp-server:request-reboot:address OK 0.03 s 333/365 fuzz-dhcp-server:request-renew:address OK 0.03 s 334/365 fuzz-dns-packet:issue-7888:address OK 0.03 s 335/365 fuzz-dns-packet:oss-fuzz-5465:address OK 0.03 s 336/365 fuzz-journal-remote:crash-5a8f03d4c3a46fcded39527084f437e8e4b54b76:address OK 0.06 s 337/365 fuzz-journal-remote:crash-96dee870ea66d03e89ac321eee28ea63a9b9aa45:address OK 0.04 s 338/365 fuzz-journal-remote:invalid-ts.txt:address OK 0.04 s 339/365 fuzz-journal-remote:oss-fuzz-8659:address OK 0.06 s 340/365 fuzz-journal-remote:oss-fuzz-8686:address OK 0.04 s 341/365 fuzz-journal-remote:sample.txt:address OK 0.07 s 342/365 fuzz-unit-file:directives.service:address OK 0.03 s 343/365 fuzz-unit-file:empty.scope:address OK 0.04 s 344/365 fuzz-unit-file:machine.slice:address OK 0.03 s 345/365 fuzz-unit-file:oss-fuzz-6884:address OK 0.05 s 346/365 fuzz-unit-file:oss-fuzz-6885:address OK 0.03 s 347/365 fuzz-unit-file:oss-fuzz-6886:address OK 0.04 s 348/365 fuzz-unit-file:oss-fuzz-6892:address OK 0.03 s 349/365 fuzz-unit-file:oss-fuzz-6897:address OK 0.05 s 350/365 fuzz-unit-file:oss-fuzz-6897-evverx:address OK 0.04 s 351/365 fuzz-unit-file:oss-fuzz-6908:address OK 0.05 s 352/365 fuzz-unit-file:oss-fuzz-6917:address OK 0.06 s 353/365 fuzz-unit-file:oss-fuzz-6977:address OK 0.08 s 354/365 fuzz-unit-file:oss-fuzz-6977-unminimized:address OK 0.10 s 355/365 fuzz-unit-file:oss-fuzz-7004:address OK 0.03 s 356/365 fuzz-unit-file:oss-fuzz-8064:address OK 0.03 s 357/365 fuzz-unit-file:oss-fuzz-8827:address OK 0.50 s 358/365 fuzz-unit-file:proc-sys-fs-binfmt_misc.automount:address OK 0.03 s 359/365 fuzz-unit-file:syslog.socket:address OK 0.03 s 360/365 fuzz-unit-file:systemd-ask-password-console.path:address OK 0.03 s 361/365 fuzz-unit-file:systemd-machined.service:address OK 0.03 s 362/365 fuzz-unit-file:systemd-resolved.service:address OK 0.03 s 363/365 fuzz-unit-file:systemd-tmpfiles-clean.timer:address OK 0.03 s 364/365 fuzz-unit-file:timers.target:address OK 0.03 s 365/365 fuzz-unit-file:var-lib-machines.mount:address OK 0.04 s This gives us slightly nicer coverage in the normal test run. When in a git repo, git ls-files is used to get a list of files known to git. This mirrors what update-man-rules does for man files. Only looking at files known to git makes it easier to not forget to commit the test file to git, and also makes bisecting easier if some files are left in repo. When outside of a git repo, we expect to be unpacked from a tarball, so just using all files reported by ls is OK.
2018-08-10 18:15:05 +03:00
endif
fuzz_regression_tests = []
foreach p : out.stdout().split()
# Remove the last entry which is ''.
#
# Also, backslashes get mangled, so skip test. See
# https://github.com/mesonbuild/meson/issues/1564.
if not p.contains('\\')
fuzz_regression_tests += p
endif
endforeach