From bc0b60e9f57830936b33d749e0d7080f23e7acc8 Mon Sep 17 00:00:00 2001 From: Mauricio Harley Date: Wed, 25 Oct 2023 07:12:30 -0400 Subject: [PATCH] Add missing requeue and Owns --- kuttl-test.yaml | 4 +- .../common/assert_sample_deployment.yaml | 87 +++++++++++++++++++ .../kuttl/tests/barbican_scale/00-assert.yaml | 1 + .../barbican_scale/00-deploy-barbican.yaml | 6 ++ .../barbican_scale/05-cleanup-barbican.yaml | 6 ++ .../kuttl/tests/barbican_scale/05-errors.yaml | 17 ++++ .../deploy/barbican_v1beta1_barbican.yaml | 68 +++++++++++++++ .../barbican_scale/deploy/kustomization.yaml | 13 +++ 8 files changed, 201 insertions(+), 1 deletion(-) create mode 100644 test/kuttl/common/assert_sample_deployment.yaml create mode 120000 test/kuttl/tests/barbican_scale/00-assert.yaml create mode 100644 test/kuttl/tests/barbican_scale/00-deploy-barbican.yaml create mode 100644 test/kuttl/tests/barbican_scale/05-cleanup-barbican.yaml create mode 100644 test/kuttl/tests/barbican_scale/05-errors.yaml create mode 100644 test/kuttl/tests/barbican_scale/deploy/barbican_v1beta1_barbican.yaml create mode 100644 test/kuttl/tests/barbican_scale/deploy/kustomization.yaml diff --git a/kuttl-test.yaml b/kuttl-test.yaml index 46c7616e..3b60eb07 100644 --- a/kuttl-test.yaml +++ b/kuttl-test.yaml @@ -1,7 +1,7 @@ # # EXECUTION (from install_yamls repo root): # -# make barbican_kuttl +# make cinder_kuttl # # ASSUMPTIONS: # @@ -11,6 +11,8 @@ # - chmod 755 /usr/local/bin/kubectl-kuttl # 2. An OCP 4.10+ CRC cluster with Podified Operators has been deployed # 3. CLI user has access to $KUBECONFIG +# 4. The environment variable INSTALL_YAMLS is set to the the path of the +# install_yamls repo apiVersion: kuttl.dev/v1beta1 kind: TestSuite diff --git a/test/kuttl/common/assert_sample_deployment.yaml b/test/kuttl/common/assert_sample_deployment.yaml new file mode 100644 index 00000000..c99b1bb4 --- /dev/null +++ b/test/kuttl/common/assert_sample_deployment.yaml @@ -0,0 +1,87 @@ +apiVersion: barbican.openstack.org/v1beta1 +kind: Barbican +metadata: + name: barbican +spec: + serviceUser: barbican + customServiceConfig: | + [DEFAULT] + debug = True + databaseInstance: openstack + databaseUser: barbican + rabbitMqClusterName: rabbitmq + barbicanAPI: + replicas: 1 + barbicanWorker: + replicas: 1 + barbicanKeystoneListener: + replicas: 1 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/name: barbican + app.kubernetes.io/instance: barbican + app.kubernetes.io/part-of: barbican-operator + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/created-by: barbican-operator + name: barbican +spec: + serviceAccount: barbican + serviceUser: barbican + containerImage: quay.io/podified-antelope-centos9/openstack-barbican-api:current-podified + databaseInstance: openstack + databaseUser: barbican + rabbitMqCusterName: barbican_rabbit + secret: osp-secret + passwordSelectors: + database: BarbicanDatabasePassword + service: BarbicanPassword + debug: + dbInitContainer: false + dbSync: false + initContainer: false + service: false + preserveJobs: true + nodeSelector: + node: controller + customServiceConfig: | + [DEFAULT] + debug = True + defaultConfigOverwrite: + policy.json: | + {"some": "custom policy"} + barbicanAPI: + containerImage: quay.io/podified-antelope-centos9/openstack-barbican-api:current-podified + nodeSelector: + optional_override: here + customServiceConfig: | + [optional] + overrides = True + defautlConfigOverwrite: + optional_policy.json: | + {"some": "custom policy"} + passwordSelectors: + database: BarbicanDatabasePassword + service: BarbicanPassword + barbicanWorker: + containerImage: quay.io/podified-antelope-centos9/openstack-barbican-worker:current-podified + nodeSelector: + optional_override: here + customServiceConfig: | + [optional] + overrides = True + defautlConfigOverwrite: + optional_policy.json: | + {"some": "custom policy"} + barbicanKeystoneListener: + containerImage: quay.io/podified-antelope-centos9/openstack-barbican-keystone-listener:current-podified + nodeSelector: + optional_override: here + customServiceConfig: | + [optional] + overrides = True + defautlConfigOverwrite: + optional_policy.json: | + {"some": "custom policy"} diff --git a/test/kuttl/tests/barbican_scale/00-assert.yaml b/test/kuttl/tests/barbican_scale/00-assert.yaml new file mode 120000 index 00000000..461654ea --- /dev/null +++ b/test/kuttl/tests/barbican_scale/00-assert.yaml @@ -0,0 +1 @@ +../../common/assert_sample_deployment.yaml \ No newline at end of file diff --git a/test/kuttl/tests/barbican_scale/00-deploy-barbican.yaml b/test/kuttl/tests/barbican_scale/00-deploy-barbican.yaml new file mode 100644 index 00000000..44dbf5ca --- /dev/null +++ b/test/kuttl/tests/barbican_scale/00-deploy-barbican.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: | + cp ../../../../config/samples/barbican_v1beta1_barbican.*yaml deploy + oc kustomize deploy | oc apply -n $NAMESPACE -f - diff --git a/test/kuttl/tests/barbican_scale/05-cleanup-barbican.yaml b/test/kuttl/tests/barbican_scale/05-cleanup-barbican.yaml new file mode 100644 index 00000000..7186f68e --- /dev/null +++ b/test/kuttl/tests/barbican_scale/05-cleanup-barbican.yaml @@ -0,0 +1,6 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: | + oc kustomize deploy | oc delete -n $NAMESPACE -f - + rm deploy/barbican_v1beta1_barbican.yaml diff --git a/test/kuttl/tests/barbican_scale/05-errors.yaml b/test/kuttl/tests/barbican_scale/05-errors.yaml new file mode 100644 index 00000000..65c32b2f --- /dev/null +++ b/test/kuttl/tests/barbican_scale/05-errors.yaml @@ -0,0 +1,17 @@ +# +# Check for: +# +# No BarbicanAPI CR +# No Deployment for BarbicanAPI CR +# No Pods in barbican Deployment +# No Barbican Services +# +apiVersion: barbican.openstack.org/v1beta1 +kind: Barbican +metadata: + name: barbican +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: barbican diff --git a/test/kuttl/tests/barbican_scale/deploy/barbican_v1beta1_barbican.yaml b/test/kuttl/tests/barbican_scale/deploy/barbican_v1beta1_barbican.yaml new file mode 100644 index 00000000..afcf71fd --- /dev/null +++ b/test/kuttl/tests/barbican_scale/deploy/barbican_v1beta1_barbican.yaml @@ -0,0 +1,68 @@ +apiVersion: barbican.openstack.org/v1beta1 +kind: Barbican +metadata: + labels: + app.kubernetes.io/name: barbican + app.kubernetes.io/instance: barbican + app.kubernetes.io/part-of: barbican-operator + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/created-by: barbican-operator + name: barbican +spec: + serviceAccount: barbican + serviceUser: barbican + containerImage: quay.io/podified-antelope-centos9/openstack-barbican-api:current-podified + databaseInstance: openstack + databaseUser: barbican + rabbitMqCusterName: barbican_rabbit + secret: osp-secret + passwordSelectors: + database: BarbicanDatabasePassword + service: BarbicanPassword + debug: + dbInitContainer: false + dbSync: false + initContainer: false + service: false + preserveJobs: true + nodeSelector: + node: controller + customServiceConfig: | + [DEFAULT] + debug = True + defaultConfigOverwrite: + policy.json: | + {"some": "custom policy"} + barbicanAPI: + containerImage: quay.io/podified-antelope-centos9/openstack-barbican-api:current-podified + nodeSelector: + optional_override: here + customServiceConfig: | + [optional] + overrides = True + defautlConfigOverwrite: + optional_policy.json: | + {"some": "custom policy"} + passwordSelectors: + database: BarbicanDatabasePassword + service: BarbicanPassword + barbicanWorker: + containerImage: quay.io/podified-antelope-centos9/openstack-barbican-worker:current-podified + nodeSelector: + optional_override: here + customServiceConfig: | + [optional] + overrides = True + defautlConfigOverwrite: + optional_policy.json: | + {"some": "custom policy"} + barbicanKeystoneListener: + containerImage: quay.io/podified-antelope-centos9/openstack-barbican-keystone-listener:current-podified + nodeSelector: + optional_override: here + customServiceConfig: | + [optional] + overrides = True + defautlConfigOverwrite: + optional_policy.json: | + {"some": "custom policy"} diff --git a/test/kuttl/tests/barbican_scale/deploy/kustomization.yaml b/test/kuttl/tests/barbican_scale/deploy/kustomization.yaml new file mode 100644 index 00000000..3cd2f0e3 --- /dev/null +++ b/test/kuttl/tests/barbican_scale/deploy/kustomization.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./barbican_v1beta1_barbican.yaml +patches: +- patch: |- + - op: replace + path: /spec/secret + value: osp-secret + - op: replace + path: /metadata/namespace + target: + kind: Barbican