mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-21 14:50:53 -08:00
Added test and support of ASFF template (#594)
* Added test and support of ASFF template * Improve test coverage * Fixed/Improved tests * Removed extra space * Added NVD score/vectors, Added logic to trim description due to file size restriction * Included quotations around AccountID
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"github.com/aquasecurity/trivy/internal"
|
||||
"github.com/aquasecurity/trivy/pkg/report"
|
||||
)
|
||||
|
||||
type args struct {
|
||||
@@ -309,12 +310,27 @@ func TestClientServer(t *testing.T) {
|
||||
},
|
||||
golden: "testdata/busybox-with-lockfile.json.golden",
|
||||
},
|
||||
{
|
||||
name: "alpine 3.10 integration with ASFF template",
|
||||
testArgs: args{
|
||||
Format: "template",
|
||||
TemplatePath: "@../contrib/asff.tpl",
|
||||
Version: "dev",
|
||||
Input: "testdata/fixtures/alpine-310.tar.gz",
|
||||
},
|
||||
golden: "testdata/alpine-310.asff.golden",
|
||||
},
|
||||
}
|
||||
|
||||
app, addr, cacheDir := setup(t, "", "")
|
||||
|
||||
for _, c := range cases {
|
||||
t.Run(c.name, func(t *testing.T) {
|
||||
report.Now = func() time.Time {
|
||||
return time.Date(2020, 8, 10, 7, 28, 17, 958601, time.UTC)
|
||||
}
|
||||
os.Setenv("AWS_REGION", "test-region")
|
||||
os.Setenv("AWS_ACCOUNT_ID", "123456789012")
|
||||
osArgs, outputFile, cleanup := setupClient(t, c.testArgs, addr, cacheDir, c.golden)
|
||||
defer cleanup()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user