From e6ead0e3294513e97c95c576d2753b424b44960a Mon Sep 17 00:00:00 2001 From: dhruv0000 Date: Fri, 19 Mar 2021 13:51:01 +0530 Subject: [PATCH 1/4] Updated auto-injection criteria for different meshes Signed-off-by: dhruv0000 --- smi-conformance/grpc/handlers.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/smi-conformance/grpc/handlers.go b/smi-conformance/grpc/handlers.go index 67dd22d..256a6b5 100644 --- a/smi-conformance/grpc/handlers.go +++ b/smi-conformance/grpc/handlers.go @@ -42,9 +42,12 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo config = linkerdConfig switch req.Mesh.Type { - case smp.ServiceMesh_APP_MESH: + case smp.ServiceMesh_LINKERD: config = linkerdConfig req.Mesh.Annotations["linkerd.io/inject"] = "enabled" + case smp.ServiceMesh_APP_MESH: + config = linkerdConfig + req.Mesh.Labels["appmesh.k8s.aws/sidecarInjectorWebhook"] = "enabled" case smp.ServiceMesh_MAESH: config = maeshConfig case smp.ServiceMesh_ISTIO: @@ -53,6 +56,10 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo case smp.ServiceMesh_OPEN_SERVICE_MESH: config = osmConfig req.Mesh.Labels["openservicemesh.io/monitored-by"] = "osm" + case smp.ServiceMesh_KUMA: + req.Mesh.Annotations["kuma.io/sidecar-injection"] = "enabled" + case smp.ServiceMesh_NGINX_SERVICE_MESH: + req.Mesh.Annotations["njector.nsm.nginx.com/auto-inject"] = "true" } From 5088dfab39f2969ddbc0c6f94a4a17cce190b19b Mon Sep 17 00:00:00 2001 From: dhruv0000 Date: Fri, 19 Mar 2021 14:36:35 +0530 Subject: [PATCH 2/4] Docker Build Fix Signed-off-by: dhruv0000 --- smi-conformance/grpc/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smi-conformance/grpc/handlers.go b/smi-conformance/grpc/handlers.go index 256a6b5..95bf417 100644 --- a/smi-conformance/grpc/handlers.go +++ b/smi-conformance/grpc/handlers.go @@ -105,7 +105,7 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo // A hacky way to see the testStep Failed, since KUDO only provides it in Failure.Message re := regexp.MustCompile(`[0-9]+`) - if res.Failure != nil { + if res.Failure.Message != "" { stepFailed := re.FindAllString(res.Failure.Message, 1) if len(stepFailed) != 0 { passed, _ := strconv.Atoi(stepFailed[0]) From 150cab86959d4697616845605eee790a39bdc296 Mon Sep 17 00:00:00 2001 From: dhruv0000 Date: Sun, 21 Mar 2021 17:02:23 +0530 Subject: [PATCH 3/4] Updated test yaml to smi-spec v0.6.0 Signed-off-by: dhruv0000 --- smi-conformance/grpc/handlers.go | 7 ++- .../test-yamls/traffic-access/04-assert.yaml | 31 +++++++------ .../test-yamls/traffic-access/04-install.yaml | 30 +++++++------ .../test-yamls/traffic-access/06-errors.yaml | 30 +++++++------ .../test-yamls/traffic-access/06-install.yaml | 4 +- .../test-yamls/traffic-spec/03-assert.yaml | 33 +++++++------- .../test-yamls/traffic-spec/03-install.yaml | 33 +++++++------- .../test-yamls/traffic-spec/05-assert.yaml | 44 ++++++++++--------- .../test-yamls/traffic-spec/05-install.yaml | 44 ++++++++++--------- .../test-yamls/traffic-split/04-assert.yaml | 2 +- .../test-yamls/traffic-split/04-install.yaml | 2 +- .../test-yamls/traffic-split/06-assert.yaml | 2 +- .../test-yamls/traffic-split/06-install.yaml | 2 +- .../test-yamls/traffic-split/08-assert.yaml | 2 +- .../test-yamls/traffic-split/08-install.yaml | 2 +- .../test-yamls/traffic-split/10-assert.yaml | 2 +- .../test-yamls/traffic-split/10-install.yaml | 2 +- smi-conformance/test-gen/test_gen.go | 2 +- 18 files changed, 149 insertions(+), 125 deletions(-) diff --git a/smi-conformance/grpc/handlers.go b/smi-conformance/grpc/handlers.go index 95bf417..848ba3a 100644 --- a/smi-conformance/grpc/handlers.go +++ b/smi-conformance/grpc/handlers.go @@ -71,12 +71,17 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo "traffic-split": 11, "traffic-spec": 6, } + specVersion := map[string]string{ + "traffic-access": "v0.6.0/v1alpha3", + "traffic-split": "v0.6.0/v1alpha4", + "traffic-spec": "v0.6.0/v1alpha4", + } details := make([]*conformance.Detail, 0) for _, res := range result.Testsuite[0].Testcase { d := &conformance.Detail{ Smispec: res.Name, - Specversion: "v1alpha1", + Specversion: specVersion[res.Name], Assertion: strconv.Itoa(stepsCount[res.Name]), Duration: res.Time, Capability: conformance.Capability_FULL, diff --git a/smi-conformance/test-gen/test-yamls/traffic-access/04-assert.yaml b/smi-conformance/test-gen/test-yamls/traffic-access/04-assert.yaml index 3d4d425..91ffe9d 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-access/04-assert.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-access/04-assert.yaml @@ -1,22 +1,27 @@ -apiVersion: specs.smi-spec.io/v1alpha1 +--- +apiVersion: specs.smi-spec.io/v1alpha4 kind: TCPRoute metadata: name: service-tcp-route namespace: +spec: + matches: + ports: [] --- -apiVersion: access.smi-spec.io/v1alpha1 +apiVersion: access.smi-spec.io/v1alpha3 kind: TrafficTarget metadata: name: service-targets namespace: -destination: - kind: ServiceAccount - name: service-b - namespace: -sources: -- kind: ServiceAccount - name: service-a - namespace: -specs: -- kind: TCPRoute - name: service-tcp-route \ No newline at end of file +spec: + destination: + kind: ServiceAccount + name: service-b + namespace: + sources: + - kind: ServiceAccount + name: service-a + namespace: + rules: + - kind: TCPRoute + name: service-tcp-route diff --git a/smi-conformance/test-gen/test-yamls/traffic-access/04-install.yaml b/smi-conformance/test-gen/test-yamls/traffic-access/04-install.yaml index 0b2adfa..91ffe9d 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-access/04-install.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-access/04-install.yaml @@ -1,23 +1,27 @@ --- -apiVersion: specs.smi-spec.io/v1alpha1 +apiVersion: specs.smi-spec.io/v1alpha4 kind: TCPRoute metadata: name: service-tcp-route namespace: +spec: + matches: + ports: [] --- -apiVersion: access.smi-spec.io/v1alpha1 +apiVersion: access.smi-spec.io/v1alpha3 kind: TrafficTarget metadata: name: service-targets namespace: -destination: - kind: ServiceAccount - name: service-b - namespace: -sources: -- kind: ServiceAccount - name: service-a - namespace: -specs: -- kind: TCPRoute - name: service-tcp-route \ No newline at end of file +spec: + destination: + kind: ServiceAccount + name: service-b + namespace: + sources: + - kind: ServiceAccount + name: service-a + namespace: + rules: + - kind: TCPRoute + name: service-tcp-route diff --git a/smi-conformance/test-gen/test-yamls/traffic-access/06-errors.yaml b/smi-conformance/test-gen/test-yamls/traffic-access/06-errors.yaml index 0b2adfa..91ffe9d 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-access/06-errors.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-access/06-errors.yaml @@ -1,23 +1,27 @@ --- -apiVersion: specs.smi-spec.io/v1alpha1 +apiVersion: specs.smi-spec.io/v1alpha4 kind: TCPRoute metadata: name: service-tcp-route namespace: +spec: + matches: + ports: [] --- -apiVersion: access.smi-spec.io/v1alpha1 +apiVersion: access.smi-spec.io/v1alpha3 kind: TrafficTarget metadata: name: service-targets namespace: -destination: - kind: ServiceAccount - name: service-b - namespace: -sources: -- kind: ServiceAccount - name: service-a - namespace: -specs: -- kind: TCPRoute - name: service-tcp-route \ No newline at end of file +spec: + destination: + kind: ServiceAccount + name: service-b + namespace: + sources: + - kind: ServiceAccount + name: service-a + namespace: + rules: + - kind: TCPRoute + name: service-tcp-route diff --git a/smi-conformance/test-gen/test-yamls/traffic-access/06-install.yaml b/smi-conformance/test-gen/test-yamls/traffic-access/06-install.yaml index 235135d..de5fa97 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-access/06-install.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-access/06-install.yaml @@ -1,11 +1,11 @@ apiVersion: kudo.dev/v1alpha1 kind: TestStep delete: -- apiVersion: specs.smi-spec.io/v1alpha1 +- apiVersion: specs.smi-spec.io/v1alpha4 kind: TCPRoute namespace: name: service-tcp-route -- apiVersion: access.smi-spec.io/v1alpha1 +- apiVersion: access.smi-spec.io/v1alpha3 kind: TrafficTarget namespace: name: service-targets \ No newline at end of file diff --git a/smi-conformance/test-gen/test-yamls/traffic-spec/03-assert.yaml b/smi-conformance/test-gen/test-yamls/traffic-spec/03-assert.yaml index 09b7bc4..9d5f13a 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-spec/03-assert.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-spec/03-assert.yaml @@ -1,4 +1,4 @@ -apiVersion: specs.smi-spec.io/v1alpha1 +apiVersion: specs.smi-spec.io/v1alpha4 kind: HTTPRouteGroup metadata: name: http-rg @@ -8,22 +8,23 @@ matches: pathRegex: /metrics methods: ["*"] --- -apiVersion: access.smi-spec.io/v1alpha1 +apiVersion: access.smi-spec.io/v1alpha3 kind: TrafficTarget metadata: name: service-targets namespace: -destination: - kind: ServiceAccount - name: service-b - namespace: - port: "9091" -sources: -- kind: ServiceAccount - name: service-a - namespace: -specs: -- kind: HTTPRouteGroup - name: http-rg - matches: - - testMatch \ No newline at end of file +rules: + destination: + kind: ServiceAccount + name: service-b + namespace: + port: "9091" + sources: + - kind: ServiceAccount + name: service-a + namespace: + specs: + - kind: HTTPRouteGroup + name: http-rg + matches: + - testMatch \ No newline at end of file diff --git a/smi-conformance/test-gen/test-yamls/traffic-spec/03-install.yaml b/smi-conformance/test-gen/test-yamls/traffic-spec/03-install.yaml index 09b7bc4..9d5f13a 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-spec/03-install.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-spec/03-install.yaml @@ -1,4 +1,4 @@ -apiVersion: specs.smi-spec.io/v1alpha1 +apiVersion: specs.smi-spec.io/v1alpha4 kind: HTTPRouteGroup metadata: name: http-rg @@ -8,22 +8,23 @@ matches: pathRegex: /metrics methods: ["*"] --- -apiVersion: access.smi-spec.io/v1alpha1 +apiVersion: access.smi-spec.io/v1alpha3 kind: TrafficTarget metadata: name: service-targets namespace: -destination: - kind: ServiceAccount - name: service-b - namespace: - port: "9091" -sources: -- kind: ServiceAccount - name: service-a - namespace: -specs: -- kind: HTTPRouteGroup - name: http-rg - matches: - - testMatch \ No newline at end of file +rules: + destination: + kind: ServiceAccount + name: service-b + namespace: + port: "9091" + sources: + - kind: ServiceAccount + name: service-a + namespace: + specs: + - kind: HTTPRouteGroup + name: http-rg + matches: + - testMatch \ No newline at end of file diff --git a/smi-conformance/test-gen/test-yamls/traffic-spec/05-assert.yaml b/smi-conformance/test-gen/test-yamls/traffic-spec/05-assert.yaml index 6f3becd..fc4ee9c 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-spec/05-assert.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-spec/05-assert.yaml @@ -1,30 +1,32 @@ -apiVersion: specs.smi-spec.io/v1alpha1 +apiVersion: specs.smi-spec.io/v1alpha4 kind: HTTPRouteGroup metadata: name: http-rg namespace: -matches: -- name: testMatch - pathRegex: ".*" - methods: - - GET +spec: + matches: + - name: testMatch + pathRegex: ".*" + methods: + - GET --- -apiVersion: access.smi-spec.io/v1alpha1 +apiVersion: access.smi-spec.io/v1alpha3 kind: TrafficTarget metadata: name: service-targets namespace: -destination: - kind: ServiceAccount - name: service-b - namespace: - port: "9091" -sources: -- kind: ServiceAccount - name: service-a - namespace: -specs: -- kind: HTTPRouteGroup - name: http-rg - matches: - - testMatch \ No newline at end of file +spec: + destination: + kind: ServiceAccount + name: service-b + namespace: + port: "9091" + sources: + - kind: ServiceAccount + name: service-a + namespace: + rules: + - kind: HTTPRouteGroup + name: http-rg + matches: + - testMatch \ No newline at end of file diff --git a/smi-conformance/test-gen/test-yamls/traffic-spec/05-install.yaml b/smi-conformance/test-gen/test-yamls/traffic-spec/05-install.yaml index 6f3becd..fc4ee9c 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-spec/05-install.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-spec/05-install.yaml @@ -1,30 +1,32 @@ -apiVersion: specs.smi-spec.io/v1alpha1 +apiVersion: specs.smi-spec.io/v1alpha4 kind: HTTPRouteGroup metadata: name: http-rg namespace: -matches: -- name: testMatch - pathRegex: ".*" - methods: - - GET +spec: + matches: + - name: testMatch + pathRegex: ".*" + methods: + - GET --- -apiVersion: access.smi-spec.io/v1alpha1 +apiVersion: access.smi-spec.io/v1alpha3 kind: TrafficTarget metadata: name: service-targets namespace: -destination: - kind: ServiceAccount - name: service-b - namespace: - port: "9091" -sources: -- kind: ServiceAccount - name: service-a - namespace: -specs: -- kind: HTTPRouteGroup - name: http-rg - matches: - - testMatch \ No newline at end of file +spec: + destination: + kind: ServiceAccount + name: service-b + namespace: + port: "9091" + sources: + - kind: ServiceAccount + name: service-a + namespace: + rules: + - kind: HTTPRouteGroup + name: http-rg + matches: + - testMatch \ No newline at end of file diff --git a/smi-conformance/test-gen/test-yamls/traffic-split/04-assert.yaml b/smi-conformance/test-gen/test-yamls/traffic-split/04-assert.yaml index 3f5f61b..0bdc089 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-split/04-assert.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-split/04-assert.yaml @@ -1,4 +1,4 @@ -apiVersion: split.smi-spec.io/v1alpha1 +apiVersion: split.smi-spec.io/v1alpha4 kind: TrafficSplit metadata: name: server-split diff --git a/smi-conformance/test-gen/test-yamls/traffic-split/04-install.yaml b/smi-conformance/test-gen/test-yamls/traffic-split/04-install.yaml index 3f5f61b..0bdc089 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-split/04-install.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-split/04-install.yaml @@ -1,4 +1,4 @@ -apiVersion: split.smi-spec.io/v1alpha1 +apiVersion: split.smi-spec.io/v1alpha4 kind: TrafficSplit metadata: name: server-split diff --git a/smi-conformance/test-gen/test-yamls/traffic-split/06-assert.yaml b/smi-conformance/test-gen/test-yamls/traffic-split/06-assert.yaml index 551ac56..76a3d7f 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-split/06-assert.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-split/06-assert.yaml @@ -1,4 +1,4 @@ -apiVersion: split.smi-spec.io/v1alpha1 +apiVersion: split.smi-spec.io/v1alpha4 kind: TrafficSplit metadata: name: server-split diff --git a/smi-conformance/test-gen/test-yamls/traffic-split/06-install.yaml b/smi-conformance/test-gen/test-yamls/traffic-split/06-install.yaml index 551ac56..76a3d7f 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-split/06-install.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-split/06-install.yaml @@ -1,4 +1,4 @@ -apiVersion: split.smi-spec.io/v1alpha1 +apiVersion: split.smi-spec.io/v1alpha4 kind: TrafficSplit metadata: name: server-split diff --git a/smi-conformance/test-gen/test-yamls/traffic-split/08-assert.yaml b/smi-conformance/test-gen/test-yamls/traffic-split/08-assert.yaml index bf5c5b4..1e6ac60 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-split/08-assert.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-split/08-assert.yaml @@ -1,4 +1,4 @@ -apiVersion: split.smi-spec.io/v1alpha1 +apiVersion: split.smi-spec.io/v1alpha4 kind: TrafficSplit metadata: name: server-split diff --git a/smi-conformance/test-gen/test-yamls/traffic-split/08-install.yaml b/smi-conformance/test-gen/test-yamls/traffic-split/08-install.yaml index bf5c5b4..1e6ac60 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-split/08-install.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-split/08-install.yaml @@ -1,4 +1,4 @@ -apiVersion: split.smi-spec.io/v1alpha1 +apiVersion: split.smi-spec.io/v1alpha4 kind: TrafficSplit metadata: name: server-split diff --git a/smi-conformance/test-gen/test-yamls/traffic-split/10-assert.yaml b/smi-conformance/test-gen/test-yamls/traffic-split/10-assert.yaml index 84ae6a8..bb766fa 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-split/10-assert.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-split/10-assert.yaml @@ -1,4 +1,4 @@ -apiVersion: split.smi-spec.io/v1alpha1 +apiVersion: split.smi-spec.io/v1alpha4 kind: TrafficSplit metadata: name: server-split diff --git a/smi-conformance/test-gen/test-yamls/traffic-split/10-install.yaml b/smi-conformance/test-gen/test-yamls/traffic-split/10-install.yaml index 84ae6a8..bb766fa 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-split/10-install.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-split/10-install.yaml @@ -1,4 +1,4 @@ -apiVersion: split.smi-spec.io/v1alpha1 +apiVersion: split.smi-spec.io/v1alpha4 kind: TrafficSplit metadata: name: server-split diff --git a/smi-conformance/test-gen/test_gen.go b/smi-conformance/test-gen/test_gen.go index db8035b..2b98833 100644 --- a/smi-conformance/test-gen/test_gen.go +++ b/smi-conformance/test-gen/test_gen.go @@ -55,7 +55,7 @@ func RunTest(meshConfig ServiceMesh, annotations, labels map[string]string) Resu args := []string{"./test-yamls/"} options.TestDirs = args - options.Timeout = 120 + options.Timeout = 180 options.Parallel = 1 options.TestDirs = manifestDirs options.StartKIND = false From d11b0fa4a87def62118365e8cb33d43b0d7f7c3e Mon Sep 17 00:00:00 2001 From: dhruv0000 Date: Sun, 21 Mar 2021 17:48:57 +0530 Subject: [PATCH 4/4] Updated smi YAMLs Signed-off-by: dhruv0000 --- .../test-gen/test-yamls/traffic-spec/03-assert.yaml | 4 ++-- .../test-gen/test-yamls/traffic-spec/03-install.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/smi-conformance/test-gen/test-yamls/traffic-spec/03-assert.yaml b/smi-conformance/test-gen/test-yamls/traffic-spec/03-assert.yaml index 9d5f13a..16c42ba 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-spec/03-assert.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-spec/03-assert.yaml @@ -13,7 +13,7 @@ kind: TrafficTarget metadata: name: service-targets namespace: -rules: +spec: destination: kind: ServiceAccount name: service-b @@ -23,7 +23,7 @@ rules: - kind: ServiceAccount name: service-a namespace: - specs: + rules: - kind: HTTPRouteGroup name: http-rg matches: diff --git a/smi-conformance/test-gen/test-yamls/traffic-spec/03-install.yaml b/smi-conformance/test-gen/test-yamls/traffic-spec/03-install.yaml index 9d5f13a..16c42ba 100644 --- a/smi-conformance/test-gen/test-yamls/traffic-spec/03-install.yaml +++ b/smi-conformance/test-gen/test-yamls/traffic-spec/03-install.yaml @@ -13,7 +13,7 @@ kind: TrafficTarget metadata: name: service-targets namespace: -rules: +spec: destination: kind: ServiceAccount name: service-b @@ -23,7 +23,7 @@ rules: - kind: ServiceAccount name: service-a namespace: - specs: + rules: - kind: HTTPRouteGroup name: http-rg matches: