Skip to content

Commit

Permalink
test(e2e): traffic route test with default tr policy (backport of #11523
Browse files Browse the repository at this point in the history
) (#11640)

* test(e2e): traffic route test with default tr policy (#11523)

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>

* chore(backport): fix conflict

Signed-off-by: Marcin Skalski <skalskimarcin33@gmail.com>

---------

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Marcin Skalski <skalskimarcin33@gmail.com>
Co-authored-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Co-authored-by: Marcin Skalski <skalskimarcin33@gmail.com>
  • Loading branch information
3 people authored Oct 3, 2024
1 parent c4ae996 commit 6256c1d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/e2e_env/universal/trafficroute/traffic_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func TrafficRoute() {
BeforeAll(func() {
Expect(NewClusterSetup().
Install(MeshUniversal(meshName)).
Install(TrafficRouteUniversal(meshName)).
Install(TestServerUniversal("dp-echo-1", meshName,
WithArgs([]string{"echo", "--instance", "echo-v1"}),
WithServiceVersion("v1"),
Expand Down
19 changes: 19 additions & 0 deletions test/framework/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,25 @@ func Kuma(mode core.CpMode, opt ...KumaDeploymentOption) InstallFunc {
}
}

func TrafficRouteUniversal(name string) InstallFunc {
tr := fmt.Sprintf(`
type: TrafficRoute
name: route-all-%[1]s
mesh: %[1]s
sources:
- match:
kuma.io/service: '*'
destinations:
- match:
kuma.io/service: '*'
conf:
loadBalancer:
roundRobin: {}
destination:
kuma.io/service: '*'`, name)
return YamlUniversal(tr)
}

func WaitService(namespace, service string) InstallFunc {
return func(c Cluster) error {
k8s.WaitUntilServiceAvailable(c.GetTesting(), c.GetKubectlOptions(namespace), service, 10, 3*time.Second)
Expand Down

0 comments on commit 6256c1d

Please sign in to comment.