From 9c401688e33aea4087530af75d2eeb32f0eb1827 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Thu, 18 Dec 2025 13:06:19 -0600 Subject: [PATCH 01/15] Fix test_remediation_blueprint if OpenSCAP is in source path --- tests/API/XCCDF/unittests/test_remediation_blueprint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/API/XCCDF/unittests/test_remediation_blueprint.sh b/tests/API/XCCDF/unittests/test_remediation_blueprint.sh index 8ea9fcab83..c1f141e0c0 100755 --- a/tests/API/XCCDF/unittests/test_remediation_blueprint.sh +++ b/tests/API/XCCDF/unittests/test_remediation_blueprint.sh @@ -23,7 +23,7 @@ echo "Result file = $result" # The expected file was generated without ' # This file was generated by OpenSCAP 1.3.5 using:' line # to make the test independent from the scanner version. We have to filter this line from the output as well. -$OSCAP xccdf generate fix --fix-type blueprint --profile 'common' "$input_xml" | grep -v "OpenSCAP" > "$result" +$OSCAP xccdf generate fix --fix-type blueprint --profile 'common' "$input_xml" | grep -v "OpenSCAP " > "$result" diff "$expected_result" "$result" From 1b88768bd72454ca0a21bec3939db8b9d42fd1bf Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Tue, 16 Jun 2026 13:20:17 -0500 Subject: [PATCH 02/15] Add RESOURCE_LOCK to tests so they can run in parallel --- tests/API/OVAL/unittests/CMakeLists.txt | 6 ++++ tests/API/XCCDF/applicability/CMakeLists.txt | 7 ++++ tests/API/XCCDF/unittests/CMakeLists.txt | 38 ++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/tests/API/OVAL/unittests/CMakeLists.txt b/tests/API/OVAL/unittests/CMakeLists.txt index 99052ef739..ce1eb2e790 100644 --- a/tests/API/OVAL/unittests/CMakeLists.txt +++ b/tests/API/OVAL/unittests/CMakeLists.txt @@ -38,3 +38,9 @@ add_oscap_test("test_variable_in_filter.sh") add_oscap_test("test_without_syschars.sh") add_oscap_test("test_xmlns_missing.sh") add_oscap_test("test_xsinil_envv58_pid.sh") + +set_tests_properties( + "API/OVAL/unittests/test_state_check_existence.sh" + "API/OVAL/unittests/test_statetype_operator.sh" + PROPERTIES RESOURCE_LOCK tmp_foo_file_lock +) diff --git a/tests/API/XCCDF/applicability/CMakeLists.txt b/tests/API/XCCDF/applicability/CMakeLists.txt index 705ac45c92..908fe6a7b2 100644 --- a/tests/API/XCCDF/applicability/CMakeLists.txt +++ b/tests/API/XCCDF/applicability/CMakeLists.txt @@ -7,3 +7,10 @@ add_oscap_test("test_remediate_fix_notapplicable.sh") add_oscap_test("test_remediate_fix_processing.sh") add_oscap_test("test_remediate_fix_processing_ds.sh") add_oscap_test("test_report_anaconda_fixes.sh") + +set_tests_properties( + "API/XCCDF/applicability/test_remediate_fix_processing_ds.sh" + "API/XCCDF/applicability/test_remediate_fix_processing.sh" + "API/XCCDF/applicability/test_remediate_fix_notapplicable.sh" + PROPERTIES RESOURCE_LOCK test_file_lock +) diff --git a/tests/API/XCCDF/unittests/CMakeLists.txt b/tests/API/XCCDF/unittests/CMakeLists.txt index ffc87beb2f..088cb861a0 100644 --- a/tests/API/XCCDF/unittests/CMakeLists.txt +++ b/tests/API/XCCDF/unittests/CMakeLists.txt @@ -121,3 +121,41 @@ add_oscap_test("test_reference.sh") add_oscap_test("test_remediation_bootc.sh") add_oscap_test("openscap_2289_regression.sh") add_oscap_test("test_null_ptr_regression.sh") + + set_tests_properties( + "API/XCCDF/unittests/test_deriving_xccdf_result_from_oval2.sh" + "API/XCCDF/unittests/test_deriving_xccdf_result_from_oval_multicheck.sh" + "API/XCCDF/unittests/test_deriving_xccdf_result_from_oval.sh" + "API/XCCDF/unittests/test_fix_arf.sh" + "API/XCCDF/unittests/test_multiple_oval_files_with_same_basename.sh" + "API/XCCDF/unittests/test_xccdf_check_multi_check2.sh" + "API/XCCDF/unittests/test_xccdf_check_processing_complex_priority.sh" + "API/XCCDF/unittests/test_xccdf_check_processing_selector_bad.sh" + "API/XCCDF/unittests/test_xccdf_selectors_cluster2.sh" + "API/XCCDF/unittests/test_xccdf_selectors_cluster3.sh" + PROPERTIES RESOURCE_LOCK not_executable_file +) + +set_tests_properties( + "API/XCCDF/unittests/test_fix_instance.sh" + "API/XCCDF/unittests/test_profile_selection_by_suffix.sh" + "API/XCCDF/unittests/test_remediate_perl.sh" + "API/XCCDF/unittests/test_remediate_simple.sh" + "API/XCCDF/unittests/test_remediate_unresolved.sh" + "API/XCCDF/unittests/test_remediation_amp_escaping.sh" + "API/XCCDF/unittests/test_remediation_bad_fix.sh" + "API/XCCDF/unittests/test_remediation_cdata.sh" + "API/XCCDF/unittests/test_remediation_environment.sh" + "API/XCCDF/unittests/test_remediation_fix_without_system.sh" + "API/XCCDF/unittests/test_remediation_invalid_characters.sh" + "API/XCCDF/unittests/test_remediation_simple.sh" + "API/XCCDF/unittests/test_remediation_subs_plain_text_empty.sh" + "API/XCCDF/unittests/test_remediation_subs_plain_text.sh" + "API/XCCDF/unittests/test_remediation_subs_unresolved.sh" + "API/XCCDF/unittests/test_remediation_subs_value_refine_value.sh" + "API/XCCDF/unittests/test_remediation_subs_value_take_first.sh" + "API/XCCDF/unittests/test_remediation_subs_value_title.sh" + "API/XCCDF/unittests/test_remediation_subs_value_without_selector.sh" + "API/XCCDF/unittests/test_remediation_xml_comments.sh" + PROPERTIES RESOURCE_LOCK test_file_lock +) From 42a5c4c76c088fc908ed6a8f52f77bde5c483222 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 12:30:18 -0600 Subject: [PATCH 03/15] Update tests to use dynamic results file name So that we run tests in parallel --- tests/API/XCCDF/unittests/test_xccdf_results_arf_asset.sh | 2 +- tests/curl/test_curl_encoding.sh | 2 +- tests/probes/family/test_probes_family.sh | 2 +- tests/probes/file/test_probes_file.sh | 6 +++--- tests/probes/file/test_probes_file_behaviour.sh | 2 +- .../test_probes_fileextendedattribute.sh | 2 +- tests/probes/filehash/test_probes_filehash.sh | 2 +- tests/probes/filehash58/test_probes_filehash58.sh | 4 ++-- tests/probes/filemd5/test_probes_filemd5.sh | 2 +- tests/probes/fwupdsecattr/test_probes_fwupdsecattr.sh | 2 +- tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.sh | 2 +- tests/probes/interface/test_probes_interface.sh | 2 +- tests/probes/isainfo/test_probes_isainfo.sh | 2 +- tests/probes/password/test_probes_password.sh | 2 +- tests/probes/password/test_probes_password_offline.sh | 2 +- tests/probes/rpm/rpminfo/rpminfo_common.sh | 2 +- .../rpmverify/test_probes_rpmverify_not_equals_operation.sh | 2 +- .../test_probes_rpmverify_not_equals_operation_offline.sh | 2 +- tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile.sh | 2 +- .../rpm/rpmverifyfile/test_probes_rpmverifyfile_offline.sh | 2 +- .../rpm/rpmverifyfile/test_probes_rpmverifyfile_older.sh | 2 +- tests/probes/shadow/test_probes_shadow.sh | 2 +- tests/probes/shadow/test_probes_shadow_offline.sh | 2 +- tests/probes/symlink/test_probes_symlink.sh | 2 +- .../systemdunitproperty/test_probes_systemdunitproperty.sh | 2 +- .../test_probes_systemdunitproperty_mount_wants.sh | 2 +- .../test_probes_systemdunitproperty_offline_mode.sh | 2 +- tests/probes/textfilecontent54/test_negative_instance.sh | 2 +- .../textfilecontent54/test_probes_textfilecontent54.sh | 2 +- tests/probes/uname/test_probes_uname.sh | 2 +- .../yamlfilecontent/test_probes_yamlfilecontent_array.sh | 2 +- .../yamlfilecontent/test_probes_yamlfilecontent_content.sh | 4 ++-- .../yamlfilecontent/test_probes_yamlfilecontent_key.sh | 2 +- .../test_probes_yamlfilecontent_offline_mode.sh | 2 +- .../yamlfilecontent/test_probes_yamlfilecontent_types.sh | 2 +- 35 files changed, 39 insertions(+), 39 deletions(-) diff --git a/tests/API/XCCDF/unittests/test_xccdf_results_arf_asset.sh b/tests/API/XCCDF/unittests/test_xccdf_results_arf_asset.sh index 169ed7a8a4..1fd25e44f4 100755 --- a/tests/API/XCCDF/unittests/test_xccdf_results_arf_asset.sh +++ b/tests/API/XCCDF/unittests/test_xccdf_results_arf_asset.sh @@ -7,7 +7,7 @@ set -o pipefail function test_xccdf_results_arf_asset { local DS="${srcdir}/test_xccdf_results_arf_no_oval.xccdf.xml" - local result="results.xml" + local result="$(mktemp results.XXXXXXX.xml)" local stderr="error.log" [ -f $result ] && rm -f $result diff --git a/tests/curl/test_curl_encoding.sh b/tests/curl/test_curl_encoding.sh index 1c55d496b0..491aff5f68 100755 --- a/tests/curl/test_curl_encoding.sh +++ b/tests/curl/test_curl_encoding.sh @@ -9,7 +9,7 @@ function curl_accept_encoding { require_internet || return 255 local DF="${srcdir}/ds.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" local LOG="verbose.log" $OSCAP xccdf --verbose=DEVEL eval --fetch-remote-resources --results $RF $DF 2>$LOG || echo "OK" diff --git a/tests/probes/family/test_probes_family.sh b/tests/probes/family/test_probes_family.sh index b480639d1a..8d03e35f70 100755 --- a/tests/probes/family/test_probes_family.sh +++ b/tests/probes/family/test_probes_family.sh @@ -22,7 +22,7 @@ function test_probes_family { local ret_val=0; local DF="${srcdir}/test_probes_family.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/file/test_probes_file.sh b/tests/probes/file/test_probes_file.sh index 8ae9787f2a..3111693262 100755 --- a/tests/probes/file/test_probes_file.sh +++ b/tests/probes/file/test_probes_file.sh @@ -22,7 +22,7 @@ function test_probes_file { local ret_val=0; local DF="$srcdir/test_probes_file.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF @@ -50,7 +50,7 @@ function test_probes_file_filenames { local ret_val=0 local DF="$srcdir/test_probes_file_filename.xml" - result="results.xml" + result="$(mktemp results.XXXXXXX.xml)" files_dir=$(mktemp -d) DF_INJECTED=$(mktemp) @@ -95,7 +95,7 @@ function test_probes_file_invalid_utf8 { local ret_val=0 local DF="$srcdir/test_probes_file_filename.xml" - result="results.xml" + result="$(mktemp results.XXXXXXX.xml)" files_dir=$(mktemp -d) DF_INJECTED=$(mktemp) diff --git a/tests/probes/file/test_probes_file_behaviour.sh b/tests/probes/file/test_probes_file_behaviour.sh index b6ca6c6d4b..e4347633e1 100755 --- a/tests/probes/file/test_probes_file_behaviour.sh +++ b/tests/probes/file/test_probes_file_behaviour.sh @@ -40,7 +40,7 @@ function test_probes_file_behaviour { local ret_val=0 local DF="$srcdir/test_probes_file_behaviour.xml" - result="results.xml" + result="$(mktemp results.XXXXXXX.xml)" test_probes_behaviour_setup diff --git a/tests/probes/fileextendedattribute/test_probes_fileextendedattribute.sh b/tests/probes/fileextendedattribute/test_probes_fileextendedattribute.sh index 7149b52c0f..54a3e761c0 100755 --- a/tests/probes/fileextendedattribute/test_probes_fileextendedattribute.sh +++ b/tests/probes/fileextendedattribute/test_probes_fileextendedattribute.sh @@ -12,7 +12,7 @@ function test_probes_fileextendedattribute { local ret_val=0; local DEFFILE="$srcdir/test_probes_fileextendedattribute.xml" - local RESFILE="results.xml" + local RESFILE="$(mktemp results.XXXXXXX.xml)" [ -f $RESFILE ] && rm -f $RESFILE diff --git a/tests/probes/filehash/test_probes_filehash.sh b/tests/probes/filehash/test_probes_filehash.sh index 2765f4dae6..2e23c1ad6a 100755 --- a/tests/probes/filehash/test_probes_filehash.sh +++ b/tests/probes/filehash/test_probes_filehash.sh @@ -24,7 +24,7 @@ function test_probes_filehash { local ret_val=0; local DF="test_probes_filehash.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/filehash58/test_probes_filehash58.sh b/tests/probes/filehash58/test_probes_filehash58.sh index 459654546a..0e4c61cbc3 100755 --- a/tests/probes/filehash58/test_probes_filehash58.sh +++ b/tests/probes/filehash58/test_probes_filehash58.sh @@ -24,7 +24,7 @@ function test_probes_filehash58_old_algos { local ret_val=0; local DF="test_probes_filehash58_old_algos.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF @@ -52,7 +52,7 @@ function test_probes_filehash58_new_algos { local ret_val=0 local DF="test_probes_filehash58_new_algos.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/filemd5/test_probes_filemd5.sh b/tests/probes/filemd5/test_probes_filemd5.sh index 90c5ff7220..cb83283c1c 100755 --- a/tests/probes/filemd5/test_probes_filemd5.sh +++ b/tests/probes/filemd5/test_probes_filemd5.sh @@ -23,7 +23,7 @@ function test_probes_filemd5 { local ret_val=0; local DEFFILE="test_probes_filemd5.xml" - local RESFILE="results.xml" + local RESFILE="$(mktemp results.XXXXXXX.xml)" [ -f $RESFILE ] && rm -f $RESFILE diff --git a/tests/probes/fwupdsecattr/test_probes_fwupdsecattr.sh b/tests/probes/fwupdsecattr/test_probes_fwupdsecattr.sh index 98e0a884d0..ff4ec602e3 100755 --- a/tests/probes/fwupdsecattr/test_probes_fwupdsecattr.sh +++ b/tests/probes/fwupdsecattr/test_probes_fwupdsecattr.sh @@ -16,7 +16,7 @@ function test_probes_fwupdsecattr { local ret_val=0 local DF="${srcdir}/test_probes_fwupdsecattr.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.sh b/tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.sh index b824fe420b..a4a1a0541a 100755 --- a/tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.sh +++ b/tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.sh @@ -10,7 +10,7 @@ function test_probes_fwupdsecattr { local ret_val=0 local DF="${srcdir}/test_probes_fwupdsecattr_mock.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" local DBUS_MOCK_NAME="org.freedesktop.fwupd" local stderr=$(mktemp test_probes_fwupdsecattr_mock.err.XXXXXX) echo "stderr file: $stderr" diff --git a/tests/probes/interface/test_probes_interface.sh b/tests/probes/interface/test_probes_interface.sh index f2b9ad6809..16d1823028 100755 --- a/tests/probes/interface/test_probes_interface.sh +++ b/tests/probes/interface/test_probes_interface.sh @@ -21,7 +21,7 @@ function test_probes_interface { local ret_val=0; local DF="test_probes_interface.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/isainfo/test_probes_isainfo.sh b/tests/probes/isainfo/test_probes_isainfo.sh index 2f331f0821..8dd5e64420 100755 --- a/tests/probes/isainfo/test_probes_isainfo.sh +++ b/tests/probes/isainfo/test_probes_isainfo.sh @@ -22,7 +22,7 @@ function test_probes_isainfo { local ret_val=0; local DF="test_probes_isainfo.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/password/test_probes_password.sh b/tests/probes/password/test_probes_password.sh index 4abc97a23c..f950f4fd6d 100755 --- a/tests/probes/password/test_probes_password.sh +++ b/tests/probes/password/test_probes_password.sh @@ -22,7 +22,7 @@ function test_probes_password { local ret_val=0; local DF="test_probes_password.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/password/test_probes_password_offline.sh b/tests/probes/password/test_probes_password_offline.sh index ed2fac80cb..e8a96ac200 100755 --- a/tests/probes/password/test_probes_password_offline.sh +++ b/tests/probes/password/test_probes_password_offline.sh @@ -25,7 +25,7 @@ function test_probes_password { local ret_val=0; local DF="${srcdir}/test_probes_password_offline.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/rpm/rpminfo/rpminfo_common.sh b/tests/probes/rpm/rpminfo/rpminfo_common.sh index 95afc8fde9..38e3e44a21 100755 --- a/tests/probes/rpm/rpminfo/rpminfo_common.sh +++ b/tests/probes/rpm/rpminfo/rpminfo_common.sh @@ -24,7 +24,7 @@ function test_probes_rpminfo { local ret_val=0; local DF="test_probes_rpminfo.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" rm -f $RF diff --git a/tests/probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation.sh b/tests/probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation.sh index a46009ac17..cb10553866 100755 --- a/tests/probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation.sh +++ b/tests/probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation.sh @@ -11,7 +11,7 @@ function perform_test { rpm -qf /root || return 255 DF="$srcdir/test_probes_rpmverify_not_equals_operation.xml" - RF="results.xml" + RF="$(mktemp results.XXXXXXX.xml)" rm -f $RF diff --git a/tests/probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation_offline.sh b/tests/probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation_offline.sh index 2cb2ec54d1..8e7df8d9d3 100755 --- a/tests/probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation_offline.sh +++ b/tests/probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation_offline.sh @@ -10,7 +10,7 @@ function perform_test { probecheck "rpmverify" || return 255 DF="$srcdir/test_probes_rpmverify_not_equals_operation_offline.xml" - RF="results.xml" + RF="$(mktemp results.XXXXXXX.xml)" rm -f $RF diff --git a/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile.sh b/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile.sh index e913a56c45..de345aec00 100755 --- a/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile.sh +++ b/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile.sh @@ -14,7 +14,7 @@ function test_probes_rpmverifyfile { require "rpm" || return 255 DF="$srcdir/test_probes_rpmverifyfile.xml" - RF="results.xml" + RF="$(mktemp results.XXXXXXX.xml)" rm -f $RF diff --git a/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_offline.sh b/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_offline.sh index 25d2c33dc0..af8bce4e0a 100755 --- a/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_offline.sh +++ b/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_offline.sh @@ -14,7 +14,7 @@ function test_probes_rpmverifyfile { probecheck "rpmverifyfile" || return 255 DF="$srcdir/test_probes_rpmverifyfile_offline.xml" - RF="results.xml" + RF="$(mktemp results.XXXXXXX.xml)" rm -f $RF diff --git a/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_older.sh b/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_older.sh index da74e46712..0a9bbf84cf 100755 --- a/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_older.sh +++ b/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_older.sh @@ -14,7 +14,7 @@ function test_probes_rpmverifyfile { require "rpm" || return 255 DF="$srcdir/test_probes_rpmverifyfile_older.xml" - RF="results.xml" + RF="$(mktemp results.XXXXXXX.xml)" rm -f $RF diff --git a/tests/probes/shadow/test_probes_shadow.sh b/tests/probes/shadow/test_probes_shadow.sh index 13c4746fb4..0be229cafe 100755 --- a/tests/probes/shadow/test_probes_shadow.sh +++ b/tests/probes/shadow/test_probes_shadow.sh @@ -22,7 +22,7 @@ function test_probes_shadow { local ret_val=0; local DF="test_probes_shadow.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/shadow/test_probes_shadow_offline.sh b/tests/probes/shadow/test_probes_shadow_offline.sh index 23e91e1d78..6dc3613c89 100755 --- a/tests/probes/shadow/test_probes_shadow_offline.sh +++ b/tests/probes/shadow/test_probes_shadow_offline.sh @@ -24,7 +24,7 @@ function test_probes_shadow { local ret_val=0; local DF="${srcdir}/test_probes_shadow_offline.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/symlink/test_probes_symlink.sh b/tests/probes/symlink/test_probes_symlink.sh index e966026c38..b5141ea370 100755 --- a/tests/probes/symlink/test_probes_symlink.sh +++ b/tests/probes/symlink/test_probes_symlink.sh @@ -13,7 +13,7 @@ function test_probes_symlink { probecheck "symlink" || return 255 DF="test_probes_symlink.xml" - RF="results.xml" + RF="$(mktemp results.XXXXXXX.xml)" rm -f $RF diff --git a/tests/probes/systemdunitproperty/test_probes_systemdunitproperty.sh b/tests/probes/systemdunitproperty/test_probes_systemdunitproperty.sh index d1e9114bb5..826d96eb3c 100755 --- a/tests/probes/systemdunitproperty/test_probes_systemdunitproperty.sh +++ b/tests/probes/systemdunitproperty/test_probes_systemdunitproperty.sh @@ -16,7 +16,7 @@ function test_probes_systemdunitproperty { local ret_val=0; local DF="${srcdir}/test_probes_systemdunitproperty.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" local stderr=$(mktemp $1.err.XXXXXX) echo "stderr file: $stderr" diff --git a/tests/probes/systemdunitproperty/test_probes_systemdunitproperty_mount_wants.sh b/tests/probes/systemdunitproperty/test_probes_systemdunitproperty_mount_wants.sh index 3e9bdce843..9c5edc3382 100755 --- a/tests/probes/systemdunitproperty/test_probes_systemdunitproperty_mount_wants.sh +++ b/tests/probes/systemdunitproperty/test_probes_systemdunitproperty_mount_wants.sh @@ -15,7 +15,7 @@ function test_probes_systemdunitproperty_mount_wants { systemctl show -- -.mount | grep -Eq "Wants=\S+" || return 255 local DF="${srcdir}/test_probes_systemdunitproperty_mount_wants.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/systemdunitproperty/test_probes_systemdunitproperty_offline_mode.sh b/tests/probes/systemdunitproperty/test_probes_systemdunitproperty_offline_mode.sh index 58d0bd2c9a..3a03fb53f8 100755 --- a/tests/probes/systemdunitproperty/test_probes_systemdunitproperty_offline_mode.sh +++ b/tests/probes/systemdunitproperty/test_probes_systemdunitproperty_offline_mode.sh @@ -17,7 +17,7 @@ function test_probes_systemdunitproperty_offline_mode { local ret_val=0; local DF="${srcdir}/test_probes_systemdunitproperty_offline_mode.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" local stderr=$(mktemp $1.err.XXXXXX) echo "stderr file: $stderr" diff --git a/tests/probes/textfilecontent54/test_negative_instance.sh b/tests/probes/textfilecontent54/test_negative_instance.sh index 960664fb15..207a251507 100755 --- a/tests/probes/textfilecontent54/test_negative_instance.sh +++ b/tests/probes/textfilecontent54/test_negative_instance.sh @@ -8,7 +8,7 @@ function test_negative_instance { local ret_val=0; local DF="${srcdir}/test_negative_instance.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/textfilecontent54/test_probes_textfilecontent54.sh b/tests/probes/textfilecontent54/test_probes_textfilecontent54.sh index 7d9301831f..6b30cf51aa 100755 --- a/tests/probes/textfilecontent54/test_probes_textfilecontent54.sh +++ b/tests/probes/textfilecontent54/test_probes_textfilecontent54.sh @@ -20,7 +20,7 @@ function test_probes_textfilecontent54 { local ret_val=0; local DF="${srcdir}/test_probes_textfilecontent54.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/uname/test_probes_uname.sh b/tests/probes/uname/test_probes_uname.sh index 461dcd98ee..9c055d45dc 100755 --- a/tests/probes/uname/test_probes_uname.sh +++ b/tests/probes/uname/test_probes_uname.sh @@ -23,7 +23,7 @@ function test_probes_uname { local ret_val=0; local DF="test_probes_uname.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.sh index 695a247b3f..57ec538fa2 100755 --- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.sh +++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.sh @@ -8,7 +8,7 @@ function test_probes_yamlfilecontent_array { local ret_val=0 local DF="${srcdir}/test_probes_yamlfilecontent_array.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_content.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_content.sh index f836ea3a91..271235dc30 100755 --- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_content.sh +++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_content.sh @@ -7,7 +7,7 @@ set -e -o pipefail probecheck "yamlfilecontent" || exit 255 oval_file="${srcdir}/test_probes_yamlfilecontent_content.xml" -result="results.xml" +result="$(mktemp results.XXXXXXX.xml)" [ -f $result ] && rm -f $result @@ -21,4 +21,4 @@ assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="foo assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="boolean" and text()="true"]' assert_exists 2 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and text()=""]' -rm -f "$result" \ No newline at end of file +rm -f "$result" diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh index a942552e9c..ad44885752 100755 --- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh +++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh @@ -8,7 +8,7 @@ function test_probes_yamlfilecontent_key { local ret_val=0 local DF="${srcdir}/test_probes_yamlfilecontent_key.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.sh index 6155b05125..280964c745 100755 --- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.sh +++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.sh @@ -10,7 +10,7 @@ function test_probes_yamlfilecontent_offline_mode { local ret_val=0 local DF="${srcdir}/test_probes_yamlfilecontent_offline_mode.xml" - local RF="results.xml" + local RF="$(mktemp results.XXXXXXX.xml)" local YAML_FILE="openshift-logging.yaml" [ -f $RF ] && rm -f $RF diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh index e445771d03..9c9f864191 100755 --- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh +++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh @@ -10,7 +10,7 @@ function test_probes_yamlfilecontent_types { local ret_val=0 local oval_file="${srcdir}/test_probes_yamlfilecontent_types.xml" - local result="results.xml" + local result="$(mktemp results.XXXXXXX.xml)" [ -f $result ] && rm -f $result From 2e9c3bcb9c40c261dba95fcff42a7e675fb10a7d Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 12:30:34 -0600 Subject: [PATCH 04/15] Fix file name in tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh --- .../test_probes_yamlfilecontent_key.sh | 4 ++-- .../test_probes_yamlfilecontent_key.xml | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh index ad44885752..7efecc3c70 100755 --- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh +++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh @@ -12,9 +12,9 @@ function test_probes_yamlfilecontent_key { [ -f $RF ] && rm -f $RF - cp "${srcdir}/openshift-logging.yaml" /tmp + cp "${srcdir}/openshift-logging.yaml" /tmp/openshift-logging_key.yaml - local YAML_FILE="/tmp/openshift-logging.yaml" + local YAML_FILE="/tmp/openshift-logging_key.yaml" $OSCAP oval eval --results $RF $DF diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml index 1697b54fd8..1fdec81a13 100644 --- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml +++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml @@ -155,61 +155,61 @@ /tmp - openshift-logging.yaml + openshift-logging_key.yaml .kind /tmp - openshift-logging.yaml + openshift-logging_key.yaml .metadata.namespace /tmp - openshift-logging.yaml + openshift-logging_key.yaml .metadata /tmp - openshift-logging.yaml + openshift-logging_key.yaml .doesnt.exist /tmp - openshift-logging.yaml + openshift-logging_key.yaml .status.conditions[:]['status','type'] /tmp - openshift-logging.yaml + openshift-logging_key.yaml .status.conditions[:] /tmp - openshift-logging.yaml + openshift-logging_key.yaml .status.conditions[:]['nonexistent','dummy'] /tmp - openshift-logging.yaml + openshift-logging_key.yaml .spec.outputs /tmp - openshift-logging.yaml + openshift-logging_key.yaml .items[:]['requiredDropCapabilities','name','q','z'][:] /tmp - openshift-logging.yaml + openshift-logging_key.yaml .items[:].requiredDropCapabilities[:] From 980ac4149397e8f0c1a48b6ec3d97d3e79200de2 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 12:35:10 -0600 Subject: [PATCH 05/15] Run tests in CI in parallel --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 915da4851e..8c31f9e355 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: working-directory: ./build run: | export $(dbus-launch) - ctest --output-on-failure + ctest --output-on-failure -j$(nproc) build-fedora: name: Build, Test on Fedora Latest (Container) @@ -73,7 +73,7 @@ jobs: working-directory: ./build run: | export $(dbus-launch) - ctest --output-on-failure + ctest --output-on-failure -j$(nproc) build-fedora-nss: name: Build, Test on Fedora Rawhide (NSS) (Container) @@ -96,7 +96,7 @@ jobs: working-directory: ./build run: | export $(dbus-launch) - ctest --output-on-failure + ctest --output-on-failure -j$(nproc) build-macos: # The type of runner that the job will run on From 7a9e84b70bde3da41cf766e72cf02b9c22e428a5 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 14:36:21 -0600 Subject: [PATCH 06/15] Fix up rpminfo tests --- tests/probes/rpm/rpminfo/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/probes/rpm/rpminfo/CMakeLists.txt b/tests/probes/rpm/rpminfo/CMakeLists.txt index 1c03b4dc56..371eacd74f 100644 --- a/tests/probes/rpm/rpminfo/CMakeLists.txt +++ b/tests/probes/rpm/rpminfo/CMakeLists.txt @@ -1,4 +1,10 @@ if(ENABLE_PROBES_LINUX) add_oscap_test("test_probes_rpminfo.sh" LABELS linux linux_only) add_oscap_test("test_probes_rpminfo_offline.sh" LABELS linux linux_only) + + set_tests_properties( + "probes/rpm/rpminfo/test_probes_rpminfo_offline.sh" + "probes/rpm/rpminfo/test_probes_rpminfo.sh" + PROPERTIES RESOURCE_LOCK rpminfo + ) endif() From 6a8fc221807187ae9a7a1c9b3b8aacfd67afc894 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 15:01:51 -0600 Subject: [PATCH 07/15] Fix test_probes_rpmverifypackage_offline.sh --- tests/probes/rpm/rpminfo/rpminfo_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/probes/rpm/rpminfo/rpminfo_common.sh b/tests/probes/rpm/rpminfo/rpminfo_common.sh index 38e3e44a21..95384d5181 100755 --- a/tests/probes/rpm/rpminfo/rpminfo_common.sh +++ b/tests/probes/rpm/rpminfo/rpminfo_common.sh @@ -50,4 +50,4 @@ function test_probes_rpminfo { rm -f $RF $DF return $ret_val -} \ No newline at end of file +} From 30c48504e867ca00a2dd70d359ab7592ad926d6f Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Mon, 5 Jan 2026 15:30:56 -0600 Subject: [PATCH 08/15] Fix test_probes_systemdunit* running in parallel --- tests/probes/systemdunitdependency/CMakeLists.txt | 6 ++++++ tests/probes/systemdunitproperty/CMakeLists.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/tests/probes/systemdunitdependency/CMakeLists.txt b/tests/probes/systemdunitdependency/CMakeLists.txt index 55f62bb93b..b23eeb031a 100644 --- a/tests/probes/systemdunitdependency/CMakeLists.txt +++ b/tests/probes/systemdunitdependency/CMakeLists.txt @@ -3,5 +3,11 @@ if(ENABLE_PROBES_LINUX) add_oscap_test("test_probes_systemdunitdependency.sh" LABELS linux linux_only) add_oscap_test("test_probes_systemdunitdependency_validation.sh" LABELS linux linux_only) add_oscap_test("test_probes_systemdunitdependency_offline_mode.sh" LABELS linux linux_only) + set_tests_properties( + "probes/systemdunitdependency/test_probes_systemdunitdependency.sh" + "probes/systemdunitdependency/test_probes_systemdunitdependency_validation.sh" + "probes/systemdunitdependency/test_probes_systemdunitdependency_offline_mode.sh" + PROPERTIES RESOURCE_LOCK "systemd:1" + ) endif() endif() diff --git a/tests/probes/systemdunitproperty/CMakeLists.txt b/tests/probes/systemdunitproperty/CMakeLists.txt index daa5e95eeb..87c935eae4 100644 --- a/tests/probes/systemdunitproperty/CMakeLists.txt +++ b/tests/probes/systemdunitproperty/CMakeLists.txt @@ -3,5 +3,11 @@ if(ENABLE_PROBES_LINUX) add_oscap_test("test_probes_systemdunitproperty.sh" LABELS linux linux_only) add_oscap_test("test_probes_systemdunitproperty_mount_wants.sh" LABELS linux linux_only) add_oscap_test("test_probes_systemdunitproperty_offline_mode.sh" LABELS linux linux_only) + set_tests_properties( + "probes/systemdunitproperty/test_probes_systemdunitproperty.sh" + "probes/systemdunitproperty/test_probes_systemdunitproperty_mount_wants.sh" + "probes/systemdunitproperty/test_probes_systemdunitproperty_offline_mode.sh" + PROPERTIES RESOURCE_LOCK "systemd:1" + ) endif() endif() From c62fae1db4bfe473290ee862095cb74f8feb9b14 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Mon, 5 Jan 2026 15:50:58 -0600 Subject: [PATCH 09/15] Fix rpm verify tests so they can run in parallel --- tests/probes/rpm/rpminfo/CMakeLists.txt | 2 +- tests/probes/rpm/rpmverify/CMakeLists.txt | 6 ++++++ tests/probes/rpm/rpmverifyfile/CMakeLists.txt | 7 +++++++ tests/probes/rpm/rpmverifypackage/CMakeLists.txt | 6 ++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/probes/rpm/rpminfo/CMakeLists.txt b/tests/probes/rpm/rpminfo/CMakeLists.txt index 371eacd74f..3c7b9c4775 100644 --- a/tests/probes/rpm/rpminfo/CMakeLists.txt +++ b/tests/probes/rpm/rpminfo/CMakeLists.txt @@ -5,6 +5,6 @@ if(ENABLE_PROBES_LINUX) set_tests_properties( "probes/rpm/rpminfo/test_probes_rpminfo_offline.sh" "probes/rpm/rpminfo/test_probes_rpminfo.sh" - PROPERTIES RESOURCE_LOCK rpminfo + PROPERTIES RESOURCE_LOCK rpm_shared ) endif() diff --git a/tests/probes/rpm/rpmverify/CMakeLists.txt b/tests/probes/rpm/rpmverify/CMakeLists.txt index c8dc0abbb3..c58c4bd160 100644 --- a/tests/probes/rpm/rpmverify/CMakeLists.txt +++ b/tests/probes/rpm/rpmverify/CMakeLists.txt @@ -1,4 +1,10 @@ if(ENABLE_PROBES_LINUX) add_oscap_test("test_probes_rpmverify_not_equals_operation.sh" LABELS linux linux_only) add_oscap_test("test_probes_rpmverify_not_equals_operation_offline.sh" LABELS linux linux_only) + + set_tests_properties( + "probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation_offline.sh" + "probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation.sh" + PROPERTIES RESOURCE_LOCK rpm_shared + ) endif() diff --git a/tests/probes/rpm/rpmverifyfile/CMakeLists.txt b/tests/probes/rpm/rpmverifyfile/CMakeLists.txt index 18380cd9b4..b0f62796b7 100644 --- a/tests/probes/rpm/rpmverifyfile/CMakeLists.txt +++ b/tests/probes/rpm/rpmverifyfile/CMakeLists.txt @@ -2,4 +2,11 @@ if(ENABLE_PROBES_LINUX) add_oscap_test("test_probes_rpmverifyfile.sh" LABELS linux linux_only) add_oscap_test("test_probes_rpmverifyfile_older.sh" LABELS linux linux_only) add_oscap_test("test_probes_rpmverifyfile_offline.sh" LABELS linux linux_only) + + set_tests_properties( + "probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_offline.sh" + "probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_older.sh" + "probes/rpm/rpmverifyfile/test_probes_rpmverifyfile.sh" + PROPERTIES RESOURCE_LOCK rpm_shared + ) endif() diff --git a/tests/probes/rpm/rpmverifypackage/CMakeLists.txt b/tests/probes/rpm/rpmverifypackage/CMakeLists.txt index 47673f2499..b8c40a2378 100644 --- a/tests/probes/rpm/rpmverifypackage/CMakeLists.txt +++ b/tests/probes/rpm/rpmverifypackage/CMakeLists.txt @@ -1,4 +1,10 @@ if(ENABLE_PROBES_LINUX) add_oscap_test("test_probes_rpmverifypackage.sh" LABELS linux linux_only) add_oscap_test("test_probes_rpmverifypackage_offline.sh" LABELS linux linux_only) + + set_tests_properties( + "probes/rpm/rpmverifypackage/test_probes_rpmverifypackage_offline.sh" + "probes/rpm/rpmverifypackage/test_probes_rpmverifypackage.sh" + PROPERTIES RESOURCE_LOCK rpm_shared + ) endif() From b090d90f23b4be061906f0df3392f657c66241b1 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 31 Jul 2026 10:32:56 -0500 Subject: [PATCH 10/15] Fix tabs vs space for #2296 --- tests/API/XCCDF/unittests/CMakeLists.txt | 26 +++++++++---------- tests/probes/rpm/rpminfo/CMakeLists.txt | 10 +++---- tests/probes/rpm/rpmverify/CMakeLists.txt | 10 +++---- tests/probes/rpm/rpmverifyfile/CMakeLists.txt | 12 ++++----- .../rpm/rpmverifypackage/CMakeLists.txt | 10 +++---- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/tests/API/XCCDF/unittests/CMakeLists.txt b/tests/API/XCCDF/unittests/CMakeLists.txt index 088cb861a0..22a5011445 100644 --- a/tests/API/XCCDF/unittests/CMakeLists.txt +++ b/tests/API/XCCDF/unittests/CMakeLists.txt @@ -122,19 +122,19 @@ add_oscap_test("test_remediation_bootc.sh") add_oscap_test("openscap_2289_regression.sh") add_oscap_test("test_null_ptr_regression.sh") - set_tests_properties( - "API/XCCDF/unittests/test_deriving_xccdf_result_from_oval2.sh" - "API/XCCDF/unittests/test_deriving_xccdf_result_from_oval_multicheck.sh" - "API/XCCDF/unittests/test_deriving_xccdf_result_from_oval.sh" - "API/XCCDF/unittests/test_fix_arf.sh" - "API/XCCDF/unittests/test_multiple_oval_files_with_same_basename.sh" - "API/XCCDF/unittests/test_xccdf_check_multi_check2.sh" - "API/XCCDF/unittests/test_xccdf_check_processing_complex_priority.sh" - "API/XCCDF/unittests/test_xccdf_check_processing_selector_bad.sh" - "API/XCCDF/unittests/test_xccdf_selectors_cluster2.sh" - "API/XCCDF/unittests/test_xccdf_selectors_cluster3.sh" - PROPERTIES RESOURCE_LOCK not_executable_file -) +set_tests_properties( + "API/XCCDF/unittests/test_deriving_xccdf_result_from_oval2.sh" + "API/XCCDF/unittests/test_deriving_xccdf_result_from_oval_multicheck.sh" + "API/XCCDF/unittests/test_deriving_xccdf_result_from_oval.sh" + "API/XCCDF/unittests/test_fix_arf.sh" + "API/XCCDF/unittests/test_multiple_oval_files_with_same_basename.sh" + "API/XCCDF/unittests/test_xccdf_check_multi_check2.sh" + "API/XCCDF/unittests/test_xccdf_check_processing_complex_priority.sh" + "API/XCCDF/unittests/test_xccdf_check_processing_selector_bad.sh" + "API/XCCDF/unittests/test_xccdf_selectors_cluster2.sh" + "API/XCCDF/unittests/test_xccdf_selectors_cluster3.sh" + PROPERTIES RESOURCE_LOCK not_executable_file + ) set_tests_properties( "API/XCCDF/unittests/test_fix_instance.sh" diff --git a/tests/probes/rpm/rpminfo/CMakeLists.txt b/tests/probes/rpm/rpminfo/CMakeLists.txt index 3c7b9c4775..a4f3c17ff5 100644 --- a/tests/probes/rpm/rpminfo/CMakeLists.txt +++ b/tests/probes/rpm/rpminfo/CMakeLists.txt @@ -2,9 +2,9 @@ if(ENABLE_PROBES_LINUX) add_oscap_test("test_probes_rpminfo.sh" LABELS linux linux_only) add_oscap_test("test_probes_rpminfo_offline.sh" LABELS linux linux_only) - set_tests_properties( - "probes/rpm/rpminfo/test_probes_rpminfo_offline.sh" - "probes/rpm/rpminfo/test_probes_rpminfo.sh" - PROPERTIES RESOURCE_LOCK rpm_shared - ) + set_tests_properties( + "probes/rpm/rpminfo/test_probes_rpminfo_offline.sh" + "probes/rpm/rpminfo/test_probes_rpminfo.sh" + PROPERTIES RESOURCE_LOCK rpm_shared + ) endif() diff --git a/tests/probes/rpm/rpmverify/CMakeLists.txt b/tests/probes/rpm/rpmverify/CMakeLists.txt index c58c4bd160..c5770c3b9e 100644 --- a/tests/probes/rpm/rpmverify/CMakeLists.txt +++ b/tests/probes/rpm/rpmverify/CMakeLists.txt @@ -2,9 +2,9 @@ if(ENABLE_PROBES_LINUX) add_oscap_test("test_probes_rpmverify_not_equals_operation.sh" LABELS linux linux_only) add_oscap_test("test_probes_rpmverify_not_equals_operation_offline.sh" LABELS linux linux_only) - set_tests_properties( - "probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation_offline.sh" - "probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation.sh" - PROPERTIES RESOURCE_LOCK rpm_shared - ) + set_tests_properties( + "probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation_offline.sh" + "probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation.sh" + PROPERTIES RESOURCE_LOCK rpm_shared + ) endif() diff --git a/tests/probes/rpm/rpmverifyfile/CMakeLists.txt b/tests/probes/rpm/rpmverifyfile/CMakeLists.txt index b0f62796b7..82a45a4a2a 100644 --- a/tests/probes/rpm/rpmverifyfile/CMakeLists.txt +++ b/tests/probes/rpm/rpmverifyfile/CMakeLists.txt @@ -3,10 +3,10 @@ if(ENABLE_PROBES_LINUX) add_oscap_test("test_probes_rpmverifyfile_older.sh" LABELS linux linux_only) add_oscap_test("test_probes_rpmverifyfile_offline.sh" LABELS linux linux_only) - set_tests_properties( - "probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_offline.sh" - "probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_older.sh" - "probes/rpm/rpmverifyfile/test_probes_rpmverifyfile.sh" - PROPERTIES RESOURCE_LOCK rpm_shared - ) + set_tests_properties( + "probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_offline.sh" + "probes/rpm/rpmverifyfile/test_probes_rpmverifyfile_older.sh" + "probes/rpm/rpmverifyfile/test_probes_rpmverifyfile.sh" + PROPERTIES RESOURCE_LOCK rpm_shared + ) endif() diff --git a/tests/probes/rpm/rpmverifypackage/CMakeLists.txt b/tests/probes/rpm/rpmverifypackage/CMakeLists.txt index b8c40a2378..bf2a176e47 100644 --- a/tests/probes/rpm/rpmverifypackage/CMakeLists.txt +++ b/tests/probes/rpm/rpmverifypackage/CMakeLists.txt @@ -2,9 +2,9 @@ if(ENABLE_PROBES_LINUX) add_oscap_test("test_probes_rpmverifypackage.sh" LABELS linux linux_only) add_oscap_test("test_probes_rpmverifypackage_offline.sh" LABELS linux linux_only) - set_tests_properties( - "probes/rpm/rpmverifypackage/test_probes_rpmverifypackage_offline.sh" - "probes/rpm/rpmverifypackage/test_probes_rpmverifypackage.sh" - PROPERTIES RESOURCE_LOCK rpm_shared - ) + set_tests_properties( + "probes/rpm/rpmverifypackage/test_probes_rpmverifypackage_offline.sh" + "probes/rpm/rpmverifypackage/test_probes_rpmverifypackage.sh" + PROPERTIES RESOURCE_LOCK rpm_shared + ) endif() From cd35a99b26721c5849e89a50e99272ea94b90488 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 31 Jul 2026 12:49:40 -0500 Subject: [PATCH 11/15] Fix overzealous grep in test_remediation_blueprint If you had "OpenSCAP" in your path to the OpenSCAP repo it would cause issues --- tests/API/XCCDF/unittests/test_remediation_blueprint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/API/XCCDF/unittests/test_remediation_blueprint.sh b/tests/API/XCCDF/unittests/test_remediation_blueprint.sh index c1f141e0c0..6abce9913e 100755 --- a/tests/API/XCCDF/unittests/test_remediation_blueprint.sh +++ b/tests/API/XCCDF/unittests/test_remediation_blueprint.sh @@ -23,7 +23,7 @@ echo "Result file = $result" # The expected file was generated without ' # This file was generated by OpenSCAP 1.3.5 using:' line # to make the test independent from the scanner version. We have to filter this line from the output as well. -$OSCAP xccdf generate fix --fix-type blueprint --profile 'common' "$input_xml" | grep -v "OpenSCAP " > "$result" +$OSCAP xccdf generate fix --fix-type blueprint --profile 'common' "$input_xml" | grep -v "This file was generated by OpenSCAP" | grep -v "This Blueprint is generated from an OpenSCAP profile without preliminary evaluation" > "$result" diff "$expected_result" "$result" From afb8ee5da69055298f154db1b3bfecf1761aac43 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 31 Jul 2026 12:50:35 -0500 Subject: [PATCH 12/15] Fix logging.yml resource conflict --- tests/probes/yamlfilecontent/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/probes/yamlfilecontent/CMakeLists.txt b/tests/probes/yamlfilecontent/CMakeLists.txt index f0ccc9fe6b..6de5fbe669 100644 --- a/tests/probes/yamlfilecontent/CMakeLists.txt +++ b/tests/probes/yamlfilecontent/CMakeLists.txt @@ -4,5 +4,10 @@ if(ENABLE_PROBES_INDEPENDENT) add_oscap_test("test_probes_yamlfilecontent_offline_mode.sh" LABELS independent) add_oscap_test("test_probes_yamlfilecontent_types.sh" LABELS independent) add_oscap_test("test_probes_yamlfilecontent_content.sh" LABELS independent) -endif() + set_tests_properties( + "probes/yamlfilecontent/test_probes_yamlfilecontent_array.sh" + "probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.sh" + PROPERTIES RESOURCE_LOCK tmp_openshift_logging_yaml + ) +endif() From e998272de628c8a62e5646641b97191e22b0e52d Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 31 Jul 2026 12:51:10 -0500 Subject: [PATCH 13/15] Make error.log a tmpfile in test_xccdf_results_arf_asset.sh --- tests/API/XCCDF/unittests/test_xccdf_results_arf_asset.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/API/XCCDF/unittests/test_xccdf_results_arf_asset.sh b/tests/API/XCCDF/unittests/test_xccdf_results_arf_asset.sh index 1fd25e44f4..bed22707a2 100755 --- a/tests/API/XCCDF/unittests/test_xccdf_results_arf_asset.sh +++ b/tests/API/XCCDF/unittests/test_xccdf_results_arf_asset.sh @@ -8,7 +8,7 @@ set -o pipefail function test_xccdf_results_arf_asset { local DS="${srcdir}/test_xccdf_results_arf_no_oval.xccdf.xml" local result="$(mktemp results.XXXXXXX.xml)" - local stderr="error.log" + local stderr="$(mktemp error.XXXXXXX.log)" [ -f $result ] && rm -f $result From 3ee661a3cec043c10a5b2564876046b8f736a6b3 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 31 Jul 2026 12:51:34 -0500 Subject: [PATCH 14/15] Fixup test_probes_fwupdsecattr_mock to use tmpfiles --- tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.sh b/tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.sh index a4a1a0541a..30ef6abdd5 100755 --- a/tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.sh +++ b/tests/probes/fwupdsecattr/test_probes_fwupdsecattr_mock.sh @@ -10,9 +10,9 @@ function test_probes_fwupdsecattr { local ret_val=0 local DF="${srcdir}/test_probes_fwupdsecattr_mock.xml" - local RF="$(mktemp results.XXXXXXX.xml)" + local RF="$(make_temp_file /tmp results.xml)" local DBUS_MOCK_NAME="org.freedesktop.fwupd" - local stderr=$(mktemp test_probes_fwupdsecattr_mock.err.XXXXXX) + local stderr=$(make_temp_file /tmp test_probes_fwupdsecattr_mock.err) echo "stderr file: $stderr" [ -f $RF ] && rm -f $RF From d2ad00ca4bf0be4ec4878052feb72b0811259080 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 31 Jul 2026 13:08:23 -0500 Subject: [PATCH 15/15] Fix d-bus flake --- tests/test_common.sh.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_common.sh.in b/tests/test_common.sh.in index 3572d03d1e..54a195db61 100755 --- a/tests/test_common.sh.in +++ b/tests/test_common.sh.in @@ -400,6 +400,13 @@ init_dbus_mock() { # We have to replace system bus address because mock D-Bus # endpoint is created inside the user session export DBUS_SYSTEM_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS + # Wait for the mock to register on the bus before proceeding + local _i + for _i in $(seq 1 50); do + gdbus introspect --session -d "$1" -o / >/dev/null 2>&1 && return 0 + sleep 0.1 + done + printf "%s\n" "WARNING: D-Bus mock $1 did not appear after 5 seconds" } # Args: