Skip to content

Commit

Permalink
Add tests for utils/ansible_playbook_to_role.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Mab879 committed Mar 25, 2024
1 parent 0c7430d commit d822b9c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ find_python_module(openpyxl)
find_python_module(pandas)
find_python_module(pcre2)
find_python_module(cmakelint)
find_python_module(github)

# sphinx documentation requirements
find_python_module(sphinx)
Expand Down Expand Up @@ -268,6 +269,7 @@ message(STATUS "python pcre2 module (optional): ${PY_PCRE2}")
message(STATUS "python lxml module (optional): ${PY_LXML}")
message(STATUS "python prometheus-client module (optional): ${PY_PROMETHEUS_CLIENT}")
message(STATUS "python compliance-trestle module (optional): ${PY_TRESTLE}")
message(STATUS "python github (PyGitHub) module (optional): ${PY_GITHUB}")
message(STATUS " ")

message(STATUS "Build options:")
Expand Down
16 changes: 16 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,19 @@ if(PYTHON_VERSION_MAJOR GREATER 2 AND PYTHON_VERSION_MINOR GREATER 6)
set_tests_properties("utils-import_disa_stig_sanity" PROPERTIES LABELS quick)
)
endif()


if(PYTHON_VERSION_MAJOR GREATER 2 AND PY_GITHUB)
add_test(
NAME "utils-ansible-playbook-to-role-help"
COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/utils/ansible_playbook_to_role.py" "--help"
)
set_tests_properties("utils-ansible-playbook-to-role-help" PROPERTIES LABELS quick)
if(SSG_PRODUCT_RHEL9)
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/roles")
add_test(
NAME "utils-ansible-playbook-to-role-rhel9"
COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/utils/ansible_playbook_to_role.py" "--dry-run" "${CMAKE_BINARY_DIR}/roles" "--product" "rhel9" "--build-playbooks-dir" "${CMAKE_BINARY_DIR}/ansible"
)
endif()
endif()

0 comments on commit d822b9c

Please sign in to comment.