From bdd0e996421b8614bbf9b8826fe4ae165a6e5165 Mon Sep 17 00:00:00 2001 From: Alfredo Moralejo Date: Tue, 14 Jan 2025 19:31:49 +0100 Subject: [PATCH] fix command execution in kuttl assert for case 01 We are defining the command in the TestAssert twice and the second one is just overriding the first one which is never executed. This patch is merging both in just one assignment which is what kuttl tests definition seems to expect. --- .../kuttl/test-suites/default/watcher/01-assert.yaml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/kuttl/test-suites/default/watcher/01-assert.yaml b/tests/kuttl/test-suites/default/watcher/01-assert.yaml index 3dc9302..8837c8a 100644 --- a/tests/kuttl/test-suites/default/watcher/01-assert.yaml +++ b/tests/kuttl/test-suites/default/watcher/01-assert.yaml @@ -258,16 +258,9 @@ commands: set -euxo pipefail oc exec -n watcher-kuttl-default openstackclient -- openstack service list -f value -c Name -c Type |[ $(grep -c ^watcher) == 1 ] 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 ] + [ $(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})" ] ---- -# Check for Container Image environment variables -apiVersion: kuttl.dev/v1beta1 -kind: TestAssert -commands: - - script: | - set -euxo pipefail - # If we are running the container locally, skip this test + # 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 fi