From ded20e376b07c8a6af1dfcec02d311363a5d714b Mon Sep 17 00:00:00 2001 From: Andrew Kenworthy Date: Fri, 12 Apr 2024 09:54:46 +0200 Subject: [PATCH] tests: added namespace patch for openshift tests --- tests/release.yaml | 2 +- .../kuttl/smoke-nodeport/00-patch-ns.yaml.j2 | 9 +++++++++ ...tenerclass.yaml => 05-create-listenerclass.yaml} | 0 .../{01-assert.yaml => 10-assert.yaml} | 0 ...fulset.yaml => 10-create-nginx-statefulset.yaml} | 0 .../{02-assert.yaml => 20-assert.yaml} | 0 ...=> 20-validate-all-ingresses-are-reachable.yaml} | 0 tests/test-definition.yaml | 13 +++++++++++-- 8 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 tests/templates/kuttl/smoke-nodeport/00-patch-ns.yaml.j2 rename tests/templates/kuttl/smoke-nodeport/{00-create-listenerclass.yaml => 05-create-listenerclass.yaml} (100%) rename tests/templates/kuttl/smoke-nodeport/{01-assert.yaml => 10-assert.yaml} (100%) rename tests/templates/kuttl/smoke-nodeport/{01-create-nginx-statefulset.yaml => 10-create-nginx-statefulset.yaml} (100%) rename tests/templates/kuttl/smoke-nodeport/{02-assert.yaml => 20-assert.yaml} (100%) rename tests/templates/kuttl/smoke-nodeport/{02-validate-all-ingresses-are-reachable.yaml => 20-validate-all-ingresses-are-reachable.yaml} (100%) diff --git a/tests/release.yaml b/tests/release.yaml index d1cafaeb..5fb9c72a 100644 --- a/tests/release.yaml +++ b/tests/release.yaml @@ -1,7 +1,7 @@ # Contains all operators required to run the test suite. --- releases: - # Do not change the name of the release as it's referenced from run_tests.sh + # Do not change the name of the release as it's referenced from run-tests tests: releaseDate: 1970-01-01 description: Integration test diff --git a/tests/templates/kuttl/smoke-nodeport/00-patch-ns.yaml.j2 b/tests/templates/kuttl/smoke-nodeport/00-patch-ns.yaml.j2 new file mode 100644 index 00000000..67185acf --- /dev/null +++ b/tests/templates/kuttl/smoke-nodeport/00-patch-ns.yaml.j2 @@ -0,0 +1,9 @@ +{% if test_scenario['values']['openshift'] == 'true' %} +# see https://github.com/stackabletech/issues/issues/566 +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: kubectl patch namespace $NAMESPACE -p '{"metadata":{"labels":{"pod-security.kubernetes.io/enforce":"privileged"}}}' + timeout: 120 +{% endif %} diff --git a/tests/templates/kuttl/smoke-nodeport/00-create-listenerclass.yaml b/tests/templates/kuttl/smoke-nodeport/05-create-listenerclass.yaml similarity index 100% rename from tests/templates/kuttl/smoke-nodeport/00-create-listenerclass.yaml rename to tests/templates/kuttl/smoke-nodeport/05-create-listenerclass.yaml diff --git a/tests/templates/kuttl/smoke-nodeport/01-assert.yaml b/tests/templates/kuttl/smoke-nodeport/10-assert.yaml similarity index 100% rename from tests/templates/kuttl/smoke-nodeport/01-assert.yaml rename to tests/templates/kuttl/smoke-nodeport/10-assert.yaml diff --git a/tests/templates/kuttl/smoke-nodeport/01-create-nginx-statefulset.yaml b/tests/templates/kuttl/smoke-nodeport/10-create-nginx-statefulset.yaml similarity index 100% rename from tests/templates/kuttl/smoke-nodeport/01-create-nginx-statefulset.yaml rename to tests/templates/kuttl/smoke-nodeport/10-create-nginx-statefulset.yaml diff --git a/tests/templates/kuttl/smoke-nodeport/02-assert.yaml b/tests/templates/kuttl/smoke-nodeport/20-assert.yaml similarity index 100% rename from tests/templates/kuttl/smoke-nodeport/02-assert.yaml rename to tests/templates/kuttl/smoke-nodeport/20-assert.yaml diff --git a/tests/templates/kuttl/smoke-nodeport/02-validate-all-ingresses-are-reachable.yaml b/tests/templates/kuttl/smoke-nodeport/20-validate-all-ingresses-are-reachable.yaml similarity index 100% rename from tests/templates/kuttl/smoke-nodeport/02-validate-all-ingresses-are-reachable.yaml rename to tests/templates/kuttl/smoke-nodeport/20-validate-all-ingresses-are-reachable.yaml diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index 64bd8865..e8a6def3 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -1,7 +1,16 @@ --- -dimensions: [] +dimensions: + - name: openshift + values: + - "false" tests: - name: smoke-nodeport - dimensions: [] + dimensions: + - openshift suites: - name: nightly + - name: openshift + patch: + - dimensions: + - name: openshift + expr: "true"