-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Will Murphy <[email protected]>
- Loading branch information
1 parent
74e6851
commit caa6941
Showing
4 changed files
with
11 additions
and
20 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -658,7 +658,7 @@ func intRef(i int) *int { | |
return &i | ||
} | ||
|
||
func Test_RemoveBinaryPackagesByOverlap(t *testing.T) { | ||
func Test_RemovePackagesByOverlap(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
sbom *sbom.SBOM | ||
|
@@ -709,16 +709,16 @@ func Test_RemoveBinaryPackagesByOverlap(t *testing.T) { | |
{ | ||
name: "does not exclude if OS package owns OS package", | ||
sbom: catalogWithOverlaps( | ||
[]string{"rpm:perl@19.2-r1", "rpm:libperl@19.2"}, | ||
[]string{"rpm:perl@19.2-r1 -> rpm:libperl@19.2"}), | ||
expectedPackages: []string{"apk:[email protected]", "rpm:[email protected]-r1"}, | ||
[]string{"rpm:perl@5.3-r1", "rpm:libperl@5.3"}, | ||
[]string{"rpm:perl@5.3-r1 -> rpm:libperl@5.3"}), | ||
expectedPackages: []string{"rpm:[email protected]", "rpm:[email protected]-r1"}, | ||
}, | ||
{ | ||
name: "does not exclude if owning package is non-OS", | ||
sbom: catalogWithOverlaps( | ||
[]string{"python:[email protected]", "python:[email protected]"}, | ||
[]string{"python:[email protected] -> python:[email protected]"}), | ||
expectedPackages: []string{"apk:[email protected]", "rpm:[email protected]"}, | ||
expectedPackages: []string{"python:[email protected]", "python:[email protected]"}, | ||
}, | ||
{ | ||
name: "python bindings for system RPM install", | ||
|
@@ -737,7 +737,7 @@ func Test_RemoveBinaryPackagesByOverlap(t *testing.T) { | |
} | ||
for _, test := range tests { | ||
t.Run(test.name, func(t *testing.T) { | ||
catalog := removePackagesByOverlap(test.sbom) | ||
catalog := removePackagesByOverlap(test.sbom.Artifacts.Packages, test.sbom.Relationships, test.sbom.Artifacts.LinuxDistribution) | ||
pkgs := FromCollection(catalog, SynthesisConfig{}) | ||
var pkgNames []string | ||
for _, p := range pkgs { | ||
|
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
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