Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#368 from vhariria/cinder-s…
Browse files Browse the repository at this point in the history
…cale-vh

Add Cinder Backup & Scheduler scaled KUTTL tests
openshift-merge-bot[bot] authored Mar 28, 2024
2 parents 7961ee3 + dbb8f56 commit 7092e22
Showing 10 changed files with 160 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/kuttl/tests/cinder_scale/04-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: cinder.openstack.org/v1beta1
kind: Cinder
metadata:
name: cinder
spec:
serviceUser: cinder
customServiceConfig: |
[DEFAULT]
debug = true
databaseInstance: openstack
databaseAccount: cinder
rabbitMqClusterName: rabbitmq
cinderAPI:
replicas: 1
cinderScheduler:
replicas: 3
cinderBackup:
replicas: 1
cinderVolumes:
volume1:
replicas: 1
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: cinder-scheduler
ownerReferences:
- apiVersion: cinder.openstack.org/v1beta1
blockOwnerDeletion: true
controller: true
kind: CinderScheduler
name: cinder-scheduler
status:
availableReplicas: 3
replicas: 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
oc patch cinder -n $NAMESPACE cinder --type='json' -p='[{"op": "replace", "path": "/spec/cinderScheduler/replicas", "value":3}]'
35 changes: 35 additions & 0 deletions test/kuttl/tests/cinder_scale/05-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: cinder.openstack.org/v1beta1
kind: Cinder
metadata:
name: cinder
spec:
serviceUser: cinder
customServiceConfig: |
[DEFAULT]
debug = true
databaseInstance: openstack
databaseAccount: cinder
rabbitMqClusterName: rabbitmq
cinderAPI:
replicas: 1
cinderScheduler:
replicas: 1
cinderBackup:
replicas: 1
cinderVolumes:
volume1:
replicas: 1
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: cinder-scheduler
ownerReferences:
- apiVersion: cinder.openstack.org/v1beta1
blockOwnerDeletion: true
controller: true
kind: CinderScheduler
name: cinder-scheduler
status:
availableReplicas: 1
replicas: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
oc patch cinder -n $NAMESPACE cinder --type='json' -p='[{"op": "replace", "path": "/spec/cinderScheduler/replicas", "value":1}]'
35 changes: 35 additions & 0 deletions test/kuttl/tests/cinder_scale/06-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: cinder.openstack.org/v1beta1
kind: Cinder
metadata:
name: cinder
spec:
serviceUser: cinder
customServiceConfig: |
[DEFAULT]
debug = true
databaseInstance: openstack
databaseAccount: cinder
rabbitMqClusterName: rabbitmq
cinderAPI:
replicas: 1
cinderScheduler:
replicas: 1
cinderBackup:
replicas: 3
cinderVolumes:
volume1:
replicas: 1
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: cinder-backup
ownerReferences:
- apiVersion: cinder.openstack.org/v1beta1
blockOwnerDeletion: true
controller: true
kind: CinderBackup
name: cinder-backup
status:
availableReplicas: 3
replicas: 3
5 changes: 5 additions & 0 deletions test/kuttl/tests/cinder_scale/06-scale-up-cinder-backup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
oc patch cinder -n $NAMESPACE cinder --type='json' -p='[{"op": "replace", "path": "/spec/cinderBackup/replicas", "value":3}]'
35 changes: 35 additions & 0 deletions test/kuttl/tests/cinder_scale/07-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: cinder.openstack.org/v1beta1
kind: Cinder
metadata:
name: cinder
spec:
serviceUser: cinder
customServiceConfig: |
[DEFAULT]
debug = true
databaseInstance: openstack
databaseAccount: cinder
rabbitMqClusterName: rabbitmq
cinderAPI:
replicas: 1
cinderScheduler:
replicas: 1
cinderBackup:
replicas: 1
cinderVolumes:
volume1:
replicas: 1
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: cinder-backup
ownerReferences:
- apiVersion: cinder.openstack.org/v1beta1
blockOwnerDeletion: true
controller: true
kind: CinderBackup
name: cinder-backup
status:
availableReplicas: 1
replicas: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
oc patch cinder -n $NAMESPACE cinder --type='json' -p='[{"op": "replace", "path": "/spec/cinderBackup/replicas", "value":1}]'

0 comments on commit 7092e22

Please sign in to comment.