forked from GSA/fedramp-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For GSA#833 add multiple negative tests, not just one
Add three different scenarios for failing tests to improve coverage for the different error states.
- Loading branch information
1 parent
2325a62
commit 8cee0e6
Showing
4 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/validations/constraints/content/ssp-oscal-version-matches-fedramp-version-INVALID-1.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
src/validations/constraints/content/ssp-oscal-version-matches-fedramp-version-INVALID-3.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
13 changes: 9 additions & 4 deletions
13
src/validations/constraints/unit-tests/oscal-version-matches-fedramp-version-FAIL.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |