diff --git a/xta-adapter/src/test/helm/network_policy_test.yaml b/xta-adapter/src/test/helm/network_policy_test.yaml index 0c21953e21950822c2f58361fd9081a7f0405316..74ac285893aab5f14a2b7abe6e3d5c84fd55033d 100644 --- a/xta-adapter/src/test/helm/network_policy_test.yaml +++ b/xta-adapter/src/test/helm/network_policy_test.yaml @@ -27,19 +27,26 @@ release: namespace: by-helm-test templates: - templates/network_policy.yaml -set: - networkPolicy: - dnsServerNamespace: test-dns-namespace + tests: - it: should match apiVersion + set: + networkPolicy: + dnsServerNamespace: test-dns-namespace asserts: - isAPIVersion: of: networking.k8s.io/v1 - it: should match kind + set: + networkPolicy: + dnsServerNamespace: test-dns-namespace asserts: - isKind: of: NetworkPolicy - it: validate metadata + set: + networkPolicy: + dnsServerNamespace: test-dns-namespace asserts: - equal: path: metadata @@ -47,6 +54,9 @@ tests: name: network-policy-xta-adapter namespace: by-helm-test - it: validate spec + set: + networkPolicy: + dnsServerNamespace: test-dns-namespace asserts: - equal: path: spec @@ -135,6 +145,21 @@ tests: networkPolicy: disabled: false dnsServerNamespace: test-dns-namespace + asserts: + - hasDocuments: + count: 1 + - it: test network policy dnsServerNamespace must be set message + set: + networkPolicy: + disabled: false + asserts: + - failedTemplate: + errorMessage: networkPolicy.dnsServerNamespace must be set + + - it: test network policy should be enabled by default + set: + networkPolicy: + dnsServerNamespace: test-dns-server-namespace asserts: - hasDocuments: count: 1 \ No newline at end of file