mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:09:23 +08:00
feat: add trivy-based sbom artifact generation support (#4088)
fixes issue #4067 Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
This commit is contained in:
committed by
GitHub
parent
d8fb19819b
commit
4e4d00a0a6
@@ -20,7 +20,7 @@ func TestConfigReloader(t *testing.T) {
|
||||
|
||||
defer func() { os.Args = oldArgs }()
|
||||
|
||||
Convey("reload access control config", t, func(c C) {
|
||||
Convey("reload access control config", t, func(conveyCtx C) {
|
||||
port := test.GetFreePort()
|
||||
baseURL := test.GetBaseURL(port)
|
||||
|
||||
@@ -79,7 +79,7 @@ func TestConfigReloader(t *testing.T) {
|
||||
|
||||
go func() {
|
||||
err = cli.NewServerRootCmd().Execute()
|
||||
So(err, ShouldBeNil)
|
||||
conveyCtx.So(err, ShouldBeNil)
|
||||
}()
|
||||
|
||||
test.WaitTillServerReady(baseURL)
|
||||
@@ -173,7 +173,7 @@ func TestConfigReloader(t *testing.T) {
|
||||
})
|
||||
})
|
||||
|
||||
Convey("reload gc config", t, func(c C) {
|
||||
Convey("reload gc config", t, func(ctx C) {
|
||||
port := test.GetFreePort()
|
||||
baseURL := test.GetBaseURL(port)
|
||||
|
||||
@@ -214,7 +214,7 @@ func TestConfigReloader(t *testing.T) {
|
||||
|
||||
go func() {
|
||||
err = cli.NewServerRootCmd().Execute()
|
||||
So(err, ShouldBeNil)
|
||||
ctx.So(err, ShouldBeNil)
|
||||
}()
|
||||
|
||||
test.WaitTillServerReady(baseURL)
|
||||
@@ -300,7 +300,7 @@ func TestConfigReloader(t *testing.T) {
|
||||
})
|
||||
})
|
||||
|
||||
Convey("reload sync config", t, func(c C) {
|
||||
Convey("reload sync config", t, func(ctx C) {
|
||||
port := test.GetFreePort()
|
||||
baseURL := test.GetBaseURL(port)
|
||||
|
||||
@@ -352,7 +352,7 @@ func TestConfigReloader(t *testing.T) {
|
||||
|
||||
go func() {
|
||||
err = cli.NewServerRootCmd().Execute()
|
||||
So(err, ShouldBeNil)
|
||||
ctx.So(err, ShouldBeNil)
|
||||
}()
|
||||
|
||||
test.WaitTillServerReady(baseURL)
|
||||
@@ -450,7 +450,7 @@ func TestConfigReloader(t *testing.T) {
|
||||
})
|
||||
})
|
||||
|
||||
Convey("reload scrub and CVE config", t, func(c C) {
|
||||
Convey("reload scrub and CVE config", t, func(ctx C) {
|
||||
port := test.GetFreePort()
|
||||
baseURL := test.GetBaseURL(port)
|
||||
|
||||
@@ -495,7 +495,7 @@ func TestConfigReloader(t *testing.T) {
|
||||
|
||||
go func() {
|
||||
err = cli.NewServerRootCmd().Execute()
|
||||
So(err, ShouldBeNil)
|
||||
ctx.So(err, ShouldBeNil)
|
||||
}()
|
||||
|
||||
test.WaitTillServerReady(baseURL)
|
||||
@@ -591,7 +591,7 @@ func TestConfigReloader(t *testing.T) {
|
||||
So(found, ShouldBeTrue)
|
||||
})
|
||||
|
||||
Convey("reload bad config", t, func(c C) {
|
||||
Convey("reload bad config", t, func(conveyCtx C) {
|
||||
port := test.GetFreePort()
|
||||
baseURL := test.GetBaseURL(port)
|
||||
|
||||
@@ -643,7 +643,7 @@ func TestConfigReloader(t *testing.T) {
|
||||
|
||||
go func() {
|
||||
err = cli.NewServerRootCmd().Execute()
|
||||
So(err, ShouldBeNil)
|
||||
conveyCtx.So(err, ShouldBeNil)
|
||||
}()
|
||||
|
||||
test.WaitTillServerReady(baseURL)
|
||||
|
||||
@@ -968,7 +968,7 @@ func TestServeSearchEnabledDefaultCVEDB(t *testing.T) {
|
||||
// The default config handling logic will convert the 1h interval to a 2h interval
|
||||
substring := "\"Search\":{\"Enable\":true,\"CVE\":{\"UpdateInterval\":7200000000000,\"Trivy\":" +
|
||||
"{\"DBRepository\":\"ghcr.io/aquasecurity/trivy-db\",\"JavaDBRepository\":\"ghcr.io/aquasecurity/trivy-java-db\"," +
|
||||
"\"VulnSeveritySources\":[\"auto\"]}}}"
|
||||
"\"VulnSeveritySources\":[\"auto\"],\"SBOM\":null}}}"
|
||||
|
||||
found, err := ReadLogFileAndSearchString(logPath, substring, readLogFileTimeout)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user