Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTest Fixes #9962

Merged
merged 2 commits into from
Dec 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ if (PY_MYPY)
)
endif()

if (PY_OPENPYXL AND PY_PANDAS AND PYTHON3_EXECUTABLE)
if (PYTHON_VERSION_MAJOR GREATER 2 AND PY_OPENPYXL AND PY_PANDAS AND SRG_PRODUCT_RHEL9)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it SSG_PRODUCT_RHEL9 instead of SRG...?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thanks for finding this, it should be SSG_PRODUCT_RHEL9

@Mab879 PTAL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#9964 should fix that.

add_test(
NAME "srg-export-rhel9"
COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/utils/create_srg_export.py" --root "${CMAKE_SOURCE_DIR}" --json "${CMAKE_SOURCE_DIR}/build/rule_dirs.json" --control "${CMAKE_SOURCE_DIR}/controls/srg_gpos.yml" --product rhel9 --out-format xlsx --output "${CMAKE_BINARY_DIR}/cac_stig_output.xlsx" --build-config-yaml "${CMAKE_BINARY_DIR}/build_config.yml"
Expand All @@ -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