Skip to content

Commit

Permalink
Update to latest 1.6-dev schema and add mlbom, cbom tests (#77)
Browse files Browse the repository at this point in the history
* Update to latest 1.6-dev schema and add mlbom, cbom tests

Signed-off-by: Matt Rutkowski <[email protected]>

* Add new test cases for ML and CBOMs using the latest v1.6-dev schema

Signed-off-by: Matt Rutkowski <[email protected]>

---------

Signed-off-by: Matt Rutkowski <[email protected]>
  • Loading branch information
mrutkows authored Mar 27, 2024
1 parent 7303f86 commit 14e9314
Show file tree
Hide file tree
Showing 5 changed files with 592 additions and 81 deletions.
29 changes: 29 additions & 0 deletions acdx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": 1,
"bomFormat": "CycloneDX",
"specVersion": "1.4",
"components": [
{
"name": "@ace/otc-components-react-3.0.11.tgz",
"version": "3.0.11",
"licenses": [
{
"license": {
"id": "Requires Review"
}
}
]
},
{
"name": "@ace/otc-components-react-3.0.14.tgz",
"version": "3.0.14",
"licenses": [
{
"license": {
"id": "Requires Review"
}
}
]
}
]
}
19 changes: 19 additions & 0 deletions cmd/validate_cdx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ const (
TEST_CDX_1_6_MIN_REQUIRED = "test/cyclonedx/1.6/cdx-1-6-min-required.json"
)

// Tests for BOM subtypes
const (
TEST_CDX_1_6_MACHINE_LEARNING_BOM = "test/cyclonedx/1.6/cdx-1-6-valid-mlbom-environmental-considerations.json"
TEST_CDX_1_6_CRYPTO_BOM = "test/cyclonedx/1.6/cdx-1-6-valid-cbom-full-1.6.json"
)

// Mature SBOMs used to test various schemas and queries
const (
TEST_CDX_1_3_MATURITY_EXAMPLE_1_BASE = "test/cyclonedx/cdx-1-3-mature-example-1.json"
Expand Down Expand Up @@ -84,6 +90,19 @@ func TestValidateCdx15Mature(t *testing.T) {
innerTestValidate(t, *vti)
}

// Test BOM variants (e.g., MLBOM, CBOM, etc.)
func TestValidateCdx16MachineLearningBOM(t *testing.T) {
vti := NewValidateTestInfoMinimum(TEST_CDX_1_6_MACHINE_LEARNING_BOM)
vti.SchemaVariant = SCHEMA_VARIANT_DEVELOPMENT
innerTestValidate(t, *vti)
}

func TestValidateCdx16CryptographicBOM(t *testing.T) {
vti := NewValidateTestInfoMinimum(TEST_CDX_1_6_CRYPTO_BOM)
vti.SchemaVariant = SCHEMA_VARIANT_DEVELOPMENT
innerTestValidate(t, *vti)
}

// -----------------------------------------------------------
// CycloneDX - (invalid) schema tests
// -----------------------------------------------------------
Expand Down
Loading

0 comments on commit 14e9314

Please sign in to comment.