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

Profile resolver selection: XSpec additions and minor XSLT enhancements #1101

Merged
merged 9 commits into from
Feb 4, 2022

Conversation

galtm
Copy link
Contributor

@galtm galtm commented Jan 21, 2022

Committer Notes

The goal of this PR is to add more template-level and function-level XSpec tests for code in src/utils/util/resolver-pipeline/oscal-profile-resolve-select.xsl.

While working on that, I also made minor changes in that XSLT file:

I also included preliminary tests for behavior described in the "Mapping Controls" section of the spec. Some of them are marked "pending" because the feature is not implemented yet.

As this is my first PR in this repo but hopefully not my last, I am open to feedback on coding/testing style preferences or other conventions on your team. I can give a verbal walk-through of the code if that would make the review easier.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you squashed any non-relevant commits and commit messages? [instructions]
  • Do all automated CI/CD checks pass?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you included examples of how to use your new feature(s)?
  • Have you updated all OSCAL website and readme documentation affected by the changes you made? Changes to the OSCAL website can be made in the docs/content directory of your branch.

@wendellpiez
Copy link
Contributor

Awesome work thanks @galtm!

(Noting plan to un-draft this as soon as other pending work is merged into develop. Feel free to make more commits until this happens.)

Group the scenarios that test o:glob-as-regex.
Add scenario for edge case where input is empty.
Add XSpec tests for oscal-profile-resolve-select.xsl,
mostly at the level of templates and functions.

Minor enhancements in oscal-profile-resolve-select.xsl:
- Add support for with-parent-controls
- Generate fatal error if resource cannot be fetched
- Provide focused error message if resource has no suitable rlink
- Handle missing matching pattern
@galtm
Copy link
Contributor Author

galtm commented Feb 2, 2022

Noting plan to un-draft this as soon as other pending work is merged into develop.

@wendellpiez , I updated one scenario to adapt to the latest changes in develop and reduced some redundancy in expected content. Reran the XSpec tests in this PR in Oxygen v24, and they still pass. Changing status to Ready for review.

@galtm galtm marked this pull request as ready for review February 2, 2022 01:53
The abc-full_catalog.xml file has changed, so the "Loose parameters"
test scenario needs adjustment.
metadata is copied verbatim, so no need to check details
in multiple test scenarios for the match=profile template
Copy link
Contributor

@david-waltermire david-waltermire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Thanks for all the help!

@david-waltermire david-waltermire merged commit 40301dc into usnistgov:develop Feb 4, 2022
@galtm galtm mentioned this pull request Feb 13, 2022
4 tasks
david-waltermire pushed a commit that referenced this pull request Feb 26, 2022
…ts (#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
@galtm galtm deleted the wip-profiler-tests-1a branch April 17, 2022 15:53
@david-waltermire david-waltermire added this to the OSCAL 1.1.0 milestone May 4, 2022
david-waltermire pushed a commit that referenced this pull request May 17, 2022
…ts (#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
david-waltermire pushed a commit that referenced this pull request Jun 21, 2022
…ts (#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
david-waltermire pushed a commit that referenced this pull request Jul 13, 2022
…ts (#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
david-waltermire pushed a commit that referenced this pull request Aug 23, 2022
…ts (#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
aj-stein-nist pushed a commit to aj-stein-nist/OSCAL-forked that referenced this pull request Oct 6, 2022
…ts (usnistgov#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
aj-stein-nist pushed a commit that referenced this pull request Oct 18, 2022
…ts (#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
david-waltermire pushed a commit that referenced this pull request Oct 31, 2022
…ts (#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
aj-stein-nist pushed a commit to aj-stein-nist/OSCAL-forked that referenced this pull request Jan 10, 2023
…ts (usnistgov#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
aj-stein-nist pushed a commit to aj-stein-nist/OSCAL-forked that referenced this pull request Feb 6, 2023
…ts (usnistgov#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
aj-stein-nist pushed a commit to aj-stein-nist/OSCAL-forked that referenced this pull request Jun 29, 2023
…ts (usnistgov#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
aj-stein-nist pushed a commit to aj-stein-nist/OSCAL-forked that referenced this pull request Jul 10, 2023
…ts (usnistgov#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
aj-stein-nist pushed a commit to galtm/OSCAL that referenced this pull request Sep 28, 2023
…ts (usnistgov#1101)

* Group scenarios and add edge case scenario
* Group the scenarios that test o:glob-as-regex.
* Add scenario for edge case where input is empty.
* For selection, augment XSpec and update XSLT
* Add XSpec tests for oscal-profile-resolve-select.xsl, mostly at the level of templates and functions.
* Minor enhancements in oscal-profile-resolve-select.xsl:
* Add support for with-parent-controls
* Generate fatal error if resource cannot be fetched
* Provide focused error message if resource has no suitable rlink
* Handle missing matching pattern
* Fix indentation
* Fix scenario that intentionally omits pattern
* Rename o:resource-or-warning as o:resource-or-error
* Attributes, not elements, for "from" and "to"
* Update expected value for 4a3cadf changes in catalog
* The abc-full_catalog.xml file has changed, so the "Loose parameters" test scenario needs adjustment.
* Reduce redundancy in expected metadata
* metadata is copied verbatim, so no need to check details in multiple test scenarios for the match=profile template
* Update verbiage to cross-reference with logged discussion pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants