Skip to content

Commit

Permalink
Update tests after implementation testing
Browse files Browse the repository at this point in the history
conformance/base/manifests.yaml - fix yaml
conformance/tests/backendtlspolicy.yaml - fix yaml
conformance/tests/tlsroute-simple-same-namespace.go - rename cert for sharing
conformance/utils/suite/conformance.go - fix a bug in cleanup-base-resources flag application
conformance/utils/suite/suite.go - rename cert for sharing
  • Loading branch information
candita committed Aug 29, 2024
1 parent c2bb7ec commit 0ad1310
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
4 changes: 2 additions & 2 deletions conformance/base/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ spec:
volumes:
- name: secret-volume
secret:
secretName: tls-passthrough-checks-certificate
secretName: tls-checks-certificate
items:
- key: tls.crt
path: crt
Expand Down Expand Up @@ -763,7 +763,7 @@ spec:
spec:
containers:
- name: backendtlspolicy-test
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20240412-v1.0.0-394-g40c666fd
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20240827-v1.1.0-121-g650e404a
volumeMounts:
- name: secret-volume
mountPath: /etc/secret-volume
Expand Down
26 changes: 24 additions & 2 deletions conformance/tests/backendtlspolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: gateway.networking.k8s.io/v1beta1
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: gateway-backendtlspolicy
Expand All @@ -9,6 +9,12 @@ spec:
- name: https
port: 443
protocol: HTTPS
tls:
mode: Terminate
certificateRefs:
- group: ""
kind: Secret
name: tls-checks-certificate
hostname: "*.example.com"
allowedRoutes:
namespaces:
Expand All @@ -28,7 +34,23 @@ spec:
name: "backendtlspolicy-test"
validation:
caCertificateRefs:
group: ""
- group: ""
kind: Secret
name: "backend-tls-checks-certificate"
hostname: "abc.example.com"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: gateway-conformance-infra-test
namespace: gateway-conformance-infra
spec:
parentRefs:
- name: gateway-backendtlspolicy
namespace: gateway-conformance-infra
hostnames:
- abc.example.com
rules:
- backendRefs:
- name: tls-backend
port: 443
2 changes: 1 addition & 1 deletion conformance/tests/tlsroute-simple-same-namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var TLSRouteSimpleSameNamespace = suite.ConformanceTest{
ns := "gateway-conformance-infra"
routeNN := types.NamespacedName{Name: "gateway-conformance-infra-test", Namespace: ns}
gwNN := types.NamespacedName{Name: "gateway-tlsroute", Namespace: ns}
certNN := types.NamespacedName{Name: "tls-passthrough-checks-certificate", Namespace: ns}
certNN := types.NamespacedName{Name: "tls-checks-certificate", Namespace: ns}

kubernetes.NamespacesMustBeReady(t, suite.Client, suite.TimeoutConfig, []string{ns})

Expand Down
2 changes: 1 addition & 1 deletion conformance/utils/suite/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (test *ConformanceTest) Run(t *testing.T, suite *ConformanceTestSuite) {

for _, manifestLocation := range test.Manifests {
tlog.Logf(t, "Applying %s", manifestLocation)
suite.Applier.MustApplyWithCleanup(t, suite.Client, suite.TimeoutConfig, manifestLocation, true)
suite.Applier.MustApplyWithCleanup(t, suite.Client, suite.TimeoutConfig, manifestLocation, suite.Cleanup)
}

test.Test(t, suite)
Expand Down
2 changes: 1 addition & 1 deletion conformance/utils/suite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ func (suite *ConformanceTestSuite) Setup(t *testing.T, tests []ConformanceTest)
suite.Applier.MustApplyObjectsWithCleanup(t, suite.Client, suite.TimeoutConfig, []client.Object{secret}, suite.Cleanup)
secret = kubernetes.MustCreateSelfSignedCertSecret(t, "gateway-conformance-infra", "tls-validity-checks-certificate", []string{"*", "*.org"})
suite.Applier.MustApplyObjectsWithCleanup(t, suite.Client, suite.TimeoutConfig, []client.Object{secret}, suite.Cleanup)
secret = kubernetes.MustCreateSelfSignedCertSecret(t, "gateway-conformance-infra", "tls-passthrough-checks-certificate", []string{"abc.example.com"})
secret = kubernetes.MustCreateSelfSignedCertSecret(t, "gateway-conformance-infra", "tls-checks-certificate", []string{"abc.example.com"})
suite.Applier.MustApplyObjectsWithCleanup(t, suite.Client, suite.TimeoutConfig, []client.Object{secret}, suite.Cleanup)
secret = kubernetes.MustCreateSelfSignedCertSecret(t, "gateway-conformance-app-backend", "tls-passthrough-checks-certificate", []string{"abc.example.com"})
suite.Applier.MustApplyObjectsWithCleanup(t, suite.Client, suite.TimeoutConfig, []client.Object{secret}, suite.Cleanup)
Expand Down

0 comments on commit 0ad1310

Please sign in to comment.