]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-21-DFUZZER: skip test when no sanitizer is enabled
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 9 May 2025 08:45:26 +0000 (17:45 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 28 May 2025 11:50:50 +0000 (12:50 +0100)
(cherry picked from commit 59dd6505012317eea4bb2b9c353dc6d7a1f65064)

.github/workflows/mkosi.yml
test/integration-tests/integration-test-wrapper.py
test/units/TEST-21-DFUZZER.sh

index f1b5ec793c29c7b17833b4b67717c1dc1899e3d1..9a50c16eba0d9a79cc19a04ae929f982e573a8b4 100644 (file)
@@ -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 \
index f0d0de359dea6c6977f263d6d214c60e51b5b925..2e87d39901b7bbb08c4c91cfc6fafdeacd2cdf23 100755 (executable)
@@ -471,6 +471,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')
index 08ebfd91eb65996e10908dc46c53b7a8cfb7d384..ac49938c380612db0ccb768580f9c44e7a40d2bc 100755 (executable)
@@ -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