Skip to content

Commit

Permalink
update_grpc_testcase (#628)
Browse files Browse the repository at this point in the history
* update_grpc_testcase

* Update pkg/tests/tasks/security/authorization/ext_auth_test.go

Co-authored-by: Dylan Monroe <[email protected]>

* Delete tests/result-20230907153355/v2.5/failures-must-gather/20230907153410-TestEnvoyExtAuthzGrpcExtensionProvider/timestamp

---------

Co-authored-by: Praneeth Bajjuri <[email protected]>
Co-authored-by: Dylan Monroe <[email protected]>
  • Loading branch information
3 people authored Sep 7, 2023
1 parent f1fff52 commit 02884d7
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions pkg/tests/tasks/security/authorization/ext_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,25 @@ func TestEnvoyExtAuthzGrpcExtensionProvider(t *testing.T) {
oc.WaitDeploymentRolloutComplete(t, ns, "ext-authz")

t.LogStep("Set envoyExtAuthzgRPC extension provider in SMCP")
if env.GetSMCPVersion().GreaterThanOrEqual(version.SMCP_2_3) {
if env.GetSMCPVersion().LessThan(version.SMCP_2_4) {
oc.Patch(t, meshNamespace, "smcp", smcpName, "merge", `
spec:
techPreview:
meshConfig:
extensionProviders:
- name: sample-ext-authz-grpc
envoyExtAuthzGrpc:
includeRequestHeadersInCheck:
- x-ext-authz
port: "9000"
service: ext-authz.foo.svc.cluster.local`)

t.Cleanup(func() {
oc.Patch(t, meshNamespace, "smcp", smcpName, "json",
`[{"op": "remove", "path": "/spec/techPreview"}]`)
})

} else {
oc.Patch(t, meshNamespace, "smcp", smcpName, "merge", `
spec:
meshConfig:
Expand All @@ -145,14 +163,13 @@ spec:
envoyExtAuthzGrpc:
includeRequestHeadersInCheck:
- x-ext-authz
port: "9000"
port: 9000
service: ext-authz.foo.svc.cluster.local`)

t.Cleanup(func() {
oc.Patch(t, meshNamespace, "smcp", smcpName, "json",
`[{"op": "remove", "path": "/spec/techPreview"}]`)
`[{"op": "remove", "path": "/spec/meshConfig"}]`)
})

}

t.LogStep("Deploy the external authorization in the Authorization policy")
Expand Down

0 comments on commit 02884d7

Please sign in to comment.