@@ -37,7 +37,8 @@ import (
3737
3838const (
3939 ImageWithVulnerabilities = "alpine:3.10.0"
40- ImageWithoutVulnerabilities = "dockerscanci/scratch:1.0" // FROM scratch
40+ ImageWithoutVulnerabilities = "hello-world"
41+ InvalidImage = "dockerscanci/scratch:1.0" // FROM scratch
4142 ImageBaseImageVulnerabilities = "dockerscanci/base-image-vulns:1.0" // FROM alpine:3.10.0
4243)
4344
@@ -124,6 +125,12 @@ func TestScanWithSnyk(t *testing.T) {
124125 exitCode : 0 ,
125126 contains : "no vulnerable paths found" ,
126127 },
128+ {
129+ name : "invalid-docker-archive" ,
130+ image : InvalidImage ,
131+ exitCode : 2 ,
132+ contains : "Invalid Docker archive" ,
133+ },
127134 {
128135 name : "image-with-vulnerabilities" ,
129136 image : ImageWithVulnerabilities ,
@@ -134,7 +141,7 @@ func TestScanWithSnyk(t *testing.T) {
134141 name : "invalid-image-name" ,
135142 image : "scratch" ,
136143 exitCode : 2 ,
137- contains : "image was not found locally and pulling failed " ,
144+ contains : "manifest unknown " ,
138145 },
139146 }
140147 for _ , testCase := range testCases {
@@ -170,6 +177,12 @@ func TestScanJsonOutput(t *testing.T) {
170177 exitCode : 0 ,
171178 isEmpty : true ,
172179 },
180+ {
181+ name : "invalid-docker-archive" ,
182+ image : InvalidImage ,
183+ exitCode : 2 ,
184+ isEmpty : true ,
185+ },
173186 {
174187 name : "image-with-vulnerabilities" ,
175188 image : ImageWithVulnerabilities ,
0 commit comments