From 81bfa389405a76eae6016366729d4259e60942b8 Mon Sep 17 00:00:00 2001 From: David du Colombier Date: Tue, 20 Oct 2026 23:29:27 +0200 Subject: [PATCH] Serialize the filehash DoS tests test_probes_filehash_dos.sh and test_probes_filehash58_dos.sh both create and remove /tmp/oscap-test-fifo and /tmp/oscap-test-symlink, the paths their OVAL definitions name. Under ctest -j, when both run, one removes the files the other is about to read, or fails to create a file the other just made. A RESOURCE_LOCK on both runs them one at a time. The filehash test exists only with OPENSCAP_ENABLE_SHA1 and OPENSCAP_ENABLE_MD5 on, both off by default. Built with both on, 50 runs of ctest -j2 over the two tests on Fedora 44 failed twice on main, each time in test_probes_filehash58_dos.sh 0.3 seconds in. With this change the 50 runs passed. --- tests/probes/filehash/CMakeLists.txt | 1 + tests/probes/filehash58/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/probes/filehash/CMakeLists.txt b/tests/probes/filehash/CMakeLists.txt index 3bfdf8c284..391f2feba1 100644 --- a/tests/probes/filehash/CMakeLists.txt +++ b/tests/probes/filehash/CMakeLists.txt @@ -1,4 +1,5 @@ if(OPENSCAP_PROBE_INDEPENDENT_FILEHASH) add_oscap_test("test_probes_filehash.sh") add_oscap_test("test_probes_filehash_dos.sh") + set_tests_properties("probes/filehash/test_probes_filehash_dos.sh" PROPERTIES RESOURCE_LOCK oscap_test_dos_files) endif() diff --git a/tests/probes/filehash58/CMakeLists.txt b/tests/probes/filehash58/CMakeLists.txt index febed6127e..45550757b3 100644 --- a/tests/probes/filehash58/CMakeLists.txt +++ b/tests/probes/filehash58/CMakeLists.txt @@ -1,5 +1,6 @@ if(ENABLE_PROBES_INDEPENDENT) add_oscap_test("test_probes_filehash58.sh") add_oscap_test("test_probes_filehash58_dos.sh") + set_tests_properties("probes/filehash58/test_probes_filehash58_dos.sh" PROPERTIES RESOURCE_LOCK oscap_test_dos_files) add_oscap_test("rhbz1959570_segfault.sh") endif()