From 0b76b6ca9d99bbf903585262bab00a3b868cf33c Mon Sep 17 00:00:00 2001 From: Guilherme Cassolato Date: Thu, 17 Oct 2024 15:18:33 +0200 Subject: [PATCH] tests: fix integration tests - order of wasm action sets (again!) Signed-off-by: Guilherme Cassolato --- tests/istio/extension_reconciler_test.go | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/istio/extension_reconciler_test.go b/tests/istio/extension_reconciler_test.go index 0d8606ffb..52e531f64 100644 --- a/tests/istio/extension_reconciler_test.go +++ b/tests/istio/extension_reconciler_test.go @@ -155,7 +155,7 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { }, ActionSets: []wasm.ActionSet{ { - Name: wasm.ActionSetNameForPath(pathID, 1, "*.example.com"), + Name: wasm.ActionSetNameForPath(pathID, 0, "*.example.com"), RouteRuleConditions: wasm.RouteRuleConditions{ Hostnames: []string{"*.example.com"}, Matches: []wasm.Predicate{ @@ -306,11 +306,11 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { httpRouteRuleToys := &machinery.HTTPRouteRule{HTTPRoute: mHTTPRoute, HTTPRouteRule: &httpRoute.Spec.Rules[0], Name: "rule-1"} httpRouteRuleAssets := &machinery.HTTPRouteRule{HTTPRoute: mHTTPRoute, HTTPRouteRule: &httpRoute.Spec.Rules[1], Name: "rule-2"} - // api.toystore.io/assets* + // *.toystore.acme.com/assets* actionSet := existingWASMConfig.ActionSets[0] pathID := kuadrantv1.PathID(append(basePath, httpRouteRuleAssets)) - Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 0, "api.toystore.io"))) - Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"api.toystore.io"})) + Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 0, "*.toystore.acme.com"))) + Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"*.toystore.acme.com"})) Expect(actionSet.RouteRuleConditions.Matches).To(ContainElements( wasm.Predicate{ Selector: "request.url_path", @@ -364,11 +364,11 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { }, )) - // GET api.toystore.io/toys* + // GET *.toystore.acme.com/toys* actionSet = existingWASMConfig.ActionSets[1] pathID = kuadrantv1.PathID(append(basePath, httpRouteRuleToys)) - Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 0, "api.toystore.io"))) - Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"api.toystore.io"})) + Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 0, "*.toystore.acme.com"))) + Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"*.toystore.acme.com"})) Expect(actionSet.RouteRuleConditions.Matches).To(ContainElements( wasm.Predicate{ Selector: "request.method", @@ -427,11 +427,11 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { }, )) - // POST api.toystore.io/toys* + // POST *.toystore.acme.com/toys* actionSet = existingWASMConfig.ActionSets[2] pathID = kuadrantv1.PathID(append(basePath, httpRouteRuleToys)) - Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 1, "api.toystore.io"))) - Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"api.toystore.io"})) + Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 1, "*.toystore.acme.com"))) + Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"*.toystore.acme.com"})) Expect(actionSet.RouteRuleConditions.Matches).To(ContainElements( wasm.Predicate{ Selector: "request.method", @@ -490,11 +490,11 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { }, )) - // *.toystore.acme.com/assets* + // api.toystore.io/assets* actionSet = existingWASMConfig.ActionSets[3] pathID = kuadrantv1.PathID(append(basePath, httpRouteRuleAssets)) - Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 0, "*.toystore.acme.com"))) - Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"*.toystore.acme.com"})) + Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 0, "api.toystore.io"))) + Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"api.toystore.io"})) Expect(actionSet.RouteRuleConditions.Matches).To(ContainElements( wasm.Predicate{ Selector: "request.url_path", @@ -548,11 +548,11 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { }, )) - // GET *.toystore.acme.com/toys* + // GET api.toystore.io/toys* actionSet = existingWASMConfig.ActionSets[4] pathID = kuadrantv1.PathID(append(basePath, httpRouteRuleToys)) - Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 0, "*.toystore.acme.com"))) - Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"*.toystore.acme.com"})) + Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 0, "api.toystore.io"))) + Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"api.toystore.io"})) Expect(actionSet.RouteRuleConditions.Matches).To(ContainElements( wasm.Predicate{ Selector: "request.method", @@ -611,11 +611,11 @@ var _ = Describe("Rate Limiting WasmPlugin controller", func() { }, )) - // POST *.toystore.acme.com/toys* + // POST api.toystore.io/toys* actionSet = existingWASMConfig.ActionSets[5] pathID = kuadrantv1.PathID(append(basePath, httpRouteRuleToys)) - Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 1, "*.toystore.acme.com"))) - Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"*.toystore.acme.com"})) + Expect(actionSet.Name).To(Equal(wasm.ActionSetNameForPath(pathID, 1, "api.toystore.io"))) + Expect(actionSet.RouteRuleConditions.Hostnames).To(Equal([]string{"api.toystore.io"})) Expect(actionSet.RouteRuleConditions.Matches).To(ContainElements( wasm.Predicate{ Selector: "request.method",