Description
Several component definition test data files in tests/data/json/ contain duplicate control-implementation UUIDs within the same document, which violates the OSCAL specification requirement that all UUIDs must be unique within a document.
In each case, two different components within the same file share the same UUID for their control-implementation objects. This appears to be a copy-paste oversight when the test data was originally created.
for eg. comp_def_a.json, comp_def_b.json
Current behaviour
-
trestle import correctly rejects these files via DuplicatesValidator in duplicates_validator.py, which checks for unique UUIDs using ModelUtils.has_no_duplicate_values_by_name(model, 'uuid').
-
However, tests using test_utils.load_from_json bypass this validation entirely, so tests using these files pass despite the invalid data.
Questions for discussion
1.Should the duplicate UUIDs in the test data files simply be fixed (assign unique UUIDs to each control-implementation)?
2.Should other commands (e.g., ssp-generate, component-generate) also validate for duplicate UUIDs when loading component definitions, or is the import-time check sufficient?
@degenaro @vikas-agarwal76
Description
Several component definition test data files in tests/data/json/ contain duplicate control-implementation UUIDs within the same document, which violates the OSCAL specification requirement that all UUIDs must be unique within a document.
In each case, two different components within the same file share the same UUID for their control-implementation objects. This appears to be a copy-paste oversight when the test data was originally created.
for eg. comp_def_a.json, comp_def_b.json
Current behaviour
trestle import correctly rejects these files via DuplicatesValidator in duplicates_validator.py, which checks for unique UUIDs using ModelUtils.has_no_duplicate_values_by_name(model, 'uuid').
However, tests using test_utils.load_from_json bypass this validation entirely, so tests using these files pass despite the invalid data.
Questions for discussion
1.Should the duplicate UUIDs in the test data files simply be fixed (assign unique UUIDs to each control-implementation)?
2.Should other commands (e.g., ssp-generate, component-generate) also validate for duplicate UUIDs when loading component definitions, or is the import-time check sufficient?
@degenaro @vikas-agarwal76