Skip to content

Commit

Permalink
Merge pull request #5 from jparoly/add_kuttl
Browse files Browse the repository at this point in the history
Add kuttl tests
  • Loading branch information
dmendiza committed May 19, 2023
2 parents 4f2fe35 + 909d00e commit 4ffa6d8
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
23 changes: 23 additions & 0 deletions kuttl-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# EXECUTION (from install_yamls repo root):
#
# make barbican_kuttl
#
# ASSUMPTIONS:
#
# 1. Latest version of kuttl is installed at /usr/local/bin/kubectl-kuttl
# - wget https://github.com/kudobuilder/kuttl/releases/download/v0.11.1/kubectl-kuttl_0.11.1_linux_x86_64
# - mv kubectl-kuttl_0.11.1_linux_x86_64 /usr/local/bin/kubectl-kuttl
# - 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

apiVersion: kuttl.dev/v1beta1
kind: TestSuite
reportFormat: JSON
reportName: kuttl-test-barbican
timeout: 180
namespace: openstack
parallel: 1
suppress:
- events # Remove spammy event logs
66 changes: 66 additions & 0 deletions tests/kuttl/common/assert-sample-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apiVersion: barbican.openstack.org/v1beta1
kind: Barbican
metadata:
labels:
app.kubernetes.io/name: barbican
app.kubernetes.io/instance: barbican-sample
app.kubernetes.io/part-of: barbican-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: barbican-operator
name: barbican-sample
spec:
serviceUser: barbican
databaseInstance: some_string
databaseUser: barbican
rabbitMqCusterName: barbican_rabbit
secret: barbican-secret
passwordSelectors:
database: BarbicanDatabasePassword
service: BarbicanServiceUserPassword
debug:
dbInitContainer: true
dbSync: true
initContainer: true
service: true
preserveJobs: true
nodeSelector:
node: controller
customServiceConfig: |
[DEFAULT]
debug = True
defaultConfigOverwrite:
policy.json: |
{"some": "custom policy"}
barbicanAPI:
containerImage: some_image
nodeSelector:
optional_override: here
replicas: 10
customServiceConfig: |
[optional]
overrides = True
defautlConfigOverwrite:
optional_policy.json: |
{"some": "custom policy"}
networkAttachments:
- internal
externalEndpoints:
- endpoint:
ipAddressPool: some_ip_string
sharedIP: true
sharedIPKey: some_key_string
loadBalancerIPs:
- some_ip_string
barbicanWorker:
containerImage: some_image
nodeSelector:
optional_override: here
replicas: 10
customServiceConfig: |
[optional]
overrides = True
defautlConfigOverwrite:
optional_policy.json: |
{"some": "custom policy"}
networkAttachments:
- internal
5 changes: 5 additions & 0 deletions tests/kuttl/tests/basic-deployment/01-deploy-barbican.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
oc apply -n openstack -f ../../../../config/samples/barbican_v1beta1_barbican.yaml

0 comments on commit 4ffa6d8

Please sign in to comment.