Keep original FileInfo persisted on file.Metadata structs (#1794)

* pull in fileinfo changes from stereoscope #172

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* fix CLI test assumption about the docker daemon

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

---------

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: <>
This commit is contained in:
Alex Goodman
2023-05-19 14:21:10 +00:00
committed by GitHub
parent f1b6f38ea8
commit 334a775cb9
20 changed files with 152 additions and 59 deletions
+7
View File
@@ -52,6 +52,13 @@ func TestAllFormatsConvertable(t *testing.T) {
convertArgs = append(convertArgs, "--template", test.template)
}
cmd, stdout, stderr = runSyft(t, test.env, convertArgs...)
if cmd.ProcessState.ExitCode() != 0 {
t.Log("STDOUT:\n", stdout)
t.Log("STDERR:\n", stderr)
t.Log("COMMAND:", strings.Join(cmd.Args, " "))
t.Fatalf("failure executing syft creating an sbom")
return
}
for _, traitFn := range assertions {
traitFn(t, stdout, stderr, cmd.ProcessState.ExitCode())
}
+3 -3
View File
@@ -15,9 +15,9 @@ import (
)
func TestSpdxValidationTooling(t *testing.T) {
img := imagetest.GetFixtureImage(t, "docker-archive", "image-java-spdx-tools")
require.NotEmpty(t, img.Metadata.Tags)
imgTag := img.Metadata.Tags[0]
// note: the external tooling requires that the daemon explicitly has the image loaded, not just that
// we can get the image from a cache tar.
imgTag := imagetest.LoadFixtureImageIntoDocker(t, "image-java-spdx-tools")
images := []string{
"alpine:3.17.3@sha256:b6ca290b6b4cdcca5b3db3ffa338ee0285c11744b4a6abaa9627746ee3291d8d",