-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add kuttl tests for the database creation
This patch is: - Adding the base kuttl tests structure - Adding some make targets to run and cleanup kuttl tests - Creating kuttl tests for the database creation including with and without precreating a MariaDBAccount. This will be used for a kuttl job that will be added later.
- Loading branch information
Showing
17 changed files
with
405 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: watcher-db-secret | ||
namespace: watcher-kuttl-default | ||
--- | ||
apiVersion: mariadb.openstack.org/v1beta1 | ||
kind: MariaDBAccount | ||
metadata: | ||
name: watcher-precreated | ||
namespace: watcher-kuttl-default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
delete: | ||
- apiVersion: watcher.openstack.org/v1beta1 | ||
kind: Watcher | ||
name: watcher-kuttl | ||
namespace: watcher-kuttl-default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestSuite | ||
reportFormat: JSON | ||
reportName: kuttl-default-results | ||
namespace: watcher-kuttl-default | ||
# we could set this lower, but the initial image pull can take a while | ||
timeout: 300 | ||
parallel: 1 | ||
skipDelete: true | ||
testDirs: | ||
- tests/kuttl/test-suites/default/ | ||
suppress: | ||
- events | ||
artifactsDir: tests/kuttl/test-suites/default/output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: core.openstack.org/v1beta1 | ||
kind: OpenStackControlPlane | ||
metadata: | ||
name: openstack | ||
spec: | ||
storageClass: crc-csi-hostpath-provisioner | ||
mariadb: | ||
enabled: false | ||
galera: | ||
enabled: true | ||
templates: | ||
openstack: | ||
storageRequest: 500M | ||
storageClass: crc-csi-hostpath-provisioner | ||
openstack-cell1: | ||
storageRequest: 500M | ||
storageClass: crc-csi-hostpath-provisioner | ||
rabbitmq: | ||
templates: | ||
rabbitmq: | ||
replicas: 1 | ||
rabbitmq-cell1: | ||
replicas: 1 | ||
memcached: | ||
templates: | ||
memcached: | ||
replicas: 1 | ||
nova: | ||
enabled: false | ||
placement: | ||
enabled: false | ||
neutron: | ||
enabled: false | ||
keystone: | ||
enabled: true | ||
cinder: | ||
enabled: false | ||
telemetry: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: core.openstack.org/v1beta1 | ||
kind: OpenStackControlPlane | ||
metadata: | ||
name: openstack | ||
spec: | ||
keystone: | ||
template: | ||
databaseInstance: openstack | ||
secret: osp-secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
namespace: watcher-kuttl-default | ||
|
||
secretGenerator: | ||
- literals: | ||
- AdminPassword=password | ||
- DbRootPassword=password | ||
- DatabasePassword=password | ||
- WatcherPassword=password | ||
- KeystoneDatabasePassword=password | ||
- PlacementPassword=password | ||
- PlacementDatabasePassword=password | ||
- GlancePassword=password | ||
- GlanceDatabasePassword=password | ||
- NeutronPassword=password | ||
- NeutronDatabasePassword=password | ||
- NovaPassword=password | ||
- NovaAPIDatabasePassword=password | ||
- NovaCell0DatabasePassword=password | ||
- NovaCell1DatabasePassword=password | ||
- MetadataSecret=42 | ||
name: osp-secret | ||
generatorOptions: | ||
disableNameSuffixHash: true | ||
labels: | ||
type: osp-secret | ||
|
||
resources: | ||
- namespace.yaml | ||
- infra.yaml | ||
|
||
patches: | ||
- patch: |- | ||
apiVersion: core.openstack.org/v1beta1 | ||
kind: OpenStackControlPlane | ||
metadata: | ||
name: openstack | ||
spec: | ||
secret: osp-secret | ||
- path: infra.yaml | ||
- path: keystone.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: watcher-kuttl-default |
115 changes: 115 additions & 0 deletions
115
tests/kuttl/test-suites/default/output/kuttl-default-results.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{ | ||
"name": "", | ||
"tests": 10, | ||
"failures": 0, | ||
"time": "47.541", | ||
"testsuite": [ | ||
{ | ||
"tests": 10, | ||
"failures": 0, | ||
"timestamp": "2024-11-21T18:21:24.571977938+01:00", | ||
"time": "46.872", | ||
"name": "tests/kuttl/test-suites/default/", | ||
"testsuite": [ | ||
{ | ||
"tests": 1, | ||
"failures": 0, | ||
"timestamp": "2024-11-21T18:21:24.572187427+01:00", | ||
"time": "0.267", | ||
"name": "common", | ||
"testcase": [ | ||
{ | ||
"classname": "common", | ||
"name": "setup", | ||
"timestamp": "2024-11-21T18:21:24.572188221+01:00", | ||
"time": "0.267" | ||
} | ||
] | ||
}, | ||
{ | ||
"tests": 1, | ||
"failures": 0, | ||
"timestamp": "2024-11-21T18:21:24.83901661+01:00", | ||
"time": "0.132", | ||
"name": "output", | ||
"testcase": [ | ||
{ | ||
"classname": "output", | ||
"name": "setup", | ||
"timestamp": "2024-11-21T18:21:24.839019114+01:00", | ||
"time": "0.132" | ||
} | ||
] | ||
}, | ||
{ | ||
"tests": 7, | ||
"failures": 0, | ||
"timestamp": "2024-11-21T18:21:24.973647553+01:00", | ||
"time": "46.203", | ||
"name": "test", | ||
"testcase": [ | ||
{ | ||
"classname": "test", | ||
"name": "setup", | ||
"timestamp": "2024-11-21T18:21:24.973649109+01:00", | ||
"time": "0.133" | ||
}, | ||
{ | ||
"classname": "test", | ||
"name": "step 0-cleanup-watcher", | ||
"timestamp": "2024-11-21T18:21:25.107142603+01:00", | ||
"time": "1.084" | ||
}, | ||
{ | ||
"classname": "test", | ||
"name": "step 1-deploy-with-defaults", | ||
"timestamp": "2024-11-21T18:21:26.190709294+01:00", | ||
"time": "21.358", | ||
"assertions": 4 | ||
}, | ||
{ | ||
"classname": "test", | ||
"name": "step 2-cleanup-watcher", | ||
"timestamp": "2024-11-21T18:21:47.548998243+01:00", | ||
"time": "0.948" | ||
}, | ||
{ | ||
"classname": "test", | ||
"name": "step 3-precreate-mariadbaccount", | ||
"timestamp": "2024-11-21T18:21:48.4972392+01:00", | ||
"time": "0.407" | ||
}, | ||
{ | ||
"classname": "test", | ||
"name": "step 4-deploy-with-precreated-account", | ||
"timestamp": "2024-11-21T18:21:48.904623313+01:00", | ||
"time": "21.326", | ||
"assertions": 4 | ||
}, | ||
{ | ||
"classname": "test", | ||
"name": "step 5-cleanup-watcher", | ||
"timestamp": "2024-11-21T18:22:10.230458338+01:00", | ||
"time": "0.946" | ||
} | ||
] | ||
}, | ||
{ | ||
"tests": 1, | ||
"failures": 0, | ||
"timestamp": "2024-11-21T18:22:11.176668323+01:00", | ||
"time": "0.267", | ||
"name": "deps", | ||
"testcase": [ | ||
{ | ||
"classname": "deps", | ||
"name": "setup", | ||
"timestamp": "2024-11-21T18:22:11.176670376+01:00", | ||
"time": "0.267" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../common/cleanup-watcher.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: watcher.openstack.org/v1beta1 | ||
kind: Watcher | ||
metadata: | ||
finalizers: | ||
- openstack.org/watcher | ||
name: watcher-kuttl | ||
namespace: watcher-kuttl-default | ||
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 | ||
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 |
7 changes: 7 additions & 0 deletions
7
tests/kuttl/test-suites/default/test/01-deploy-with-defaults.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: watcher.openstack.org/v1beta1 | ||
kind: Watcher | ||
metadata: | ||
name: watcher-kuttl | ||
namespace: watcher-kuttl-default | ||
spec: | ||
databaseInstance: "openstack" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../common/cleanup-watcher.yaml |
9 changes: 9 additions & 0 deletions
9
tests/kuttl/test-suites/default/test/03-precreate-mariadbaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: mariadb.openstack.org/v1beta1 | ||
kind: MariaDBAccount | ||
metadata: | ||
name: watcher-precreated | ||
namespace: watcher-kuttl-default | ||
spec: | ||
requireTLS: false | ||
secret: watcher-db-secret | ||
userName: watcher_test |
Oops, something went wrong.