Skip to content

Commit

Permalink
Move to using PYTHON_VERSION_MAJOR
Browse files Browse the repository at this point in the history
Closes #9948
  • Loading branch information
Mab879 committed Dec 12, 2022
1 parent 4300b3e commit 7f906d9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,15 @@ endif()

file(GLOB RHEL8_DISA_STIG_REF "${SSG_SHARED_REFS}/disa-stig-rhel8-v[0-9]*r[0-9]*-xccdf-manual.xml")

if (PYTHON3_EXECUTABLE)
if (PYTHON_VERSION_MAJOR GREATER 2)
add_test(
NAME "test-compare_ds"
COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/utils/compare_ds.py" "${CMAKE_SOURCE_DIR}/tests/data/utils/disa-stig-rhel8-v1r6-xccdf-manual.xml" "${RHEL8_DISA_STIG_REF}"
)
set_tests_properties("test-compare_ds" PROPERTIES LABELS quick)
endif()

if (PYTHON3_EXECUTABLE AND GIT_EXECUTABLE)
if (PYTHON_VERSION_MAJOR GREATER 2 AND GIT_EXECUTABLE)
add_test(
NAME "test-generate_contributors"
COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/utils/generate_contributors.py" "--dry-run"
Expand All @@ -198,7 +198,7 @@ set_tests_properties("test-generate_contributors" PROPERTIES LABELS quick)
endif()


if (SSG_PRODUCT_RHEL8 AND PYTHON3_EXECUTABLE)
if (PYTHON_VERSION_MAJOR GREATER 2 AND SSG_PRODUCT_RHEL8)
add_test(
NAME "test-create_scap_delta_tailoring"
COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/utils/create_scap_delta_tailoring.py" --dry-run --root "${CMAKE_SOURCE_DIR}" --json "${CMAKE_BINARY_DIR}/rule_dirs.json" --build-config-yaml "${CMAKE_BINARY_DIR}/build_config.yml" --reference "stigid" --output "${CMAKE_BINARY_DIR}/rhel8_stig_tailoring.xml" --product rhel8 --manual "${RHEL8_DISA_STIG_REF}" -B "${CMAKE_BINARY_DIR}"
Expand All @@ -216,7 +216,7 @@ set_tests_properties("test-create_scap_delta_tailoring_resolved" PROPERTIES DEPE
endif()


if (PYTHON3_EXECUTABLE AND PYTHON_VERSION_MINOR GREATER 6)
if (PYTHON_VERSION_MAJOR GREATER 2 AND PYTHON_VERSION_MINOR GREATER 6)
add_test(
NAME "test-controleval-directory"
COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/utils/controleval.py" "--controls-dir" "${CMAKE_SOURCE_DIR}/tests/unit/ssg-module/data/controls_dir" "stats" "--level" "high" "--product" "rhel9" "--id" "qrst-levels"
Expand Down Expand Up @@ -246,15 +246,15 @@ macro(ssg_refcheck_test PRODUCT PROFILE KEY)
set_tests_properties("refchecker-${PRODUCT}-${PROFILE}" PROPERTIES LABELS quick)
endmacro()

if (PYTHON3_EXECUTABLE AND SSG_PRODUCT_RHEL8)
if (PYTHON_VERSION_MAJOR GREATER 2 AND SSG_PRODUCT_RHEL8)
ssg_refcheck_test("rhel8" "cis_workstation_l1" "cis")
ssg_refcheck_test("rhel8" "cis_workstation_l2" "cis")
ssg_refcheck_test("rhel8" "cis_server_l1" "cis")
ssg_refcheck_test("rhel8" "cis" "cis")
endif()


if (PYTHON3_EXECUTABLE AND SSG_PRODUCT_RHEL7)
if (PYTHON_VERSION_MAJOR GREATER 2 AND SSG_PRODUCT_RHEL7)
ssg_refcheck_test("rhel7" "cis_workstation_l1" "cis")
ssg_refcheck_test("rhel7" "cis_workstation_l2" "cis")
ssg_refcheck_test("rhel7" "cis_server_l1" "cis")
Expand Down

0 comments on commit 7f906d9

Please sign in to comment.