From 3aa6c0d73c7005d629da95589e25d22c165346b9 Mon Sep 17 00:00:00 2001 From: Simon Beck Date: Wed, 8 Jan 2025 10:30:40 +0100 Subject: [PATCH] Make e2e more robust Some of the statusfields in the status object will never actually become true, even thought the instance comes up correctly. These status fields are deprecated and we have proper replacements for them. However Redis hasn't yet been migrated to comp functions. So for now we don't assert these fields anymore to make sure the e2e tests work again. Other changes: - Make sure to remove any old claims before running - Leave more spaces between the test names, so we don't have to rename all if we want to add one in between - Make maintenance script sturdier --- tests/e2e/keycloak/00-install.yaml | 3 +++ tests/e2e/keycloak/01-delete.yaml | 14 ++++++++++++++ .../keycloak/{00-assert.yaml => 10-assert.yaml} | 0 .../keycloak/{01-connect.yaml => 10-connect.yaml} | 0 tests/e2e/keycloak/10-install.yaml | 10 ++++++++++ .../keycloak/{01-assert.yaml => 20-assert.yaml} | 0 ...k-protection.yaml => 20-check-protection.yaml} | 0 ...3-check-ingress.yaml => 40-check-ingress.yaml} | 0 .../keycloak/{04-assert.yaml => 50-assert.yaml} | 0 .../keycloak/{04-install.yaml => 50-install.yaml} | 0 tests/e2e/kuttl-test.yaml | 2 +- tests/e2e/mariadb/00-install.yaml | 4 +++- tests/e2e/mariadb/01-delete.yaml | 14 ++++++++++++++ .../mariadb/{00-assert.yaml => 10-assert.yaml} | 0 tests/e2e/mariadb/10-install.yaml | 11 +++++++++++ .../mariadb/{01-assert.yaml => 20-assert.yaml} | 0 .../mariadb/{01-connect.yaml => 20-connect.yaml} | 0 .../mariadb/{02-assert.yaml => 30-assert.yaml} | 0 ...k-protection.yaml => 30-check-protection.yaml} | 0 .../mariadb/{02-install.yaml => 30-install.yaml} | 0 .../mariadb/{03-assert.yaml => 40-assert.yaml} | 0 .../mariadb/{03-install.yaml => 40-install.yaml} | 0 .../e2e/mariadb/{03-sleep.yaml => 40-sleep.yaml} | 0 .../mariadb/{04-assert.yaml => 50-assert.yaml} | 0 .../mariadb/{04-connect.yaml => 50-connect.yaml} | 0 .../mariadb/{04-install.yaml => 50-install.yaml} | 0 tests/e2e/nextcloud/00-install.yaml | 2 ++ tests/e2e/nextcloud/01-delete.yaml | 13 +++++++++++++ .../nextcloud/{00-assert.yaml => 10-assert.yaml} | 0 tests/e2e/nextcloud/10-install.yaml | 11 +++++++++++ .../nextcloud/{01-assert.yaml => 20-assert.yaml} | 0 .../{01-connect.yaml => 20-connect.yaml} | 0 ...k-protection.yaml => 30-check-protection.yaml} | 0 ...3-check-ingress.yaml => 40-check-ingress.yaml} | 0 .../nextcloud/{04-assert.yaml => 50-assert.yaml} | 0 .../{04-install.yaml => 50-install.yaml} | 0 tests/e2e/postgresql/00-install.yaml | 2 ++ .../postgresql/{99-delete.yaml => 01-delete.yaml} | 0 .../postgresql/{00-assert.yaml => 10-assert.yaml} | 0 .../{03-install.yaml => 10-install.yaml} | 4 ++-- .../{02-assert.yaml => 100-assert.yaml} | 0 .../{02-connect.yaml => 100-connect.yaml} | 0 .../{02-install.yaml => 100-install.yaml} | 0 .../{09-assert.yaml => 110-assert.yaml} | 0 .../{09-install.yaml => 110-install.yaml} | 0 ...k-protection.yaml => 20-check-protection.yaml} | 0 .../{04-validate.yaml => 30-validate.yaml} | 0 .../postgresql/{05-assert.yaml => 40-assert.yaml} | 0 .../{05-install.yaml => 40-install.yaml} | 0 .../{06-validate.yaml => 50-validate.yaml} | 0 .../postgresql/{07-assert.yaml => 60-assert.yaml} | 0 .../{07-install.yaml => 60-install.yaml} | 0 .../{08-validate.yaml => 70-validate.yaml} | 0 .../{03-assert.yaml => 80-assert.yaml.yaml} | 4 ++-- tests/e2e/postgresql/80-install.yaml | 15 +++++++++++++++ tests/e2e/postgresql/999-delete.yaml | 14 ++++++++++++++ .../e2e/postgresql/scripts/trigger-maintenance.sh | 8 ++++---- tests/e2e/redis/00-install.yaml | 2 ++ tests/e2e/redis/01-delete.yaml | 14 ++++++++++++++ .../e2e/redis/{00-assert.yaml => 10-assert.yaml} | 15 --------------- tests/e2e/redis/10-install.yaml | 10 ++++++++++ .../e2e/redis/{01-assert.yaml => 20-assert.yaml} | 0 .../redis/{01-connect.yaml => 20-connect.yaml} | 0 ...k-protection.yaml => 30-check-protection.yaml} | 0 .../redis/{03-install.yaml => 40-install.yaml} | 0 .../e2e/redis/{04-assert.yaml => 50-assert.yaml} | 15 --------------- 66 files changed, 147 insertions(+), 40 deletions(-) create mode 100644 tests/e2e/keycloak/01-delete.yaml rename tests/e2e/keycloak/{00-assert.yaml => 10-assert.yaml} (100%) rename tests/e2e/keycloak/{01-connect.yaml => 10-connect.yaml} (100%) create mode 100644 tests/e2e/keycloak/10-install.yaml rename tests/e2e/keycloak/{01-assert.yaml => 20-assert.yaml} (100%) rename tests/e2e/keycloak/{02-check-protection.yaml => 20-check-protection.yaml} (100%) rename tests/e2e/keycloak/{03-check-ingress.yaml => 40-check-ingress.yaml} (100%) rename tests/e2e/keycloak/{04-assert.yaml => 50-assert.yaml} (100%) rename tests/e2e/keycloak/{04-install.yaml => 50-install.yaml} (100%) create mode 100644 tests/e2e/mariadb/01-delete.yaml rename tests/e2e/mariadb/{00-assert.yaml => 10-assert.yaml} (100%) create mode 100644 tests/e2e/mariadb/10-install.yaml rename tests/e2e/mariadb/{01-assert.yaml => 20-assert.yaml} (100%) rename tests/e2e/mariadb/{01-connect.yaml => 20-connect.yaml} (100%) rename tests/e2e/mariadb/{02-assert.yaml => 30-assert.yaml} (100%) rename tests/e2e/mariadb/{02-check-protection.yaml => 30-check-protection.yaml} (100%) rename tests/e2e/mariadb/{02-install.yaml => 30-install.yaml} (100%) rename tests/e2e/mariadb/{03-assert.yaml => 40-assert.yaml} (100%) rename tests/e2e/mariadb/{03-install.yaml => 40-install.yaml} (100%) rename tests/e2e/mariadb/{03-sleep.yaml => 40-sleep.yaml} (100%) rename tests/e2e/mariadb/{04-assert.yaml => 50-assert.yaml} (100%) rename tests/e2e/mariadb/{04-connect.yaml => 50-connect.yaml} (100%) rename tests/e2e/mariadb/{04-install.yaml => 50-install.yaml} (100%) create mode 100644 tests/e2e/nextcloud/01-delete.yaml rename tests/e2e/nextcloud/{00-assert.yaml => 10-assert.yaml} (100%) create mode 100644 tests/e2e/nextcloud/10-install.yaml rename tests/e2e/nextcloud/{01-assert.yaml => 20-assert.yaml} (100%) rename tests/e2e/nextcloud/{01-connect.yaml => 20-connect.yaml} (100%) rename tests/e2e/nextcloud/{02-check-protection.yaml => 30-check-protection.yaml} (100%) rename tests/e2e/nextcloud/{03-check-ingress.yaml => 40-check-ingress.yaml} (100%) rename tests/e2e/nextcloud/{04-assert.yaml => 50-assert.yaml} (100%) rename tests/e2e/nextcloud/{04-install.yaml => 50-install.yaml} (100%) rename tests/e2e/postgresql/{99-delete.yaml => 01-delete.yaml} (100%) rename tests/e2e/postgresql/{00-assert.yaml => 10-assert.yaml} (100%) rename tests/e2e/postgresql/{03-install.yaml => 10-install.yaml} (100%) rename tests/e2e/postgresql/{02-assert.yaml => 100-assert.yaml} (100%) rename tests/e2e/postgresql/{02-connect.yaml => 100-connect.yaml} (100%) rename tests/e2e/postgresql/{02-install.yaml => 100-install.yaml} (100%) rename tests/e2e/postgresql/{09-assert.yaml => 110-assert.yaml} (100%) rename tests/e2e/postgresql/{09-install.yaml => 110-install.yaml} (100%) rename tests/e2e/postgresql/{01-check-protection.yaml => 20-check-protection.yaml} (100%) rename tests/e2e/postgresql/{04-validate.yaml => 30-validate.yaml} (100%) rename tests/e2e/postgresql/{05-assert.yaml => 40-assert.yaml} (100%) rename tests/e2e/postgresql/{05-install.yaml => 40-install.yaml} (100%) rename tests/e2e/postgresql/{06-validate.yaml => 50-validate.yaml} (100%) rename tests/e2e/postgresql/{07-assert.yaml => 60-assert.yaml} (100%) rename tests/e2e/postgresql/{07-install.yaml => 60-install.yaml} (100%) rename tests/e2e/postgresql/{08-validate.yaml => 70-validate.yaml} (100%) rename tests/e2e/postgresql/{03-assert.yaml => 80-assert.yaml.yaml} (94%) create mode 100644 tests/e2e/postgresql/80-install.yaml create mode 100644 tests/e2e/postgresql/999-delete.yaml create mode 100644 tests/e2e/redis/01-delete.yaml rename tests/e2e/redis/{00-assert.yaml => 10-assert.yaml} (75%) create mode 100644 tests/e2e/redis/10-install.yaml rename tests/e2e/redis/{01-assert.yaml => 20-assert.yaml} (100%) rename tests/e2e/redis/{01-connect.yaml => 20-connect.yaml} (100%) rename tests/e2e/redis/{02-check-protection.yaml => 30-check-protection.yaml} (100%) rename tests/e2e/redis/{03-install.yaml => 40-install.yaml} (100%) rename tests/e2e/redis/{04-assert.yaml => 50-assert.yaml} (75%) diff --git a/tests/e2e/keycloak/00-install.yaml b/tests/e2e/keycloak/00-install.yaml index 5c1a5993d..ce9baac74 100644 --- a/tests/e2e/keycloak/00-install.yaml +++ b/tests/e2e/keycloak/00-install.yaml @@ -1,3 +1,4 @@ +# Install with disabled protection apiVersion: vshn.appcat.vshn.io/v1 kind: VSHNKeycloak metadata: @@ -6,5 +7,7 @@ spec: parameters: service: fqdn: keycloak-e2e.example.com + security: + deletionProtection: false writeConnectionSecretToRef: name: keycloak-e2e diff --git a/tests/e2e/keycloak/01-delete.yaml b/tests/e2e/keycloak/01-delete.yaml new file mode 100644 index 000000000..6b38d5e58 --- /dev/null +++ b/tests/e2e/keycloak/01-delete.yaml @@ -0,0 +1,14 @@ +# Remove any leftover objects +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +delete: + - apiVersion: vshn.appcat.vshn.io/v1 + kind: VSHNKeycloak + name: keycloak-e2e + - apiVersion: batch/v1 + kind: Job + name: connect-keycloak-e2e + - apiVersion: v1 + kind: Pod + labels: + e2e-test: keycloak-e2e diff --git a/tests/e2e/keycloak/00-assert.yaml b/tests/e2e/keycloak/10-assert.yaml similarity index 100% rename from tests/e2e/keycloak/00-assert.yaml rename to tests/e2e/keycloak/10-assert.yaml diff --git a/tests/e2e/keycloak/01-connect.yaml b/tests/e2e/keycloak/10-connect.yaml similarity index 100% rename from tests/e2e/keycloak/01-connect.yaml rename to tests/e2e/keycloak/10-connect.yaml diff --git a/tests/e2e/keycloak/10-install.yaml b/tests/e2e/keycloak/10-install.yaml new file mode 100644 index 000000000..5c1a5993d --- /dev/null +++ b/tests/e2e/keycloak/10-install.yaml @@ -0,0 +1,10 @@ +apiVersion: vshn.appcat.vshn.io/v1 +kind: VSHNKeycloak +metadata: + name: keycloak-e2e +spec: + parameters: + service: + fqdn: keycloak-e2e.example.com + writeConnectionSecretToRef: + name: keycloak-e2e diff --git a/tests/e2e/keycloak/01-assert.yaml b/tests/e2e/keycloak/20-assert.yaml similarity index 100% rename from tests/e2e/keycloak/01-assert.yaml rename to tests/e2e/keycloak/20-assert.yaml diff --git a/tests/e2e/keycloak/02-check-protection.yaml b/tests/e2e/keycloak/20-check-protection.yaml similarity index 100% rename from tests/e2e/keycloak/02-check-protection.yaml rename to tests/e2e/keycloak/20-check-protection.yaml diff --git a/tests/e2e/keycloak/03-check-ingress.yaml b/tests/e2e/keycloak/40-check-ingress.yaml similarity index 100% rename from tests/e2e/keycloak/03-check-ingress.yaml rename to tests/e2e/keycloak/40-check-ingress.yaml diff --git a/tests/e2e/keycloak/04-assert.yaml b/tests/e2e/keycloak/50-assert.yaml similarity index 100% rename from tests/e2e/keycloak/04-assert.yaml rename to tests/e2e/keycloak/50-assert.yaml diff --git a/tests/e2e/keycloak/04-install.yaml b/tests/e2e/keycloak/50-install.yaml similarity index 100% rename from tests/e2e/keycloak/04-install.yaml rename to tests/e2e/keycloak/50-install.yaml diff --git a/tests/e2e/kuttl-test.yaml b/tests/e2e/kuttl-test.yaml index d41381dea..a3fb96108 100644 --- a/tests/e2e/kuttl-test.yaml +++ b/tests/e2e/kuttl-test.yaml @@ -3,4 +3,4 @@ kind: TestSuite testDirs: - ./test/e2e/ namespace: appcat-e2e -parallel: 1 +parallel: 2 diff --git a/tests/e2e/mariadb/00-install.yaml b/tests/e2e/mariadb/00-install.yaml index 87ede7c00..9658629c2 100644 --- a/tests/e2e/mariadb/00-install.yaml +++ b/tests/e2e/mariadb/00-install.yaml @@ -4,7 +4,9 @@ metadata: name: mariadb-e2e spec: parameters: - service: + instances: 3 + security: + deletionProtection: false size: plan: standard-2 writeConnectionSecretToRef: diff --git a/tests/e2e/mariadb/01-delete.yaml b/tests/e2e/mariadb/01-delete.yaml new file mode 100644 index 000000000..d1bcb6521 --- /dev/null +++ b/tests/e2e/mariadb/01-delete.yaml @@ -0,0 +1,14 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +delete: + # This will wait until resources are really gone + - apiVersion: batch/v1 + kind: Job + name: connect-mariadb + - apiVersion: v1 + kind: Pod + labels: + e2e-test: mariadb + - apiVersion: vshn.appcat.vshn.io/v1 + kind: VSHNMariaDB + name: mariadb-e2e diff --git a/tests/e2e/mariadb/00-assert.yaml b/tests/e2e/mariadb/10-assert.yaml similarity index 100% rename from tests/e2e/mariadb/00-assert.yaml rename to tests/e2e/mariadb/10-assert.yaml diff --git a/tests/e2e/mariadb/10-install.yaml b/tests/e2e/mariadb/10-install.yaml new file mode 100644 index 000000000..87ede7c00 --- /dev/null +++ b/tests/e2e/mariadb/10-install.yaml @@ -0,0 +1,11 @@ +apiVersion: vshn.appcat.vshn.io/v1 +kind: VSHNMariaDB +metadata: + name: mariadb-e2e +spec: + parameters: + service: + size: + plan: standard-2 + writeConnectionSecretToRef: + name: mariadb-creds diff --git a/tests/e2e/mariadb/01-assert.yaml b/tests/e2e/mariadb/20-assert.yaml similarity index 100% rename from tests/e2e/mariadb/01-assert.yaml rename to tests/e2e/mariadb/20-assert.yaml diff --git a/tests/e2e/mariadb/01-connect.yaml b/tests/e2e/mariadb/20-connect.yaml similarity index 100% rename from tests/e2e/mariadb/01-connect.yaml rename to tests/e2e/mariadb/20-connect.yaml diff --git a/tests/e2e/mariadb/02-assert.yaml b/tests/e2e/mariadb/30-assert.yaml similarity index 100% rename from tests/e2e/mariadb/02-assert.yaml rename to tests/e2e/mariadb/30-assert.yaml diff --git a/tests/e2e/mariadb/02-check-protection.yaml b/tests/e2e/mariadb/30-check-protection.yaml similarity index 100% rename from tests/e2e/mariadb/02-check-protection.yaml rename to tests/e2e/mariadb/30-check-protection.yaml diff --git a/tests/e2e/mariadb/02-install.yaml b/tests/e2e/mariadb/30-install.yaml similarity index 100% rename from tests/e2e/mariadb/02-install.yaml rename to tests/e2e/mariadb/30-install.yaml diff --git a/tests/e2e/mariadb/03-assert.yaml b/tests/e2e/mariadb/40-assert.yaml similarity index 100% rename from tests/e2e/mariadb/03-assert.yaml rename to tests/e2e/mariadb/40-assert.yaml diff --git a/tests/e2e/mariadb/03-install.yaml b/tests/e2e/mariadb/40-install.yaml similarity index 100% rename from tests/e2e/mariadb/03-install.yaml rename to tests/e2e/mariadb/40-install.yaml diff --git a/tests/e2e/mariadb/03-sleep.yaml b/tests/e2e/mariadb/40-sleep.yaml similarity index 100% rename from tests/e2e/mariadb/03-sleep.yaml rename to tests/e2e/mariadb/40-sleep.yaml diff --git a/tests/e2e/mariadb/04-assert.yaml b/tests/e2e/mariadb/50-assert.yaml similarity index 100% rename from tests/e2e/mariadb/04-assert.yaml rename to tests/e2e/mariadb/50-assert.yaml diff --git a/tests/e2e/mariadb/04-connect.yaml b/tests/e2e/mariadb/50-connect.yaml similarity index 100% rename from tests/e2e/mariadb/04-connect.yaml rename to tests/e2e/mariadb/50-connect.yaml diff --git a/tests/e2e/mariadb/04-install.yaml b/tests/e2e/mariadb/50-install.yaml similarity index 100% rename from tests/e2e/mariadb/04-install.yaml rename to tests/e2e/mariadb/50-install.yaml diff --git a/tests/e2e/nextcloud/00-install.yaml b/tests/e2e/nextcloud/00-install.yaml index ebe0e2853..e0a5f1166 100644 --- a/tests/e2e/nextcloud/00-install.yaml +++ b/tests/e2e/nextcloud/00-install.yaml @@ -7,5 +7,7 @@ spec: service: fqdn: - nextcloud-e2e.example.com + security: + deletionProtection: false writeConnectionSecretToRef: name: nextcloud-e2e diff --git a/tests/e2e/nextcloud/01-delete.yaml b/tests/e2e/nextcloud/01-delete.yaml new file mode 100644 index 000000000..c69951600 --- /dev/null +++ b/tests/e2e/nextcloud/01-delete.yaml @@ -0,0 +1,13 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +delete: + - apiVersion: vshn.appcat.vshn.io/v1 + kind: VSHNNextcloud + name: nextcloud-e2e + - apiVersion: batch/v1 + kind: Job + name: connect-nextcloud-e2e + - apiVersion: v1 + kind: Pod + labels: + e2e-test: nextcloud-e2e diff --git a/tests/e2e/nextcloud/00-assert.yaml b/tests/e2e/nextcloud/10-assert.yaml similarity index 100% rename from tests/e2e/nextcloud/00-assert.yaml rename to tests/e2e/nextcloud/10-assert.yaml diff --git a/tests/e2e/nextcloud/10-install.yaml b/tests/e2e/nextcloud/10-install.yaml new file mode 100644 index 000000000..ebe0e2853 --- /dev/null +++ b/tests/e2e/nextcloud/10-install.yaml @@ -0,0 +1,11 @@ +apiVersion: vshn.appcat.vshn.io/v1 +kind: VSHNNextcloud +metadata: + name: nextcloud-e2e +spec: + parameters: + service: + fqdn: + - nextcloud-e2e.example.com + writeConnectionSecretToRef: + name: nextcloud-e2e diff --git a/tests/e2e/nextcloud/01-assert.yaml b/tests/e2e/nextcloud/20-assert.yaml similarity index 100% rename from tests/e2e/nextcloud/01-assert.yaml rename to tests/e2e/nextcloud/20-assert.yaml diff --git a/tests/e2e/nextcloud/01-connect.yaml b/tests/e2e/nextcloud/20-connect.yaml similarity index 100% rename from tests/e2e/nextcloud/01-connect.yaml rename to tests/e2e/nextcloud/20-connect.yaml diff --git a/tests/e2e/nextcloud/02-check-protection.yaml b/tests/e2e/nextcloud/30-check-protection.yaml similarity index 100% rename from tests/e2e/nextcloud/02-check-protection.yaml rename to tests/e2e/nextcloud/30-check-protection.yaml diff --git a/tests/e2e/nextcloud/03-check-ingress.yaml b/tests/e2e/nextcloud/40-check-ingress.yaml similarity index 100% rename from tests/e2e/nextcloud/03-check-ingress.yaml rename to tests/e2e/nextcloud/40-check-ingress.yaml diff --git a/tests/e2e/nextcloud/04-assert.yaml b/tests/e2e/nextcloud/50-assert.yaml similarity index 100% rename from tests/e2e/nextcloud/04-assert.yaml rename to tests/e2e/nextcloud/50-assert.yaml diff --git a/tests/e2e/nextcloud/04-install.yaml b/tests/e2e/nextcloud/50-install.yaml similarity index 100% rename from tests/e2e/nextcloud/04-install.yaml rename to tests/e2e/nextcloud/50-install.yaml diff --git a/tests/e2e/postgresql/00-install.yaml b/tests/e2e/postgresql/00-install.yaml index 54d10044e..8c3fafb5c 100644 --- a/tests/e2e/postgresql/00-install.yaml +++ b/tests/e2e/postgresql/00-install.yaml @@ -4,6 +4,8 @@ metadata: name: postgresql-e2e-test spec: parameters: + security: + deletionProtection: false service: vacuumEnabled: true repackEnabled: true diff --git a/tests/e2e/postgresql/99-delete.yaml b/tests/e2e/postgresql/01-delete.yaml similarity index 100% rename from tests/e2e/postgresql/99-delete.yaml rename to tests/e2e/postgresql/01-delete.yaml diff --git a/tests/e2e/postgresql/00-assert.yaml b/tests/e2e/postgresql/10-assert.yaml similarity index 100% rename from tests/e2e/postgresql/00-assert.yaml rename to tests/e2e/postgresql/10-assert.yaml diff --git a/tests/e2e/postgresql/03-install.yaml b/tests/e2e/postgresql/10-install.yaml similarity index 100% rename from tests/e2e/postgresql/03-install.yaml rename to tests/e2e/postgresql/10-install.yaml index 2b541f22f..54d10044e 100644 --- a/tests/e2e/postgresql/03-install.yaml +++ b/tests/e2e/postgresql/10-install.yaml @@ -4,10 +4,10 @@ metadata: name: postgresql-e2e-test spec: parameters: - size: - plan: standard-2 service: vacuumEnabled: true repackEnabled: true + size: + plan: standard-2 writeConnectionSecretToRef: name: postgresql-e2e-test-creds diff --git a/tests/e2e/postgresql/02-assert.yaml b/tests/e2e/postgresql/100-assert.yaml similarity index 100% rename from tests/e2e/postgresql/02-assert.yaml rename to tests/e2e/postgresql/100-assert.yaml diff --git a/tests/e2e/postgresql/02-connect.yaml b/tests/e2e/postgresql/100-connect.yaml similarity index 100% rename from tests/e2e/postgresql/02-connect.yaml rename to tests/e2e/postgresql/100-connect.yaml diff --git a/tests/e2e/postgresql/02-install.yaml b/tests/e2e/postgresql/100-install.yaml similarity index 100% rename from tests/e2e/postgresql/02-install.yaml rename to tests/e2e/postgresql/100-install.yaml diff --git a/tests/e2e/postgresql/09-assert.yaml b/tests/e2e/postgresql/110-assert.yaml similarity index 100% rename from tests/e2e/postgresql/09-assert.yaml rename to tests/e2e/postgresql/110-assert.yaml diff --git a/tests/e2e/postgresql/09-install.yaml b/tests/e2e/postgresql/110-install.yaml similarity index 100% rename from tests/e2e/postgresql/09-install.yaml rename to tests/e2e/postgresql/110-install.yaml diff --git a/tests/e2e/postgresql/01-check-protection.yaml b/tests/e2e/postgresql/20-check-protection.yaml similarity index 100% rename from tests/e2e/postgresql/01-check-protection.yaml rename to tests/e2e/postgresql/20-check-protection.yaml diff --git a/tests/e2e/postgresql/04-validate.yaml b/tests/e2e/postgresql/30-validate.yaml similarity index 100% rename from tests/e2e/postgresql/04-validate.yaml rename to tests/e2e/postgresql/30-validate.yaml diff --git a/tests/e2e/postgresql/05-assert.yaml b/tests/e2e/postgresql/40-assert.yaml similarity index 100% rename from tests/e2e/postgresql/05-assert.yaml rename to tests/e2e/postgresql/40-assert.yaml diff --git a/tests/e2e/postgresql/05-install.yaml b/tests/e2e/postgresql/40-install.yaml similarity index 100% rename from tests/e2e/postgresql/05-install.yaml rename to tests/e2e/postgresql/40-install.yaml diff --git a/tests/e2e/postgresql/06-validate.yaml b/tests/e2e/postgresql/50-validate.yaml similarity index 100% rename from tests/e2e/postgresql/06-validate.yaml rename to tests/e2e/postgresql/50-validate.yaml diff --git a/tests/e2e/postgresql/07-assert.yaml b/tests/e2e/postgresql/60-assert.yaml similarity index 100% rename from tests/e2e/postgresql/07-assert.yaml rename to tests/e2e/postgresql/60-assert.yaml diff --git a/tests/e2e/postgresql/07-install.yaml b/tests/e2e/postgresql/60-install.yaml similarity index 100% rename from tests/e2e/postgresql/07-install.yaml rename to tests/e2e/postgresql/60-install.yaml diff --git a/tests/e2e/postgresql/08-validate.yaml b/tests/e2e/postgresql/70-validate.yaml similarity index 100% rename from tests/e2e/postgresql/08-validate.yaml rename to tests/e2e/postgresql/70-validate.yaml diff --git a/tests/e2e/postgresql/03-assert.yaml b/tests/e2e/postgresql/80-assert.yaml.yaml similarity index 94% rename from tests/e2e/postgresql/03-assert.yaml rename to tests/e2e/postgresql/80-assert.yaml.yaml index 85e7b6d12..717f5ac69 100644 --- a/tests/e2e/postgresql/03-assert.yaml +++ b/tests/e2e/postgresql/80-assert.yaml.yaml @@ -19,10 +19,10 @@ spec: retention: 6 instances: 1 security: - deletionProtection: true + deletionProtection: false service: vacuumEnabled: true - repackEnabled: true + repackEnabled: false majorVersion: "15" serviceLevel: besteffort size: diff --git a/tests/e2e/postgresql/80-install.yaml b/tests/e2e/postgresql/80-install.yaml new file mode 100644 index 000000000..ed7a728df --- /dev/null +++ b/tests/e2e/postgresql/80-install.yaml @@ -0,0 +1,15 @@ +apiVersion: vshn.appcat.vshn.io/v1 +kind: VSHNPostgreSQL +metadata: + name: postgresql-e2e-test +spec: + parameters: + size: + plan: standard-2 + security: + deletionProtection: false + service: + vacuumEnabled: true + repackEnabled: false + writeConnectionSecretToRef: + name: postgresql-e2e-test-creds diff --git a/tests/e2e/postgresql/999-delete.yaml b/tests/e2e/postgresql/999-delete.yaml new file mode 100644 index 000000000..a545465ec --- /dev/null +++ b/tests/e2e/postgresql/999-delete.yaml @@ -0,0 +1,14 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +delete: + # This will wait until resources are really gone + - apiVersion: batch/v1 + kind: Job + name: connect-postgresql + - apiVersion: v1 + kind: Pod + labels: + e2e-test: postgresql + - apiVersion: vshn.appcat.vshn.io/v1 + kind: VSHNPostgreSQL + name: postgresql-e2e-test diff --git a/tests/e2e/postgresql/scripts/trigger-maintenance.sh b/tests/e2e/postgresql/scripts/trigger-maintenance.sh index 40702e6ee..8e1db1028 100755 --- a/tests/e2e/postgresql/scripts/trigger-maintenance.sh +++ b/tests/e2e/postgresql/scripts/trigger-maintenance.sh @@ -57,16 +57,16 @@ kubectl -n "$ns" wait --for=condition=complete --timeout=1000s job/test # I have to wait for job/jobs completion otherwise stackgres will recreate that even if I delete it... if [ "$to_be_found" == "r" ]; then kubectl -n "$ns" get job - kubectl -n "$ns" get job databasesrepack + kubectl -n "$ns" wait --for=create job/databasesrepack kubectl -n "$ns" wait --for=condition=complete --timeout=1000s job/databasesrepack elif [ "$to_be_found" == "v" ]; then kubectl -n "$ns" get job - kubectl -n "$ns" get job vacuum + kubectl -n "$ns" wait --for=create job/vacuum kubectl -n "$ns" wait --for=condition=complete --timeout=1000s job/vacuum elif [ "$to_be_found" == "b" ]; then kubectl -n "$ns" get job - kubectl -n "$ns" get job databasesrepack - kubectl -n "$ns" get job vacuum + kubectl -n "$ns" wait --for=create job/databasesrepack + kubectl -n "$ns" wait --for=create job/vacuum kubectl -n "$ns" wait --for=condition=complete --timeout=1000s job/databasesrepack kubectl -n "$ns" wait --for=condition=complete --timeout=1000s job/vacuum else diff --git a/tests/e2e/redis/00-install.yaml b/tests/e2e/redis/00-install.yaml index 4585b08c4..d9b04dfec 100644 --- a/tests/e2e/redis/00-install.yaml +++ b/tests/e2e/redis/00-install.yaml @@ -4,6 +4,8 @@ metadata: name: redis-e2e-test spec: parameters: + security: + deletionProtection: false size: plan: standard-2 writeConnectionSecretToRef: diff --git a/tests/e2e/redis/01-delete.yaml b/tests/e2e/redis/01-delete.yaml new file mode 100644 index 000000000..f061f5b32 --- /dev/null +++ b/tests/e2e/redis/01-delete.yaml @@ -0,0 +1,14 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +delete: + # This will wait until resources are really gone + - apiVersion: batch/v1 + kind: Job + name: connect-redis + - apiVersion: v1 + kind: Pod + labels: + e2e-test: redis + - apiVersion: vshn.appcat.vshn.io/v1 + kind: VSHNRedis + name: redis-e2e-test diff --git a/tests/e2e/redis/00-assert.yaml b/tests/e2e/redis/10-assert.yaml similarity index 75% rename from tests/e2e/redis/00-assert.yaml rename to tests/e2e/redis/10-assert.yaml index 5f73ea79a..a72993d40 100644 --- a/tests/e2e/redis/00-assert.yaml +++ b/tests/e2e/redis/10-assert.yaml @@ -33,24 +33,9 @@ spec: writeConnectionSecretToRef: name: redis-e2e-test-creds status: - caCertificateConditions: - - status: "True" - - status: "True" - clientCertificateConditions: - - status: "True" - - status: "True" conditions: - status: "True" - status: "True" - localCAConditions: - - status: "True" - - status: "True" - selfSignedIssuerConditions: - - status: "True" - - status: "True" - serverCertificateConditions: - - status: "True" - - status: "True" --- apiVersion: v1 diff --git a/tests/e2e/redis/10-install.yaml b/tests/e2e/redis/10-install.yaml new file mode 100644 index 000000000..4585b08c4 --- /dev/null +++ b/tests/e2e/redis/10-install.yaml @@ -0,0 +1,10 @@ +apiVersion: vshn.appcat.vshn.io/v1 +kind: VSHNRedis +metadata: + name: redis-e2e-test +spec: + parameters: + size: + plan: standard-2 + writeConnectionSecretToRef: + name: redis-e2e-test-creds diff --git a/tests/e2e/redis/01-assert.yaml b/tests/e2e/redis/20-assert.yaml similarity index 100% rename from tests/e2e/redis/01-assert.yaml rename to tests/e2e/redis/20-assert.yaml diff --git a/tests/e2e/redis/01-connect.yaml b/tests/e2e/redis/20-connect.yaml similarity index 100% rename from tests/e2e/redis/01-connect.yaml rename to tests/e2e/redis/20-connect.yaml diff --git a/tests/e2e/redis/02-check-protection.yaml b/tests/e2e/redis/30-check-protection.yaml similarity index 100% rename from tests/e2e/redis/02-check-protection.yaml rename to tests/e2e/redis/30-check-protection.yaml diff --git a/tests/e2e/redis/03-install.yaml b/tests/e2e/redis/40-install.yaml similarity index 100% rename from tests/e2e/redis/03-install.yaml rename to tests/e2e/redis/40-install.yaml diff --git a/tests/e2e/redis/04-assert.yaml b/tests/e2e/redis/50-assert.yaml similarity index 75% rename from tests/e2e/redis/04-assert.yaml rename to tests/e2e/redis/50-assert.yaml index 2368e0508..b75c508d1 100644 --- a/tests/e2e/redis/04-assert.yaml +++ b/tests/e2e/redis/50-assert.yaml @@ -33,24 +33,9 @@ spec: writeConnectionSecretToRef: name: redis-e2e-test-creds status: - caCertificateConditions: - - status: "True" - - status: "True" - clientCertificateConditions: - - status: "True" - - status: "True" conditions: - status: "True" - status: "True" - localCAConditions: - - status: "True" - - status: "True" - selfSignedIssuerConditions: - - status: "True" - - status: "True" - serverCertificateConditions: - - status: "True" - - status: "True" --- apiVersion: v1