syft/test/integration/all_layers_squashed_comparison_test.go

20 lines
675 B
Go

package integration
import (
"testing"
"github.com/anchore/syft/syft/source"
)
func Test_AllLayersIncludesSquashed(t *testing.T) {
// This is a verification test for issue #894 (https://github.com/anchore/syft/issues/894)
allLayers, _ := catalogFixtureImage(t, "image-suse-all-layers", source.AllLayersScope, nil)
squashed, _ := catalogFixtureImage(t, "image-suse-all-layers", source.SquashedScope, nil)
lenAllLayers := len(allLayers.Artifacts.PackageCatalog.Sorted())
lenSquashed := len(squashed.Artifacts.PackageCatalog.Sorted())
if lenAllLayers < lenSquashed {
t.Errorf("squashed has more packages than all-layers: %d > %d", lenSquashed, lenAllLayers)
}
}