mirror of https://github.com/fluxcd/flux2.git
Add image scanning e2e tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>pull/1721/head
parent
d1982e64b2
commit
375edffd15
@ -0,0 +1,49 @@
|
|||||||
|
// +build e2e
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestImageScanning(t *testing.T) {
|
||||||
|
cases := []struct {
|
||||||
|
args string
|
||||||
|
goldenFile string
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
"create image repository podinfo --image=ghcr.io/stefanprodan/podinfo --interval=10m",
|
||||||
|
"testdata/image/create_image_repository.golden",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"create image policy podinfo-semver --image-ref=podinfo --interval=10m --select-semver=5.0.x",
|
||||||
|
"testdata/image/create_image_policy.golden",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"get image policy podinfo-semver",
|
||||||
|
"testdata/image/get_image_policy_semver.golden",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
`create image policy podinfo-regex --image-ref=podinfo --interval=10m --select-semver=">4.0.0" --filter-regex="5\.0\.0"`,
|
||||||
|
"testdata/image/create_image_policy.golden",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"get image policy podinfo-regex",
|
||||||
|
"testdata/image/get_image_policy_regex.golden",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace := "tis"
|
||||||
|
del, err := setupTestNamespace(namespace)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer del()
|
||||||
|
|
||||||
|
for _, tc := range cases {
|
||||||
|
cmd := cmdTestCase{
|
||||||
|
args: tc.args + " -n=" + namespace,
|
||||||
|
goldenFile: tc.goldenFile,
|
||||||
|
testClusterMode: ExistingClusterMode,
|
||||||
|
}
|
||||||
|
cmd.runTestCmd(t)
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
✚ generating ImagePolicy
|
||||||
|
► applying ImagePolicy
|
||||||
|
✔ ImageRepository created
|
||||||
|
◎ waiting for ImagePolicy reconciliation
|
||||||
|
✔ ImagePolicy reconciliation completed
|
@ -0,0 +1,5 @@
|
|||||||
|
✚ generating ImageRepository
|
||||||
|
► applying ImageRepository
|
||||||
|
✔ ImageRepository created
|
||||||
|
◎ waiting for ImageRepository reconciliation
|
||||||
|
✔ ImageRepository reconciliation completed
|
@ -0,0 +1,2 @@
|
|||||||
|
NAME READY MESSAGE LATEST IMAGE
|
||||||
|
podinfo-regex True Latest image tag for 'ghcr.io/stefanprodan/podinfo' resolved to: 5.0.0 ghcr.io/stefanprodan/podinfo:5.0.0
|
@ -0,0 +1,2 @@
|
|||||||
|
NAME READY MESSAGE LATEST IMAGE
|
||||||
|
podinfo-semver True Latest image tag for 'ghcr.io/stefanprodan/podinfo' resolved to: 5.0.3 ghcr.io/stefanprodan/podinfo:5.0.3
|
Loading…
Reference in New Issue