From 43af683c5805234cdcb5a49f68377e487ed0505b Mon Sep 17 00:00:00 2001 From: Vida Haririan Date: Thu, 21 Mar 2024 10:59:16 -0400 Subject: [PATCH 1/2] Add Cinder Backup scaled KUTTL tests --- test/kuttl/tests/cinder_scale/06-assert.yaml | 35 +++++++++++++++++++ .../06-scale-up-cinder-backup.yaml | 5 +++ test/kuttl/tests/cinder_scale/07-assert.yaml | 35 +++++++++++++++++++ .../07-scale-down-cinder-backup.yaml | 5 +++ ...nup-cinder.yaml => 10-cleanup-cinder.yaml} | 0 .../{05-errors.yaml => 10-errors.yaml} | 0 6 files changed, 80 insertions(+) create mode 100644 test/kuttl/tests/cinder_scale/06-assert.yaml create mode 100644 test/kuttl/tests/cinder_scale/06-scale-up-cinder-backup.yaml create mode 100644 test/kuttl/tests/cinder_scale/07-assert.yaml create mode 100644 test/kuttl/tests/cinder_scale/07-scale-down-cinder-backup.yaml rename test/kuttl/tests/cinder_scale/{05-cleanup-cinder.yaml => 10-cleanup-cinder.yaml} (100%) rename test/kuttl/tests/cinder_scale/{05-errors.yaml => 10-errors.yaml} (100%) diff --git a/test/kuttl/tests/cinder_scale/06-assert.yaml b/test/kuttl/tests/cinder_scale/06-assert.yaml new file mode 100644 index 00000000..5e6ec444 --- /dev/null +++ b/test/kuttl/tests/cinder_scale/06-assert.yaml @@ -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 diff --git a/test/kuttl/tests/cinder_scale/06-scale-up-cinder-backup.yaml b/test/kuttl/tests/cinder_scale/06-scale-up-cinder-backup.yaml new file mode 100644 index 00000000..e6a1ea56 --- /dev/null +++ b/test/kuttl/tests/cinder_scale/06-scale-up-cinder-backup.yaml @@ -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}]' diff --git a/test/kuttl/tests/cinder_scale/07-assert.yaml b/test/kuttl/tests/cinder_scale/07-assert.yaml new file mode 100644 index 00000000..a6debe4f --- /dev/null +++ b/test/kuttl/tests/cinder_scale/07-assert.yaml @@ -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 diff --git a/test/kuttl/tests/cinder_scale/07-scale-down-cinder-backup.yaml b/test/kuttl/tests/cinder_scale/07-scale-down-cinder-backup.yaml new file mode 100644 index 00000000..44acc226 --- /dev/null +++ b/test/kuttl/tests/cinder_scale/07-scale-down-cinder-backup.yaml @@ -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}]' diff --git a/test/kuttl/tests/cinder_scale/05-cleanup-cinder.yaml b/test/kuttl/tests/cinder_scale/10-cleanup-cinder.yaml similarity index 100% rename from test/kuttl/tests/cinder_scale/05-cleanup-cinder.yaml rename to test/kuttl/tests/cinder_scale/10-cleanup-cinder.yaml diff --git a/test/kuttl/tests/cinder_scale/05-errors.yaml b/test/kuttl/tests/cinder_scale/10-errors.yaml similarity index 100% rename from test/kuttl/tests/cinder_scale/05-errors.yaml rename to test/kuttl/tests/cinder_scale/10-errors.yaml From dbb8f569b2d66b5d0bf7012dc914127ed8e4cffa Mon Sep 17 00:00:00 2001 From: Vida Haririan Date: Wed, 27 Mar 2024 11:43:20 -0400 Subject: [PATCH 2/2] Add Cinder Scheduler scaled KUTTL tests --- test/kuttl/tests/cinder_scale/04-assert.yaml | 35 +++++++++++++++++++ .../04-scale-up-cinder-scheduler.yaml | 5 +++ test/kuttl/tests/cinder_scale/05-assert.yaml | 35 +++++++++++++++++++ .../05-scale-down-cinder-scheduler.yaml | 5 +++ 4 files changed, 80 insertions(+) create mode 100644 test/kuttl/tests/cinder_scale/04-assert.yaml create mode 100644 test/kuttl/tests/cinder_scale/04-scale-up-cinder-scheduler.yaml create mode 100644 test/kuttl/tests/cinder_scale/05-assert.yaml create mode 100644 test/kuttl/tests/cinder_scale/05-scale-down-cinder-scheduler.yaml diff --git a/test/kuttl/tests/cinder_scale/04-assert.yaml b/test/kuttl/tests/cinder_scale/04-assert.yaml new file mode 100644 index 00000000..a1a4f2d7 --- /dev/null +++ b/test/kuttl/tests/cinder_scale/04-assert.yaml @@ -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 diff --git a/test/kuttl/tests/cinder_scale/04-scale-up-cinder-scheduler.yaml b/test/kuttl/tests/cinder_scale/04-scale-up-cinder-scheduler.yaml new file mode 100644 index 00000000..4131c6d9 --- /dev/null +++ b/test/kuttl/tests/cinder_scale/04-scale-up-cinder-scheduler.yaml @@ -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}]' diff --git a/test/kuttl/tests/cinder_scale/05-assert.yaml b/test/kuttl/tests/cinder_scale/05-assert.yaml new file mode 100644 index 00000000..6b2fe016 --- /dev/null +++ b/test/kuttl/tests/cinder_scale/05-assert.yaml @@ -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 diff --git a/test/kuttl/tests/cinder_scale/05-scale-down-cinder-scheduler.yaml b/test/kuttl/tests/cinder_scale/05-scale-down-cinder-scheduler.yaml new file mode 100644 index 00000000..5ff811b5 --- /dev/null +++ b/test/kuttl/tests/cinder_scale/05-scale-down-cinder-scheduler.yaml @@ -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}]'