-
Notifications
You must be signed in to change notification settings - Fork 717
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
Add xccdf status to profiles #13045
base: master
Are you sure you want to change the base?
Add xccdf status to profiles #13045
Conversation
@@ -118,6 +119,8 @@ def to_xml_element(self): | |||
|
|||
element = ET.Element('{%s}Profile' % XCCDF12_NS) | |||
element.set("id", OSCAP_PROFILE + self.id_) | |||
if self.status: | |||
add_sub_element(element, "status", XCCDF12_NS, str(self.status)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest testing this feature by a unit test.
You can extend or reuse this test:
def test_profile_to_xml_element(profile_ospp): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests addded, thank you for the review.
This allows us to identify a profile as deprecated, can also be used in other elements, as xccdf:Rule andxccdf:Value. More info in XCCDF standard item 6.2.8.
Test that it loads and dumps the status correctly. Test that invalid statuses raise exception during build.
They are newwer versions available.
47c7a53
to
2696c29
Compare
Code Climate has analyzed commit 2696c29 and detected 2 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 62.0% (0.1% change). View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have built the ocp4 product and I have checked in the built data stream that the cis-1-4
and cis-node-1-4
profiles contain <xccdf-1.2:status>
element with deprecated
.
Description:
xccdf:status: element to
xccdf:Profile`.Rationale:
Review Hints: