From cc93d9fd72c1ed16d9952b5d61734f4788ac2516 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Thu, 18 Dec 2025 13:06:19 -0600 Subject: [PATCH 01/10] 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 775d561f7ea1fb6ae83c5ab347880982587f8c93 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 11:15:35 -0600 Subject: [PATCH 02/10] 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 d081b32b27..45c8430ec2 100644 --- a/tests/API/OVAL/unittests/CMakeLists.txt +++ b/tests/API/OVAL/unittests/CMakeLists.txt @@ -36,3 +36,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 674e2b29b1..0b6b283757 100644 --- a/tests/API/XCCDF/unittests/CMakeLists.txt +++ b/tests/API/XCCDF/unittests/CMakeLists.txt @@ -115,3 +115,41 @@ add_oscap_test("test_single_line_tailoring.sh") add_oscap_test("test_reference.sh") add_oscap_test("test_remediation_bootc.sh") add_oscap_test("openscap_2289_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 691e2f04ee6859bb6f2ab35c00e0ad048e92edef Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 12:30:18 -0600 Subject: [PATCH 03/10] 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 3595a4580d..49af1dc01d 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 0e4743448e..047c62f812 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 d9113b9f1d12a4afa24f350719f1f8913d92097d Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 12:30:34 -0600 Subject: [PATCH 04/10] Fix file name in tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh --- tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh index ad44885752..5694ec2741 100755 --- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh +++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh @@ -14,7 +14,7 @@ function test_probes_yamlfilecontent_key { cp "${srcdir}/openshift-logging.yaml" /tmp - local YAML_FILE="/tmp/openshift-logging.yaml" + local YAML_FILE="/tmp/openshift-logging_key.yaml" $OSCAP oval eval --results $RF $DF From ab4af3b60ee79ea3abbda1f18c0e043e0b8e8e49 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 12:35:10 -0600 Subject: [PATCH 05/10] 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 cbb1194f36..fce79ffb70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,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) @@ -70,7 +70,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) @@ -93,7 +93,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 8d7543a01b96c177a8a7b219b160d943f31d40eb Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 12:38:08 -0600 Subject: [PATCH 06/10] Update docs for -j on ctest --- docs/developer/developer.adoc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/developer/developer.adoc b/docs/developer/developer.adoc index 8bb4f86d63..d8a7dd05eb 100644 --- a/docs/developer/developer.adoc +++ b/docs/developer/developer.adoc @@ -168,10 +168,6 @@ Now you can execute the following command to run library self-checks: $ ctest ---- -Note that using the `--jobs/-j` flag is currently not supported. -It will cause unexpected test failures. -See link:https://github.com/OpenSCAP/openscap/issues/2057[#2057] for more details. - It's also possible to use `ctest` to test any other oscap binary present in the system. You just have to set the path of the binary to the CUSTOM_OSCAP variable: ---- From 8b4754cb89c8ef52f9a80e439f4bd9008a5a6656 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 14:36:21 -0600 Subject: [PATCH 07/10] 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 9f1b7a4c10..3de0d07053 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") add_oscap_test("test_probes_rpminfo_offline.sh") + + set_tests_properties( + "probes/rpm/rpminfo/test_probes_rpminfo_offline.sh" + "probes/rpm/rpminfo/test_probes_rpminfo.sh" + PROPERTIES RESOURCE_LOCK rpminfo + ) endif() From ad669c4fdd0c957c3977cdfa5302bc700149ec4d Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Fri, 19 Dec 2025 15:01:51 -0600 Subject: [PATCH 08/10] 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 1b78a7c435eb2256b2cfa56a8aa061225c86f44e Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Mon, 5 Jan 2026 15:30:56 -0600 Subject: [PATCH 09/10] 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 c60a47e88f..f387ef678b 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") add_oscap_test("test_probes_systemdunitdependency_validation.sh") add_oscap_test("test_probes_systemdunitdependency_offline_mode.sh") + 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 521d6ece66..dcb0eeac34 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") add_oscap_test("test_probes_systemdunitproperty_mount_wants.sh") add_oscap_test("test_probes_systemdunitproperty_offline_mode.sh") + 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 45d5a9f17e2ee9c462bbafbaea7d5fb4980036e0 Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Mon, 5 Jan 2026 15:50:58 -0600 Subject: [PATCH 10/10] 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 3de0d07053..c83a368791 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 e7289d2c82..e6ffa56d20 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") add_oscap_test("test_probes_rpmverify_not_equals_operation_offline.sh") + + 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 0a8f71f29c..76e581280c 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") add_oscap_test("test_probes_rpmverifyfile_older.sh") add_oscap_test("test_probes_rpmverifyfile_offline.sh") + + 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 9a4205d3bb..e8abc1aa3a 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") add_oscap_test("test_probes_rpmverifypackage_offline.sh") + + set_tests_properties( + "probes/rpm/rpmverifypackage/test_probes_rpmverifypackage_offline.sh" + "probes/rpm/rpmverifypackage/test_probes_rpmverifypackage.sh" + PROPERTIES RESOURCE_LOCK rpm_shared + ) endif()