diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cbb1194f365..fce79ffb707 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 diff --git a/docs/developer/developer.adoc b/docs/developer/developer.adoc index 8bb4f86d63e..d8a7dd05eb3 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: ---- diff --git a/tests/API/OVAL/unittests/CMakeLists.txt b/tests/API/OVAL/unittests/CMakeLists.txt index d081b32b27b..45c8430ec29 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 705ac45c927..908fe6a7b24 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 674e2b29b1f..0b6b2837572 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 +) diff --git a/tests/API/XCCDF/unittests/test_remediation_blueprint.sh b/tests/API/XCCDF/unittests/test_remediation_blueprint.sh index 8ea9fcab83a..c1f141e0c05 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" 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 169ed7a8a4a..1fd25e44f4f 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 1c55d496b0a..491aff5f685 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 b480639d1a9..8d03e35f70f 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 3595a4580d1..49af1dc01d5 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 b6ca6c6d4bb..e4347633e1b 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 7149b52c0fb..54a3e761c05 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 2765f4dae6f..2e23c1ad6a2 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 459654546a7..0e4c61cbc38 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 90c5ff7220e..cb83283c1c5 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 98e0a884d09..ff4ec602e39 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 b824fe420be..a4a1a0541a9 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 f2b9ad6809d..16d18230289 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 2f331f08216..8dd5e64420f 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 4abc97a23c2..f950f4fd6d3 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 0e4743448ed..047c62f8121 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/CMakeLists.txt b/tests/probes/rpm/rpminfo/CMakeLists.txt index 9f1b7a4c107..c83a3687917 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 rpm_shared + ) endif() diff --git a/tests/probes/rpm/rpminfo/rpminfo_common.sh b/tests/probes/rpm/rpminfo/rpminfo_common.sh index 95afc8fde9f..95384d51819 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 @@ -50,4 +50,4 @@ function test_probes_rpminfo { rm -f $RF $DF return $ret_val -} \ No newline at end of file +} diff --git a/tests/probes/rpm/rpmverify/CMakeLists.txt b/tests/probes/rpm/rpmverify/CMakeLists.txt index e7289d2c82c..e6ffa56d201 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/rpmverify/test_probes_rpmverify_not_equals_operation.sh b/tests/probes/rpm/rpmverify/test_probes_rpmverify_not_equals_operation.sh index a46009ac176..cb105538669 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 2cb2ec54d14..8e7df8d9d3e 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/CMakeLists.txt b/tests/probes/rpm/rpmverifyfile/CMakeLists.txt index 0a8f71f29cc..76e581280c6 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/rpmverifyfile/test_probes_rpmverifyfile.sh b/tests/probes/rpm/rpmverifyfile/test_probes_rpmverifyfile.sh index e913a56c451..de345aec00c 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 25d2c33dc08..af8bce4e0a0 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 da74e46712e..0a9bbf84cf5 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/rpm/rpmverifypackage/CMakeLists.txt b/tests/probes/rpm/rpmverifypackage/CMakeLists.txt index 9a4205d3bb3..e8abc1aa3ad 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() diff --git a/tests/probes/shadow/test_probes_shadow.sh b/tests/probes/shadow/test_probes_shadow.sh index 13c4746fb44..0be229cafe9 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 23e91e1d78e..6dc3613c89b 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 e966026c387..b5141ea3704 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/systemdunitdependency/CMakeLists.txt b/tests/probes/systemdunitdependency/CMakeLists.txt index c60a47e88f8..f387ef678b0 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 521d6ece66e..dcb0eeac346 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() diff --git a/tests/probes/systemdunitproperty/test_probes_systemdunitproperty.sh b/tests/probes/systemdunitproperty/test_probes_systemdunitproperty.sh index d1e9114bb5d..826d96eb3cc 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 3e9bdce8434..9c5edc33826 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 58d0bd2c9a9..3a03fb53f8e 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 960664fb153..207a2515076 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 7d9301831f0..6b30cf51aa1 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 461dcd98eef..9c055d45dcb 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 695a247b3f3..57ec538fa21 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 f836ea3a919..271235dc306 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 a942552e9cc..5694ec27411 100755 --- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh +++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh @@ -8,13 +8,13 @@ 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 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 diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.sh index 6155b051251..280964c745c 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 e445771d039..9c9f864191f 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