Skip to content

Commit

Permalink
Add kuttl tests for Keystone service
Browse files Browse the repository at this point in the history
Modifies existing kuttl tests in watcher to cover the watcher keystone service
registration.
  • Loading branch information
amoralej committed Dec 13, 2024
1 parent 759a7d3 commit 8c46203
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/kuttl/test-suites/default/watcher/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ status:
reason: Ready
status: "True"
type: DBReady
- message: Input data complete
reason: Ready
status: "True"
type: InputReady
- message: Setup complete
reason: Ready
status: "True"
type: KeystoneServiceReady
- message: MariaDBAccount creation complete
reason: Ready
status: "True"
Expand Down Expand Up @@ -80,3 +88,29 @@ kind: Secret
metadata:
name: rabbitmq-transport-url-watcher-kuttl-watcher-transport
namespace: watcher-kuttl-default
---
apiVersion: keystone.openstack.org/v1beta1
kind: KeystoneService
metadata:
name: watcher
finalizers:
- openstack.org/watcher
- openstack.org/keystoneservice
spec:
enabled: true
passwordSelector: WatcherPassword
secret: osp-secret
serviceDescription: Watcher Service
serviceName: watcher
serviceType: infra-optim
serviceUser: watcher
---
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
namespaced: true
commands:
- script: |
set -euxo pipefail
oc exec -n watcher-kuttl-default openstackclient -- openstack service list -f value -c Name -c Type |[ $(grep -c ^watcher) == 1 ]
SERVICEID=$(oc exec -n watcher-kuttl-default openstackclient -- openstack service list -f value -c Name -c Type -c ID | grep watcher| awk '{print $1}')
[ $(oc get -n watcher-kuttl-default keystoneservice watcher -o jsonpath={.status.serviceID}) == $SERVICEID ]
30 changes: 30 additions & 0 deletions tests/kuttl/test-suites/default/watcher/04-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ status:
reason: Ready
status: "True"
type: DBReady
- message: Input data complete
reason: Ready
status: "True"
type: InputReady
- message: Setup complete
reason: Ready
status: "True"
type: KeystoneServiceReady
- message: MariaDBAccount creation complete
reason: Ready
status: "True"
Expand Down Expand Up @@ -86,3 +94,25 @@ kind: Secret
metadata:
name: rabbitmq-transport-url-watcher-kuttl-watcher-transport
namespace: watcher-kuttl-default
---
apiVersion: v1
kind: Secret
metadata:
name: rabbitmq-transport-url-watcher-kuttl-watcher-transport
namespace: watcher-kuttl-default
---
apiVersion: keystone.openstack.org/v1beta1
kind: KeystoneService
metadata:
name: watcher
finalizers:
- openstack.org/watcher
- openstack.org/keystoneservice
spec:
enabled: true
passwordSelector: WatcherPassword
secret: osp-secret
serviceDescription: Watcher Service
serviceName: watcher
serviceType: infra-optim
serviceUser: watcher
2 changes: 2 additions & 0 deletions tests/kuttl/test-suites/default/watcher/05-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ commands:
oc get secret -n watcher-kuttl-default --no-headers=true | [ $(grep -c ^watcher) == 0 ]
oc get secret -n watcher-kuttl-default --no-headers=true | [ $(grep -c ^rabbitmq-transport-url-.*-watcher-transport) == 0 ]
oc get transporturl -n watcher-kuttl-default --no-headers=true | [ $(grep -c ^watcher-kuttl-watcher-transport) == 0 ]
oc get keystoneservice -n watcher-kuttl-default --no-headers=true | [ $(grep -c ^watcher) == 0 ]
oc exec -n watcher-kuttl-default openstackclient -- openstack service list -f value -c Name -c Type | [ $(grep -c ^watcher) == 0 ]

0 comments on commit 8c46203

Please sign in to comment.