Skip to content

Commit

Permalink
For GSA#833 add multiple negative tests, not just one
Browse files Browse the repository at this point in the history
Add three different scenarios for failing tests to improve coverage for
the different error states.
  • Loading branch information
aj-stein-gsa committed Nov 19, 2024
1 parent 2325a62 commit 8cee0e6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://csrc.nist.gov/ns/oscal/1.0 https://github.com/usnistgov/OSCAL/releases/download/v1.1.2/oscal_ssp_schema.xsd"
uuid="12345678-1234-4321-8765-123456789012">
<metadata>
<oscal-version>1.0.4</oscal-version>
<prop name="fedramp-version" ns="https://fedramp.gov/ns/oscal" value="3.0.0-rc1"/>
</metadata>
</system-security-plan>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://csrc.nist.gov/ns/oscal/1.0 https://github.com/usnistgov/OSCAL/releases/download/v1.1.2/oscal_ssp_schema.xsd"
uuid="12345678-1234-4321-8765-123456789012">
<metadata>
<oscal-version>1.0.4</oscal-version>
<!-- prop[@name="fedramp-version"] is missing, so we have to test falling through to default version-->
</metadata>
</system-security-plan>
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
test-case:
name: Negative Test for oscal-version-matches-fedramp-version
name: Positive Test for import-profile-has-available-document
description: >-
This test case validates the behavior of constraint
oscal-version-matches-fedramp-version
content: ../content/ssp-oscal-version-matches-fedramp-version-INVALID.xml
This test case validates the behavior of constraint import-profile-has-available-document.
Scenario 1 tests: an invalid match below the minimum required version threshold.
Scenario 2 tests: an invalid match above the implied maximum required version threshold, a major version greater than required.
Scenario 3 tests: an invalid match because the fedramp-version prop is missing, so a fallthrough default is required.
content:
- ../content/ssp-oscal-version-matches-fedramp-version-INVALID-1.xml
- ../content/ssp-oscal-version-matches-fedramp-version-INVALID-2.xml
- ../content/ssp-oscal-version-matches-fedramp-version-INVALID-3.xml
expectations:
- constraint-id: oscal-version-matches-fedramp-version
result: fail

0 comments on commit 8cee0e6

Please sign in to comment.