mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-28 02:18:15 +00:00
test: clean a couple kuttl tests (#6553)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
062bd798f0
commit
9d81549b8a
12 changed files with 10 additions and 72 deletions
|
@ -1,4 +0,0 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- command: kubectl delete -f 01-manifests.yaml,02-goodpod.yaml --force --wait=true --ignore-not-found=true
|
|
@ -1,6 +0,0 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- command: kubectl delete pod nginx -n test-validate --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete cpol deny-evict-by-pod-label -n test-validate --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete ns test-validate --force --ignore-not-found=true
|
|
@ -1,6 +0,0 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- command: kubectl delete pod nginx -n test-validate --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete cpol deny-exec-by-pod-label -n test-validate --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete ns test-validate --force --ignore-not-found=true
|
|
@ -1,7 +0,0 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- command: kubectl delete deploy nginx-test -n test-validate --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete polex allow-scaling-nginx-test -n test-validate --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete cpol nginx-test-scaling-policy -n test-validate --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete ns test-validate --force --ignore-not-found=true
|
|
@ -0,0 +1,5 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
apply:
|
||||
- file: resource.yaml
|
||||
shouldFail: true
|
|
@ -1,14 +0,0 @@
|
|||
## Checks that the manifests.yaml file CANNOT be successfully created. If it can, fail the test as this is incorrect.
|
||||
|
||||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- script: |
|
||||
if kubectl apply -f resource.yaml
|
||||
then
|
||||
echo "Tested failed. Resource was allowed."
|
||||
exit 1
|
||||
else
|
||||
echo "Test succeeded. Resource was blocked."
|
||||
exit 0
|
||||
fi
|
|
@ -1,4 +0,0 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- command: kubectl delete -f 01-manifests.yaml --force --wait=true --ignore-not-found=true
|
|
@ -1,6 +0,0 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- command: kubectl delete deploy nginx-test -n test-validate --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete cpol nginx-test-scaling-policy -n test-validate --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete ns test-validate --force --ignore-not-found=true
|
|
@ -1,6 +0,0 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- command: kubectl delete ConfigMap test-configmap -n test-validate-e2e-adding-key-to-config-map --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete pol configmap-policy -n test-validate-e2e-adding-key-to-config-map --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete ns test-validate-e2e-adding-key-to-config-map --force --ignore-not-found=true
|
|
@ -0,0 +1,5 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
apply:
|
||||
- file: resource.yaml
|
||||
shouldFail: true
|
|
@ -1,12 +0,0 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- script: |
|
||||
if kubectl apply -f resource.yaml 2>&1 | grep -q 'validation error: The label app=foo is required'
|
||||
then
|
||||
echo "Test succeeded. Resource creation was blocked."
|
||||
exit 0
|
||||
else
|
||||
echo "Tested failed. Resource was created."
|
||||
exit 1
|
||||
fi
|
|
@ -1,7 +0,0 @@
|
|||
apiVersion: kuttl.dev/v1beta1
|
||||
kind: TestStep
|
||||
commands:
|
||||
- command: kubectl delete postgresql acid-minimal-cluster -n test-validate --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete cpol test --force --wait=true --ignore-not-found=true
|
||||
- command: kubectl delete ns test-validate --force --ignore-not-found=true
|
||||
- command: kubectl delete crd postgresqls.acid.zalan.do --force --wait=true
|
Loading…
Add table
Reference in a new issue