CMP-3834: Added cis-profile test cases 46100, 46302, 54323, 6679 from downstream#1077
CMP-3834: Added cis-profile test cases 46100, 46302, 54323, 6679 from downstream#1077taimurhafeez wants to merge 5 commits intomasterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: taimurhafeez The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Skipping CI for Draft Pull Request. |
|
🤖 To deploy this PR, run the following command: |
|
@taimurhafeez: This pull request references CMP-3834 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
🤖 To deploy this PR, run the following command: |
|
🤖 To deploy this PR, run the following command: |
…onstants to see if CI was failing cause of short timeout
# Conflicts: # tests/e2e/framework/common.go
|
🤖 To deploy this PR, run the following command: |
|
@taimurhafeez: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
rhmdnd
left a comment
There was a problem hiding this comment.
I'm wondering if we want to take this approach here, or instead rely on https://github.com/complianceascode/ocp4e2e for this level of content testing (where we're asserting specific rules pass after applying remediations). The main thing it appears we're testing here are the contents of the rule and the remediation, both of which exist in a separate repository.
Thoughts?
| // TestCISProfiles tests auto-remediation for CIS profiles | ||
| // This test covers downstream test cases: 46100, 46302, 54323, 66793 | ||
| // Test: Verify autoremediations works for CIS profiles | ||
| func TestCISProfiles(t *testing.T) { |
There was a problem hiding this comment.
I wonder if we want to take this approach in the project e2e suite when we have ocp4e2e, which does something very similar. It will provision a cluster, run a scan, apply remediations, and then assert rules states after the remediations have taken affect.
Thoughts on using that existing workflow? Also - coupling this type of content testing into the compliance-oeprator functional testing will make it so content updates in ComplianceAsCode/content can break this test (we'll be required to orchestrate changes between content and operator to unblock CI in those cases - which we experience else where when we rely on specific rules in content images that change over time).
There was a problem hiding this comment.
Thanks, @rhmdnd! I see the issue now.
So, should I move these test cases entirely to ocp4e2e?
The test case requires encryption to be enabled on the cluster first, which might take some time. The command to enable encryption is
oc patch apiserver cluster --type=merge -p '{"spec":{"encryption":{"type":"aesgcm"}}}'It will take some time. To know if the next command can be executed, in a seperate terminal we can monitor it for every 30 seconds:
watch -n 30 "oc get co kube-apiserver openshift-apiserver"And when progressing is
Falsefor bothkube-apiserverandopenshift-apiserver,then we can run the test with the following commandTo run the test
make e2e-cis-profile E2E_GO_TEST_FLAGS="-v -timeout 120m -run TestCISProfiles"output: