-
Notifications
You must be signed in to change notification settings - Fork 61
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: allow use of OpenSCAP result files in task xccdf_result_to_oscal_ar #1411
Conversation
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.
Thanks for this submission!
- Are other namespaces possible? If so should there be a list used until the right one is found?
- Alternatively, should the
trestle task xccdf-result-to-oscal-ar
be enhanced to accept an optional config flag, perhapsnamespace = http://checklists.nist.gov/xccdf/1.2
? - Can you add a test case to
tests/trestle/tasks/xccdf_result_to_oscal_ar_test.py
?
There might be one more, I can add that to the task logic.
I think searching for the correct namespace might be best option.
Done. The test files are rather large, I welcome suggestions on this. |
With respect to the code: is With respect to the test cases, please consider: it would seem that only 1 new test case and 1 corresponding data file are needed to cover the new code, and the test data file should be reduced (hacked, if you will) to the bare minimum amount needed to perform the new ns test. Thx! |
Do you wish to continue with this PR? Another release of trestle is imminent, then the direction will be toward upgrading to the current version of OSCAL. Also, the value for |
This is something that I'm still interested in working on. The |
But it is bad practice to hardocde values in code that are not typically universal, no? |
So the |
Please try running:
|
We are close to making a release in the next few days. If you can run the make commands above and deliver the revised formatted code, I can approve, then you can merge. Otherwise there will be a freeze on new features until after upgrading to new version of OSCAL 1.1.2. Thx! |
tests/trestle/tasks/xccdf_result_to_oscal_ar_test.py:449:1: D103 Missing docstring in public function |
Thanks for the output. I have struggling to get |
Here is the trick:
|
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.
LGTM.
Please:
- Update Branch (out of sync)
- Squash and Merge
…l_ar Before this commit if you wanted to use result files from OpenSCAP in the task xccdf_result_to_oscal_ar you had to extract the `TestResult` element and place it as the root of the XML document, otherwise the resulting OSCAL document would be blank. Thus making it impossible to directly use output from OpenSCAP with the task. With this commit the task will detect that the root element is not `TestResult` and then it will find the `TestResult` element in the XML document. This allows the use of files created by OpenSCAP using the `--results` and `--results-arf` switches. Signed-off-by: Matthew Burket <[email protected]>
…r_test Signed-off-by: Matthew Burket <[email protected]>
Done. Looks like I will need approval again for the CI to run. |
I think you should be able to squash and merge now...? |
I'm still seeing "Only those with write access to this repository can merge pull requests." |
Ugh. I did the squash and merge, no worries. Thanks for this contribution! |
Types of changes
develop
->main
)Quality assurance (all should be covered).
Summary
Before this commit if you wanted to use result files from OpenSCAP in the task xccdf_result_to_oscal_ar you had to extract the
TestResult
element and place it as the root of the XML document, otherwise the resulting OSCAL document would be blank. Thus making it impossible to directly use output from OpenSCAP with the task.With this commit the task will detect that the root element is not
TestResult
and then it will find theTestResult
element in the XML document. This allows the use of files created by OpenSCAP using the--results
and--results-arf
switches.Fixes #1410
Key links:
Before you merge