Skip to content
Snippets Groups Projects
Commit 36e75f0d authored by OZG-Cloud Team's avatar OZG-Cloud Team
Browse files

OZG-6105 add netpol required values unittests xta-adapter

parent 8f48d005
No related branches found
No related tags found
No related merge requests found
...@@ -27,19 +27,26 @@ release: ...@@ -27,19 +27,26 @@ release:
namespace: by-helm-test namespace: by-helm-test
templates: templates:
- templates/network_policy.yaml - templates/network_policy.yaml
set:
networkPolicy:
dnsServerNamespace: test-dns-namespace
tests: tests:
- it: should match apiVersion - it: should match apiVersion
set:
networkPolicy:
dnsServerNamespace: test-dns-namespace
asserts: asserts:
- isAPIVersion: - isAPIVersion:
of: networking.k8s.io/v1 of: networking.k8s.io/v1
- it: should match kind - it: should match kind
set:
networkPolicy:
dnsServerNamespace: test-dns-namespace
asserts: asserts:
- isKind: - isKind:
of: NetworkPolicy of: NetworkPolicy
- it: validate metadata - it: validate metadata
set:
networkPolicy:
dnsServerNamespace: test-dns-namespace
asserts: asserts:
- equal: - equal:
path: metadata path: metadata
...@@ -47,6 +54,9 @@ tests: ...@@ -47,6 +54,9 @@ tests:
name: network-policy-xta-adapter name: network-policy-xta-adapter
namespace: by-helm-test namespace: by-helm-test
- it: validate spec - it: validate spec
set:
networkPolicy:
dnsServerNamespace: test-dns-namespace
asserts: asserts:
- equal: - equal:
path: spec path: spec
...@@ -135,6 +145,21 @@ tests: ...@@ -135,6 +145,21 @@ tests:
networkPolicy: networkPolicy:
disabled: false disabled: false
dnsServerNamespace: test-dns-namespace 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: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment