Skip to content

Commit 7ca018b

Browse files
committed
Add tests to kuttl scenarios to test TLS backends config
This patch checks proper values of config files for TLS enablement.
1 parent 57fcd16 commit 7ca018b

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

config/samples/watcher_v1beta1_watcher.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ metadata:
1010
name: watcher
1111
spec:
1212
databaseInstance: "openstack"
13+
tls:
14+
caBundleSecretName: "combined-ca-bundle"

tests/kuttl/test-suites/default/common/deploy-with-defaults.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ metadata:
55
namespace: watcher-kuttl-default
66
spec:
77
databaseInstance: "openstack"
8+
tls:
9+
caBundleSecretName: "combined-ca-bundle"

tests/kuttl/test-suites/default/watcher/01-assert.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ commands:
324324
SERVICEID=$(oc exec -n watcher-kuttl-default openstackclient -- openstack service list -f value -c Name -c Type -c ID | grep watcher| awk '{print $1}')
325325
[ $(oc get -n watcher-kuttl-default keystoneservice watcher -o jsonpath={.status.serviceID}) == ${SERVICEID} ]
326326
[ -n "$(oc get -n watcher-kuttl-default watcher watcher-kuttl -o jsonpath={.status.hash.dbsync})" ]
327+
[ "$(oc get -n watcher-kuttl-default secret watcher-kuttl-api-config-data -o jsonpath='{.data.my\.cnf}'|base64 -d|grep -c 'ssl=1')" == 1 ]
328+
[ "$(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 ]
327329
# If we are running the container locally, skip following test
328330
if [ "$(oc get pods -n openstack-operators -o name -l openstack.org/operator-name=watcher)" == "" ]; then
329331
exit 0

tests/kuttl/test-suites/default/watcher/04-deploy-with-precreated-account.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ spec:
88
databaseAccount: watcher-precreated
99
apiServiceTemplate:
1010
replicas: 2
11+
tls:
12+
caBundleSecretName: "combined-ca-bundle"

0 commit comments

Comments
 (0)