Skip to content

Commit

Permalink
added scvs tests
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Kumar Sahu <[email protected]>
  • Loading branch information
viveksahu26 committed Oct 1, 2024
1 parent 49d8c40 commit 3dc9184
Show file tree
Hide file tree
Showing 5 changed files with 390 additions and 12 deletions.
3 changes: 2 additions & 1 deletion pkg/sbom/cdx.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (c *CdxDoc) parseSpec() {

func (c *CdxDoc) parseSignature() {
if c.doc.Declarations == nil {
fmt.Println("Declaratic.doc.Declarationsons field is nil ")
fmt.Println("c.doc.Declarations field is nil ")
return
}

Expand Down Expand Up @@ -295,6 +295,7 @@ func copyC(cdxc *cydx.Component, c *CdxDoc) *Component {
nc.Name = cdxc.Name
nc.purpose = string(cdxc.Type)
nc.isReqFieldsPresent = c.pkgRequiredFields(cdxc)
nc.CopyRight = cdxc.Copyright

ncpe := cpe.NewCPE(cdxc.CPE)
if ncpe.Valid() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/scvs/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func scvsSBOMAutomationCreationCheck(d sbom.Document, c *scvsCheck) scvsScore {
func scvsSBOMUniqIDCheck(d sbom.Document, c *scvsCheck) scvsScore {
s := newScoreFromScvsCheck(c)

if IsSBOMHasUniqID(d, s) {
if IsSBOMHasGlobalUniqID(d, s) {
s.setL3Score(green + bold + "✓" + reset)
s.setL2Score(green + bold + "✓" + reset)
s.setL1Score(green + bold + "✓" + reset)
Expand Down Expand Up @@ -115,7 +115,7 @@ func scvsSBOMSigVerified(d sbom.Document, c *scvsCheck) scvsScore {
func scvsSBOMTimestampCheck(d sbom.Document, c *scvsCheck) scvsScore {
s := newScoreFromScvsCheck(c)

if IsSBOMTimestamped(d, s) {
if DoesSBOMHasTimestamp(d, s) {
s.setL3Score(green + bold + "✓" + reset)
s.setL2Score(green + bold + "✓" + reset)
s.setL1Score(green + bold + "✓" + reset)
Expand Down
Loading

0 comments on commit 3dc9184

Please sign in to comment.