-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Barbican kuttl tests #46
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
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: | ||
name: barbican-api-api | ||
ownerReferences: | ||
- apiVersion: barbican.openstack.org/v1beta1 | ||
blockOwnerDeletion: true | ||
controller: true | ||
kind: BarbicanAPI | ||
name: barbican-api | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: barbican-keystone-listener-keystone-listener | ||
ownerReferences: | ||
- apiVersion: barbican.openstack.org/v1beta1 | ||
blockOwnerDeletion: true | ||
controller: true | ||
kind: BarbicanKeystoneListener | ||
name: barbican-keystone-listener | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: barbican-worker-worker | ||
ownerReferences: | ||
- apiVersion: barbican.openstack.org/v1beta1 | ||
blockOwnerDeletion: true | ||
controller: true | ||
kind: BarbicanWorker | ||
name: barbican-worker | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need these deployment objects to be defined here? Isn't it sufficient to simply have the first stanza (lines 1-18) I think we specifically say NOT to deploy the sub-components - which is why we add the top level component to the finalizers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vakwetu
Which approach should we choose? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused -- why wouldn't we have to redeploy the components after the scale to zero test? Maybe thats precisely the point here - when you add an additional deployments, its not altogether clear what we are deploying. As for the above question, there is option 3 - which is to make the scale to zero test the last test. Then you won't have to deploy. Or you can do a scale up test after the scale down test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "scale down to zero" test is already the last one. It makes sense to be like this. On the local environment I'm using to test the tests, they are running on the same namespace where the other CRs are deployed (Memcached, Redis, RabbitMQ, ...) since to be able to work, they need such components to be present at first. I said we need to manually redeploy the components simply because the "scale down to zero" test deletes them. May I understand we won't need the CRs after they are deleted, considering the namespace statement above? I think a quick sync on this would be better than exchanging comments here. :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we discussed, I realized while we chatted that this is an assert-file. So everything I said about removing the deployments is wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So keep them, but also make sure to test using install_yamls. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../common/assert_sample_deployment.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 - |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# | ||
# Check for: | ||
# - Barbican CRs with 2 replicas for each one | ||
# - BarbicanAPI barbican-api Deployment with 2 replicas | ||
# - BarbicanKeystoneListener barbican-keystone-listener Deployment with 2 replicas | ||
# - BarbicanWorker barbican-worker Deployment with 2 replicas | ||
|
||
|
||
apiVersion: barbican.openstack.org/v1beta1 | ||
kind: Barbican | ||
metadata: | ||
name: barbican | ||
spec: | ||
barbicanAPI: | ||
replicas: 2 | ||
barbicanKeystoneListener: | ||
replicas: 2 | ||
barbicanWorker: | ||
replicas: 2 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: barbican-api-api | ||
spec: | ||
replicas: 2 | ||
status: | ||
availableReplicas: 2 | ||
replicas: 2 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: barbican-keystone-listener-keystone-listener | ||
spec: | ||
replicas: 2 | ||
status: | ||
availableReplicas: 2 | ||
replicas: 2 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: barbican-worker-worker | ||
spec: | ||
replicas: 2 | ||
status: | ||
availableReplicas: 2 | ||
replicas: 2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
oc patch Barbican -n $NAMESPACE barbican --type='json' -p='[{"op": "replace", "path": "/spec/barbicanAPI/replicas", "value":2}]' | ||
oc patch Barbican -n $NAMESPACE barbican --type='json' -p='[{"op": "replace", "path": "/spec/barbicanKeystoneListener/replicas", "value":2}]' | ||
oc patch Barbican -n $NAMESPACE barbican --type='json' -p='[{"op": "replace", "path": "/spec/barbicanWorker/replicas", "value":2}]' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# | ||
# Check for: | ||
# - Barbican CRs with12 replicas for each one | ||
# - BarbicanAPI barbican-api Deployment with 1 replica | ||
# - BarbicanKeystoneListener barbican-keystone-listener Deployment with 1 replica | ||
# - BarbicanWorker barbican-worker Deployment with 1 replica | ||
|
||
|
||
apiVersion: barbican.openstack.org/v1beta1 | ||
kind: Barbican | ||
metadata: | ||
name: barbican | ||
spec: | ||
barbicanAPI: | ||
replicas: 1 | ||
barbicanKeystoneListener: | ||
replicas: 1 | ||
barbicanWorker: | ||
replicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: barbican-api-api | ||
spec: | ||
replicas: 1 | ||
status: | ||
availableReplicas: 1 | ||
replicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: barbican-keystone-listener-keystone-listener | ||
spec: | ||
replicas: 1 | ||
status: | ||
availableReplicas: 1 | ||
replicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: barbican-worker-worker | ||
spec: | ||
replicas: 1 | ||
status: | ||
availableReplicas: 1 | ||
replicas: 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
oc patch Barbican -n $NAMESPACE barbican --type='json' -p='[{"op": "replace", "path": "/spec/barbicanAPI/replicas", "value":1}]' | ||
oc patch Barbican -n $NAMESPACE barbican --type='json' -p='[{"op": "replace", "path": "/spec/barbicanKeystoneListener/replicas", "value":1}]' | ||
oc patch Barbican -n $NAMESPACE barbican --type='json' -p='[{"op": "replace", "path": "/spec/barbicanWorker/replicas", "value":1}]' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# | ||
# Check for: | ||
# - Barbican CRs with 0 replicas for each one | ||
# - BarbicanAPI barbican-api Deployment with 0 replicas | ||
# - BarbicanKeystoneListener barbican-keystone-listener Deployment with 0 replicas | ||
# - BarbicanWorker barbican-worker Deployment with 0 replicas | ||
|
||
|
||
apiVersion: barbican.openstack.org/v1beta1 | ||
kind: Barbican | ||
metadata: | ||
name: barbican | ||
spec: | ||
barbicanAPI: | ||
replicas: 0 | ||
barbicanKeystoneListener: | ||
replicas: 0 | ||
barbicanWorker: | ||
replicas: 0 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: barbican-api-api | ||
spec: | ||
replicas: 0 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: barbican-keystone-listener-keystone-listener | ||
spec: | ||
replicas: 0 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: barbican-worker-worker | ||
spec: | ||
replicas: 0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
oc patch Barbican -n $NAMESPACE barbican --type='json' -p='[{"op": "replace", "path": "/spec/barbicanAPI/replicas", "value":0}]' | ||
oc patch Barbican -n $NAMESPACE barbican --type='json' -p='[{"op": "replace", "path": "/spec/barbicanKeystoneListener/replicas", "value":0}]' | ||
oc patch Barbican -n $NAMESPACE barbican --type='json' -p='[{"op": "replace", "path": "/spec/barbicanWorker/replicas", "value":0}]' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: blank space at end of the line