From: Yu Watanabe Date: Fri, 9 May 2025 08:45:26 +0000 (+0900) Subject: TEST-21-DFUZZER: skip test when no sanitizer is enabled X-Git-Tag: v258-rc1~618^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=59dd6505012317eea4bb2b9c353dc6d7a1f65064;p=thirdparty%2Fsystemd.git TEST-21-DFUZZER: skip test when no sanitizer is enabled --- diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 511240435cf..83f1d06caf0 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -61,7 +61,6 @@ jobs: cflags: "-O2 -D_FORTIFY_SOURCE=3" relabel: no vm: 1 - skip: TEST-21-DFUZZER - distro: debian release: testing sanitizers: "" @@ -69,7 +68,6 @@ jobs: cflags: "-Og" relabel: no vm: 0 - skip: TEST-21-DFUZZER - distro: ubuntu release: noble sanitizers: "" @@ -77,7 +75,6 @@ jobs: cflags: "-Og" relabel: no vm: 0 - skip: TEST-21-DFUZZER - distro: fedora release: "42" sanitizers: address,undefined @@ -92,7 +89,6 @@ jobs: cflags: "-Og" relabel: yes vm: 0 - skip: TEST-21-DFUZZER - distro: opensuse release: tumbleweed sanitizers: "" @@ -100,7 +96,6 @@ jobs: cflags: "-Og" relabel: no vm: 0 - skip: TEST-21-DFUZZER - distro: centos release: "9" sanitizers: "" @@ -108,7 +103,6 @@ jobs: cflags: "-Og" relabel: yes vm: 0 - skip: TEST-21-DFUZZER - distro: centos release: "10" sanitizers: "" @@ -116,7 +110,6 @@ jobs: cflags: "-Og" relabel: yes vm: 0 - skip: TEST-21-DFUZZER steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 @@ -228,7 +221,6 @@ jobs: sudo --preserve-env mkosi sandbox -- \ env \ TEST_PREFER_QEMU=${{ matrix.vm }} \ - TEST_SKIP=${{ matrix.skip }} \ meson test \ -C build \ --no-rebuild \ diff --git a/test/integration-tests/integration-test-wrapper.py b/test/integration-tests/integration-test-wrapper.py index 77552cbfad6..5f456cd3e9f 100755 --- a/test/integration-tests/integration-test-wrapper.py +++ b/test/integration-tests/integration-test-wrapper.py @@ -490,6 +490,14 @@ def main() -> None: """ ) + if os.getenv('TEST_RUN_DFUZZER'): + dropin += textwrap.dedent( + f""" + [Service] + Environment=TEST_RUN_DFUZZER={os.environ['TEST_RUN_DFUZZER']} + """ + ) + if os.getenv('TEST_JOURNAL_USE_TMP', '0') == '1': if statfs(Path('/tmp')) != 'tmpfs' and statfs(Path('/dev/shm')) == 'tmpfs': tmp = Path('/dev/shm') diff --git a/test/units/TEST-21-DFUZZER.sh b/test/units/TEST-21-DFUZZER.sh index 08ebfd91eb6..ac49938c380 100755 --- a/test/units/TEST-21-DFUZZER.sh +++ b/test/units/TEST-21-DFUZZER.sh @@ -9,6 +9,11 @@ if ! command -v dfuzzer &>/dev/null; then exit 77 fi +if [[ ! -v ASAN_OPTIONS && ! -v UBSAN_OPTIONS && "${TEST_RUN_DFUZZER:-0}" == "0" ]]; then + echo "no sanitizer is enabled, skipping. (Hint: set TEST_RUN_DFUZZER=1 to run test forcibly)." + exit 77 +fi + # Save the end.service state before we start fuzzing, as it might get changed # on the fly by one of the fuzzers systemctl list-jobs | grep -F 'end.service' && SHUTDOWN_AT_EXIT=1 || SHUTDOWN_AT_EXIT=0