Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(e2e): disable meshmtls test with delegated gateway (backport of #12108) #12119

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions test/e2e_env/kubernetes/gateway/delegated.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,53 @@
kicIP, err := kic.From(kubernetes.Cluster).IP(config.Namespace)
Expect(err).ToNot(HaveOccurred())

<<<<<<< HEAD

Check failure on line 99 in test/e2e_env/kubernetes/gateway/delegated.go

View workflow job for this annotation

GitHub Actions / check

expected statement, found '<<' (typecheck)
config.KicIP = kicIP
=======
config.KicIP = kicIP
Expect(DeleteMeshResources(
kubernetes.Cluster,
config.Mesh,
mcb_api.MeshCircuitBreakerResourceTypeDescriptor,
mt_api.MeshTimeoutResourceTypeDescriptor,
mr_api.MeshRetryResourceTypeDescriptor,
)).To(Succeed())
})

E2EAfterAll(func() {
Expect(kubernetes.Cluster.TriggerDeleteNamespace(config.Namespace)).
To(Succeed())
Expect(kubernetes.Cluster.TriggerDeleteNamespace(config.NamespaceOutsideMesh)).
To(Succeed())
Expect(kubernetes.Cluster.DeleteMesh(config.Mesh)).To(Succeed())
Expect(kubernetes.Cluster.DeleteDeployment(config.ObservabilityDeploymentName)).
To(Succeed())
})

// If you copy the test case from a non-gateway test or create a new test,
// remember the the name of policies needs to be unique.
// If they have the same name, one might override the other, causing a flake.
for policyName, test := range testMatrix {
Context(policyName, test)
}
})
}

contextFor("delegated with kuma.io/service", &config, map[string]func(){

Check failure on line 131 in test/e2e_env/kubernetes/gateway/delegated.go

View workflow job for this annotation

GitHub Actions / check

expected declaration, found contextFor (typecheck)
"MeshCircuitBreaker": delegated.CircuitBreaker(&config),
"MeshProxyPatch": delegated.MeshProxyPatch(&config),
"MeshHealthCheck": delegated.MeshHealthCheck(&config),
"MeshRetry": delegated.MeshRetry(&config),
"MeshHTTPRoute": delegated.MeshHTTPRoute(&config),
"MeshTimeout": delegated.MeshTimeout(&config),
"MeshMetric": delegated.MeshMetric(&config),
"MeshTrace": delegated.MeshTrace(&config),
"MeshLoadBalancingStrategy": delegated.MeshLoadBalancingStrategy(&config),
"MeshAccessLog": delegated.MeshAccessLog(&config),
"MeshPassthrough": delegated.MeshPassthrough(&config),
// Matcher for from policy doesn't work for delegated gateway https://github.com/kumahq/kuma/issues/12107
// "MeshTLS": delegated.MeshTLS(&config),
>>>>>>> c542d022d (test(e2e): disable meshmtls test with delegated gateway (#12108))

Check failure on line 145 in test/e2e_env/kubernetes/gateway/delegated.go

View workflow job for this annotation

GitHub Actions / check

illegal character U+0023 '#' (typecheck)
})

E2EAfterAll(func() {
Expand Down
77 changes: 77 additions & 0 deletions test/e2e_env/kubernetes/gateway/delegated/meshtls.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package delegated

import (
"fmt"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/kumahq/kuma/pkg/plugins/policies/meshtls/api/v1alpha1"
"github.com/kumahq/kuma/test/framework"
"github.com/kumahq/kuma/test/framework/client"
"github.com/kumahq/kuma/test/framework/envs/kubernetes"
)

func MeshTLS(config *Config) func() {
GinkgoHelper()

return func() {
meshTls := fmt.Sprintf(`
apiVersion: kuma.io/v1alpha1
kind: MeshTLS
metadata:
name: meshtls-delegated
namespace: %s
labels:
kuma.io/mesh: %s
spec:
targetRef:
kind: Mesh
from:
- targetRef:
kind: Mesh
default:
tlsVersion:
min: TLS13
max: TLS13`, config.CpNamespace, config.Mesh)

framework.AfterEachFailure(func() {

Check failure on line 38 in test/e2e_env/kubernetes/gateway/delegated/meshtls.go

View workflow job for this annotation

GitHub Actions / check

undefined: framework.AfterEachFailure (typecheck)
framework.DebugKube(kubernetes.Cluster, config.Mesh, config.Namespace, config.ObservabilityDeploymentName)

Check failure on line 39 in test/e2e_env/kubernetes/gateway/delegated/meshtls.go

View workflow job for this annotation

GitHub Actions / check

undefined: framework.DebugKube (typecheck)
})

framework.E2EAfterEach(func() {
Expect(framework.DeleteMeshResources(
kubernetes.Cluster,
config.Mesh,
v1alpha1.MeshTLSResourceTypeDescriptor,
)).To(Succeed())
})

XIt("should not break communication once switched to TLS 1.3", func() {
// check that communication to test-server works
Eventually(func(g Gomega) {
_, err := client.CollectEchoResponse(
kubernetes.Cluster,
"demo-client",
fmt.Sprintf("http://%s/test-server", config.KicIP),
client.FromKubernetesPod(config.NamespaceOutsideMesh, "demo-client"),
)
g.Expect(err).ToNot(HaveOccurred())
}, "30s", "1s", MustPassRepeatedly(5)).Should(Succeed())

// change TLS version to 1.3
Expect(framework.YamlK8s(meshTls)(kubernetes.Cluster)).To(Succeed())

// check that communication to test-server works
Eventually(func(g Gomega) {
_, err := client.CollectEchoResponse(
kubernetes.Cluster,
"demo-client",
fmt.Sprintf("http://%s/test-server", config.KicIP),
client.FromKubernetesPod(config.NamespaceOutsideMesh, "demo-client"),
)
g.Expect(err).ToNot(HaveOccurred())
}, "30s", "1s", MustPassRepeatedly(5)).Should(Succeed())
})
}
}
Loading