-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #265 from omersch381/add_kuttl_tests
Improve Kuttl testing coverage
- Loading branch information
Showing
16 changed files
with
724 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
apiVersion: designate.openstack.org/v1beta1 | ||
kind: Designate | ||
metadata: | ||
name: designate | ||
spec: | ||
databaseInstance: openstack | ||
databaseAccount: designate | ||
serviceUser: designate | ||
secret: osp-secret | ||
preserveJobs: false | ||
designateAPI: | ||
replicas: 1 | ||
designateCentral: | ||
replicas: 1 | ||
designateWorker: | ||
replicas: 1 | ||
designateProducer: | ||
replicas: 1 | ||
designateUnbound: | ||
replicas: 1 | ||
customServiceConfig: | | ||
[DEFAULT] | ||
debug = true | ||
status: | ||
designateAPIReadyCount: 1 | ||
designateBackendbind9ReadyCount: 1 | ||
designateCentralReadyCount: 1 | ||
designateMdnsReadyCount: 1 | ||
designateProducerReadyCount: 1 | ||
designateUnboundReadyCount: 1 | ||
designateWorkerReadyCount: 1 | ||
databaseHostname: openstack.designate-kuttl-tests.svc | ||
conditions: | ||
- message: Setup complete | ||
reason: Ready | ||
status: "True" | ||
type: Ready | ||
- message: DB create completed | ||
reason: Ready | ||
status: "True" | ||
type: DBReady | ||
- message: DBsync completed | ||
reason: Ready | ||
status: "True" | ||
type: DBSyncReady | ||
- message: Setup complete | ||
reason: Ready | ||
status: "True" | ||
type: DesignateAPIReady | ||
- message: Setup complete | ||
reason: Ready | ||
status: "True" | ||
type: DesignateBackendbind9Ready | ||
- message: Setup complete | ||
reason: Ready | ||
status: "True" | ||
type: DesignateCentralReady | ||
- message: Setup complete | ||
reason: Ready | ||
status: "True" | ||
type: DesignateMdnsReady | ||
- message: Setup complete | ||
reason: Ready | ||
status: "True" | ||
type: DesignateProducerReady | ||
- message: DesignateRabbitMqTransportURL successfully created | ||
reason: Ready | ||
status: "True" | ||
type: DesignateRabbitMqTransportURLReady | ||
- message: Setup complete | ||
reason: Ready | ||
status: "True" | ||
type: DesignateUnboundReady | ||
- message: Setup complete | ||
reason: Ready | ||
status: "True" | ||
type: DesignateWorkerReady | ||
- message: Input data complete | ||
reason: Ready | ||
status: "True" | ||
type: InputReady | ||
- message: MariaDBAccount creation complete | ||
reason: Ready | ||
status: "True" | ||
type: MariaDBAccountReady | ||
- message: NetworkAttachments completed | ||
reason: Ready | ||
status: "True" | ||
type: NetworkAttachmentsReady | ||
- message: RoleBinding created | ||
reason: Ready | ||
status: "True" | ||
type: RoleBindingReady | ||
- message: Role created | ||
reason: Ready | ||
status: "True" | ||
type: RoleReady | ||
- message: ServiceAccount created | ||
reason: Ready | ||
status: "True" | ||
type: ServiceAccountReady | ||
- message: Service config create completed | ||
reason: Ready | ||
status: "True" | ||
type: ServiceConfigReady | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
endpoint: internal | ||
service: designate | ||
name: designate-internal | ||
spec: | ||
ports: | ||
- name: designate-internal | ||
selector: | ||
service: designate | ||
type: ClusterIP | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
endpoint: public | ||
service: designate | ||
name: designate-public | ||
spec: | ||
ports: | ||
- name: designate-public | ||
selector: | ||
service: designate | ||
type: ClusterIP | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: | | ||
tupleTemplate='{{ range (index .spec.template.spec.containers 1).env }}{{ .name }}{{ "#" }}{{ .value}}{{"\n"}}{{ end }}' | ||
imageTuples=$(oc get -n openstack-operators deployment designate-operator-controller-manager -o go-template="$tupleTemplate") | ||
for ITEM in $(echo $imageTuples); do | ||
# it is an image | ||
if echo $ITEM | grep 'RELATED_IMAGE' &> /dev/null; then | ||
NAME=$(echo $ITEM | sed -e 's|^RELATED_IMAGE_DESIGNATE_\([^_]*\)_.*|\1|') | ||
IMG_FROM_ENV=$(echo $ITEM | sed -e 's|^.*#\(.*\)|\1|') | ||
case $NAME in | ||
API) | ||
template='{{.spec.designateAPI.containerImage}}' | ||
;; | ||
CENTRAL) | ||
template='{{.spec.designateCentral.containerImage}}' | ||
;; | ||
MDNS) | ||
template='{{.spec.designateMdns.containerImage}}' | ||
;; | ||
PRODUCER) | ||
template='{{.spec.designateProducer.containerImage}}' | ||
;; | ||
WORKER) | ||
template='{{.spec.designateWorker.containerImage}}' | ||
;; | ||
BACKENDBIND9) | ||
template='{{.spec.designateBackendbind9.containerImage}}' | ||
;; | ||
UNBOUND) | ||
template='{{.spec.designateUnbound.containerImage}}' | ||
;; | ||
esac | ||
SERVICE_IMAGE=$(oc get -n $NAMESPACE designate designate -o go-template="$template") | ||
if [ "$SERVICE_IMAGE" != "$IMG_FROM_ENV" ]; then | ||
echo "$NAME image does not equal $IMG_FROM_ENV (its current value is $SERVICE_IMAGE)" | ||
exit 1 | ||
fi | ||
fi | ||
done | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: k8s.cni.cncf.io/v1 | ||
kind: NetworkAttachmentDefinition | ||
metadata: | ||
name: designate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
cp ../../common/designate_nad.yaml . | ||
oc apply -n $NAMESPACE -f designate_nad.yaml |
Oops, something went wrong.