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

feat: CPLYTM-485 add control implmentations #431

Merged
merged 4 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
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
21 changes: 19 additions & 2 deletions tests/trestlebot/cli/test_sync_cac_content_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,38 @@ def test_sync_product(tmp_repo: Tuple[str, Repo]) -> None:
assert len(compdef.components) == 1
component = compdef.components[0]
assert component.title == "rhel8"
# Check rules component props
# Check rules component props are added
assert len(component.props) == 24
rule_ids = [p.value for p in component.props if p.name == "Rule_Id"]
assert sorted(rule_ids) == [
"configure_crypto_policy",
"file_groupownership_sshd_private_key",
"sshd_set_keepalive",
]
# Check parameters props
# Check parameters props are added
param_ids = [p.value for p in component.props if p.name == "Parameter_Id"]
assert sorted(list(set(param_ids))) == [
"var_sshd_set_keepalive",
"var_system_crypto_policy",
]

# Check control_implementations are attached
ci = component.control_implementations[0]
assert ci.source == "trestle://profiles/simplified_nist_profile/profile.json"
set_parameters = ci.set_parameters
assert len(set_parameters) == 2
set_params_ids = []
set_params_dict = {}
for param in set_parameters:
set_params_ids.append(param.param_id)
set_params_dict.update({param.param_id: param.values})
assert sorted(set_params_ids) == [
"var_sshd_set_keepalive",
"var_system_crypto_policy",
]
assert set_params_dict["var_sshd_set_keepalive"] == ["1"]
assert set_params_dict["var_system_crypto_policy"] == ["fips"]


def test_sync_product_create_validation_component(tmp_repo: Tuple[str, Repo]) -> None:
"""Tests sync Cac content to create validation component."""
Expand Down
Loading
Loading