diff --git a/tests/kuttl/test-suites/default/common/assert-watcher-precreated-account.yaml b/tests/kuttl/test-suites/default/common/assert-watcher-precreated-account.yaml new file mode 100644 index 0000000..205f15e --- /dev/null +++ b/tests/kuttl/test-suites/default/common/assert-watcher-precreated-account.yaml @@ -0,0 +1,56 @@ +apiVersion: watcher.openstack.org/v1beta1 +kind: Watcher +metadata: + finalizers: + - openstack.org/watcher + name: watcher-kuttl + namespace: watcher-kuttl-default +spec: + databaseAccount: watcher-precreated + databaseInstance: openstack + passwordSelectors: + service: WatcherPassword + secret: osp-secret +status: + conditions: + - message: Setup complete + reason: Ready + status: "True" + type: Ready + - message: DB create completed + reason: Ready + status: "True" + type: DBReady + - message: MariaDBAccount creation complete + reason: Ready + status: "True" + type: MariaDBAccountReady +--- +apiVersion: v1 +kind: Secret +metadata: + name: watcher-precreated-db-secret + namespace: watcher-kuttl-default + finalizers: + - openstack.org/watcher +--- +apiVersion: mariadb.openstack.org/v1beta1 +kind: MariaDBAccount +metadata: + name: watcher-precreated + namespace: watcher-kuttl-default + finalizers: + - openstack.org/watcher + - openstack.org/mariadbaccount + labels: + mariaDBDatabaseName: watcher +--- +apiVersion: mariadb.openstack.org/v1beta1 +kind: MariaDBDatabase +metadata: + name: watcher + namespace: watcher-kuttl-default + finalizers: + - openstack.org/watcher + - openstack.org/mariadbdatabase + - openstack.org/mariadbaccount-watcher-precreated diff --git a/tests/kuttl/test-suites/default/common/cleanup-watcher.yaml b/tests/kuttl/test-suites/default/common/cleanup-watcher.yaml index 31bb5ab..7205146 100644 --- a/tests/kuttl/test-suites/default/common/cleanup-watcher.yaml +++ b/tests/kuttl/test-suites/default/common/cleanup-watcher.yaml @@ -4,4 +4,3 @@ delete: - apiVersion: watcher.openstack.org/v1beta1 kind: Watcher name: watcher-kuttl - namespace: watcher-kuttl-default diff --git a/tests/kuttl/test-suites/default/common/deploy-with-defaults.yaml b/tests/kuttl/test-suites/default/common/deploy-with-defaults.yaml new file mode 100644 index 0000000..3b969ba --- /dev/null +++ b/tests/kuttl/test-suites/default/common/deploy-with-defaults.yaml @@ -0,0 +1,7 @@ +apiVersion: watcher.openstack.org/v1beta1 +kind: Watcher +metadata: + name: watcher-kuttl + namespace: watcher-kuttl-default +spec: + databaseInstance: "openstack" diff --git a/tests/kuttl/test-suites/default/test/04-deploy-with-precreated-account.yaml b/tests/kuttl/test-suites/default/common/deploy-with-precreated-account.yaml similarity index 100% rename from tests/kuttl/test-suites/default/test/04-deploy-with-precreated-account.yaml rename to tests/kuttl/test-suites/default/common/deploy-with-precreated-account.yaml diff --git a/tests/kuttl/test-suites/default/test/03-precreate-mariadbaccount.yaml b/tests/kuttl/test-suites/default/common/precreate-mariadbaccount.yaml similarity index 100% rename from tests/kuttl/test-suites/default/test/03-precreate-mariadbaccount.yaml rename to tests/kuttl/test-suites/default/common/precreate-mariadbaccount.yaml diff --git a/tests/kuttl/test-suites/default/test/01-deploy-with-defaults.yaml b/tests/kuttl/test-suites/default/test/01-deploy-with-defaults.yaml deleted file mode 100644 index 3b969ba..0000000 --- a/tests/kuttl/test-suites/default/test/01-deploy-with-defaults.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: watcher.openstack.org/v1beta1 -kind: Watcher -metadata: - name: watcher-kuttl - namespace: watcher-kuttl-default -spec: - databaseInstance: "openstack" diff --git a/tests/kuttl/test-suites/default/test/01-deploy-with-defaults.yaml b/tests/kuttl/test-suites/default/test/01-deploy-with-defaults.yaml new file mode 120000 index 0000000..ecf8d37 --- /dev/null +++ b/tests/kuttl/test-suites/default/test/01-deploy-with-defaults.yaml @@ -0,0 +1 @@ +../common/deploy-with-defaults.yaml \ No newline at end of file diff --git a/tests/kuttl/test-suites/default/test/03-precreate-mariadbccount.yaml b/tests/kuttl/test-suites/default/test/03-precreate-mariadbccount.yaml new file mode 120000 index 0000000..7ef51e7 --- /dev/null +++ b/tests/kuttl/test-suites/default/test/03-precreate-mariadbccount.yaml @@ -0,0 +1 @@ +../common/precreate-mariadbaccount.yaml \ No newline at end of file diff --git a/tests/kuttl/test-suites/default/test/04-assert.yaml b/tests/kuttl/test-suites/default/test/04-assert.yaml deleted file mode 100644 index 3a4c03a..0000000 --- a/tests/kuttl/test-suites/default/test/04-assert.yaml +++ /dev/null @@ -1,56 +0,0 @@ -apiVersion: watcher.openstack.org/v1beta1 -kind: Watcher -metadata: - finalizers: - - openstack.org/watcher - name: watcher-kuttl - namespace: watcher-kuttl-default -spec: - databaseAccount: watcher-precreated - databaseInstance: openstack - passwordSelectors: - service: WatcherPassword - secret: osp-secret -status: - conditions: - - message: Setup complete - reason: Ready - status: "True" - type: Ready - - message: DB create completed - reason: Ready - status: "True" - type: DBReady - - message: MariaDBAccount creation complete - reason: Ready - status: "True" - type: MariaDBAccountReady ---- -apiVersion: v1 -kind: Secret -metadata: - name: watcher-db-secret - namespace: watcher-kuttl-default - finalizers: - - openstack.org/watcher ---- -apiVersion: mariadb.openstack.org/v1beta1 -kind: MariaDBAccount -metadata: - name: watcher-precreated - namespace: watcher-kuttl-default - finalizers: - - openstack.org/watcher - - openstack.org/mariadbaccount - labels: - mariaDBDatabaseName: watcher ---- -apiVersion: mariadb.openstack.org/v1beta1 -kind: MariaDBDatabase -metadata: - name: watcher - namespace: watcher-kuttl-default - finalizers: - - openstack.org/watcher - - openstack.org/mariadbdatabase - - openstack.org/mariadbaccount-watcher-precreated diff --git a/tests/kuttl/test-suites/default/test/04-assert.yaml b/tests/kuttl/test-suites/default/test/04-assert.yaml new file mode 120000 index 0000000..3ef0a0f --- /dev/null +++ b/tests/kuttl/test-suites/default/test/04-assert.yaml @@ -0,0 +1 @@ +../common/assert-watcher-precreated-account.yaml \ No newline at end of file diff --git a/tests/kuttl/test-suites/default/test/04-deploy-watcher-precreated-account.yaml b/tests/kuttl/test-suites/default/test/04-deploy-watcher-precreated-account.yaml new file mode 120000 index 0000000..a860a61 --- /dev/null +++ b/tests/kuttl/test-suites/default/test/04-deploy-watcher-precreated-account.yaml @@ -0,0 +1 @@ +../common/deploy-with-precreated-account.yaml \ No newline at end of file diff --git a/tests/kuttl/test-suites/default/watcher-api/00-cleanup-watcher.yaml b/tests/kuttl/test-suites/default/watcher-api/00-cleanup-watcher.yaml new file mode 120000 index 0000000..92ed6e0 --- /dev/null +++ b/tests/kuttl/test-suites/default/watcher-api/00-cleanup-watcher.yaml @@ -0,0 +1 @@ +../common/cleanup-watcher.yaml \ No newline at end of file diff --git a/tests/kuttl/test-suites/default/watcher-api/01-cleanup-watcherapi.yaml b/tests/kuttl/test-suites/default/watcher-api/01-cleanup-watcherapi.yaml new file mode 100644 index 0000000..b9c7650 --- /dev/null +++ b/tests/kuttl/test-suites/default/watcher-api/01-cleanup-watcherapi.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +delete: +- apiVersion: watcher.openstack.org/v1beta1 + kind: WatcherAPI + name: watcherapi-kuttl diff --git a/tests/kuttl/test-suites/default/watcher-api/02-deploy-with-defaults.yaml b/tests/kuttl/test-suites/default/watcher-api/02-deploy-with-defaults.yaml new file mode 120000 index 0000000..ecf8d37 --- /dev/null +++ b/tests/kuttl/test-suites/default/watcher-api/02-deploy-with-defaults.yaml @@ -0,0 +1 @@ +../common/deploy-with-defaults.yaml \ No newline at end of file diff --git a/tests/kuttl/test-suites/default/watcher-api/03-assert.yaml b/tests/kuttl/test-suites/default/watcher-api/03-assert.yaml new file mode 100644 index 0000000..f3c4cab --- /dev/null +++ b/tests/kuttl/test-suites/default/watcher-api/03-assert.yaml @@ -0,0 +1,26 @@ +apiVersion: watcher.openstack.org/v1beta1 +kind: WatcherAPI +metadata: + finalizers: + - openstack.org/watcherapi + name: watcherapi-kuttl +spec: + databaseAccount: watcher + databaseInstance: openstack + passwordSelectors: + service: WatcherPassword + secret: osp-secret +status: + conditions: + - message: Setup complete + reason: Ready + status: "True" + type: Ready + - message: Input data complete + reason: Ready + status: "True" + type: InputReady + - message: Service config create completed + reason: Ready + status: "True" + type: ServiceConfigReady diff --git a/tests/kuttl/test-suites/default/watcher-api/03-deploy-watcher-api.yaml b/tests/kuttl/test-suites/default/watcher-api/03-deploy-watcher-api.yaml new file mode 100644 index 0000000..b4f6a41 --- /dev/null +++ b/tests/kuttl/test-suites/default/watcher-api/03-deploy-watcher-api.yaml @@ -0,0 +1,6 @@ +apiVersion: watcher.openstack.org/v1beta1 +kind: WatcherAPI +metadata: + name: watcherapi-kuttl +spec: + databaseInstance: "openstack" diff --git a/tests/kuttl/test-suites/default/watcher-api/04-cleanup-watcher.yaml b/tests/kuttl/test-suites/default/watcher-api/04-cleanup-watcher.yaml new file mode 120000 index 0000000..92ed6e0 --- /dev/null +++ b/tests/kuttl/test-suites/default/watcher-api/04-cleanup-watcher.yaml @@ -0,0 +1 @@ +../common/cleanup-watcher.yaml \ No newline at end of file diff --git a/tests/kuttl/test-suites/default/watcher-api/05-assert.yaml b/tests/kuttl/test-suites/default/watcher-api/05-assert.yaml new file mode 100644 index 0000000..6de52af --- /dev/null +++ b/tests/kuttl/test-suites/default/watcher-api/05-assert.yaml @@ -0,0 +1,9 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +namespaced: true +commands: + - script: | + set -ex + oc get mariadbaccount -n ${NAMESPACE} --no-headers=true | [ $(grep -c ^watcher) == 0 ] + oc get mariadbdatabase -n ${NAMESPACE} --no-headers=true | [ $(grep -c ^watcher) == 0 ] + oc get secret -n ${NAMESPACE} --no-headers=true | [ $(grep -c ^watcher) == 0 ] diff --git a/tests/kuttl/test-suites/default/watcher-api/05-cleanup-watcherapi.yaml b/tests/kuttl/test-suites/default/watcher-api/05-cleanup-watcherapi.yaml new file mode 120000 index 0000000..40ff478 --- /dev/null +++ b/tests/kuttl/test-suites/default/watcher-api/05-cleanup-watcherapi.yaml @@ -0,0 +1 @@ +01-cleanup-watcherapi.yaml \ No newline at end of file