syft/test/integration/fixture_image_distro_test.go
Alex Goodman ba4f63099d
Add release process (#89)
* add check for app update; fix ETUI error handling

* validate user args

* add goreleaser support

* replace cgo dependencies (go-rpm) with go equivalents

* add acceptance tests against build snapshot

* add brew tap + acceptance test pipeline

* add mac acceptance tests

* fix compare makefile

* fix mac acceptance tests

* add release pipeline with wait checks

* add token to release step

* rm dir presenters int test

* enforce dpkg to be non interactive

Co-authored-by: Alfredo Deza <adeza@anchore.com>

* pin brew formulae

* pin skopeo to formulae url

* only run acceptance tests

Co-authored-by: Alfredo Deza <adeza@anchore.com>
2020-07-23 10:52:44 -04:00

43 lines
1003 B
Go

// +build integration
package integration
import (
"testing"
"github.com/anchore/imgbom/imgbom"
"github.com/anchore/go-testutils"
"github.com/anchore/imgbom/imgbom/distro"
"github.com/anchore/imgbom/imgbom/scope"
"github.com/go-test/deep"
)
func TestDistroImage(t *testing.T) {
fixtureImageName := "image-distro-id"
_, cleanup := testutils.GetFixtureImage(t, "docker-archive", fixtureImageName)
tarPath := testutils.GetFixtureImageTarPath(t, fixtureImageName)
defer cleanup()
_, _, actualDistro, err := imgbom.Catalog("docker-archive://"+tarPath, scope.AllLayersScope)
if err != nil {
t.Fatalf("failed to catalog image: %+v", err)
}
if actualDistro == nil {
t.Fatalf("could not find distro")
}
expected, err := distro.NewDistro(distro.Busybox, "1.31.1")
if err != nil {
t.Fatalf("could not create distro: %+v", err)
}
diffs := deep.Equal(*actualDistro, expected)
if len(diffs) != 0 {
for _, d := range diffs {
t.Errorf("found distro difference: %+v", d)
}
}
}