Skip to content

Commit

Permalink
Add tests to kuttl scenarios to test TLS backends config
Browse files Browse the repository at this point in the history
This patch checks proper values of config files for TLS enablement.
  • Loading branch information
amoralej authored and openshift-merge-bot[bot] committed Jan 23, 2025
1 parent c484842 commit b29a0ac
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/samples/watcher_v1beta1_watcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ metadata:
name: watcher
spec:
databaseInstance: "openstack"
tls:
caBundleSecretName: "combined-ca-bundle"
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ metadata:
namespace: watcher-kuttl-default
spec:
databaseInstance: "openstack"
tls:
caBundleSecretName: "combined-ca-bundle"
2 changes: 2 additions & 0 deletions tests/kuttl/test-suites/default/watcher/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ commands:
SERVICEID=$(oc exec -n watcher-kuttl-default openstackclient -- openstack service list -f value -c Name -c Type -c ID | grep watcher| awk '{print $1}')
[ $(oc get -n watcher-kuttl-default keystoneservice watcher -o jsonpath={.status.serviceID}) == ${SERVICEID} ]
[ -n "$(oc get -n watcher-kuttl-default watcher watcher-kuttl -o jsonpath={.status.hash.dbsync})" ]
[ "$(oc get -n watcher-kuttl-default secret watcher-kuttl-api-config-data -o jsonpath='{.data.my\.cnf}'|base64 -d|grep -c 'ssl=1')" == 1 ]
[ "$(oc get -n watcher-kuttl-default secret watcher-kuttl-api-config-data -o jsonpath='{.data.00-default\.conf}'|base64 -d|grep -c 'cafile = /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem')" == 2 ]
# If we are running the container locally, skip following test
if [ "$(oc get pods -n openstack-operators -o name -l openstack.org/operator-name=watcher)" == "" ]; then
exit 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ spec:
databaseAccount: watcher-precreated
apiServiceTemplate:
replicas: 2
tls:
caBundleSecretName: "combined-ca-bundle"

0 comments on commit b29a0ac

Please sign in to comment.