From 9bcebfaf49af47524664359484b9205349cf486a Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Tue, 14 May 2024 12:26:16 +1200 Subject: [PATCH] Fix all kuttl asserts These tests were not running, and need fixing either due to changes in endpoint names, or incorrect regex patterns. --- tests/kuttl/common/assert-endpoints.yaml | 4 ++-- tests/kuttl/tests/deploy_tls/10-assert-deploy-ironic.yaml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/kuttl/common/assert-endpoints.yaml b/tests/kuttl/common/assert-endpoints.yaml index 85163fc9..19bfd1e9 100644 --- a/tests/kuttl/common/assert-endpoints.yaml +++ b/tests/kuttl/common/assert-endpoints.yaml @@ -15,7 +15,7 @@ commands: - script: | set -euxo pipefail template='{{.status.apiEndpoints.ironic.public}}{{":"}}{{.status.apiEndpoints.ironic.internal}}{{"\n"}}' - regex="http:\/\/ironic-public-$NAMESPACE\.apps.*:http:\/\/ironic-admin-$NAMESPACE\.apps.*:http:\/\/ironic-internal-$NAMESPACE\.apps.*" + regex="http:\/\/ironic-public\.$NAMESPACE\..*:http:\/\/ironic-internal\.$NAMESPACE\..*" apiEndpoints=$(oc get -n $NAMESPACE ironics.ironic.openstack.org ironic -o go-template="$template") matches=$(echo "$apiEndpoints" | sed -e "s?$regex??") if [ -z "$matches" ]; then @@ -30,7 +30,7 @@ commands: - script: | set -euxo pipefail template='{{index .status.apiEndpoints "ironic-inspector" "public"}}{{":"}}{{index .status.apiEndpoints "ironic-inspector" "internal"}}{{"\n"}}' - regex="http:\/\/ironic-inspector-public-$NAMESPACE\.apps.*:http:\/\/ironic-inspector-admin-$NAMESPACE\.apps.*:http:\/\/ironic-inspector-internal-$NAMESPACE\.apps.*" + regex="http:\/\/ironic-inspector-public\.$NAMESPACE\..*:http:\/\/ironic-inspector-internal\.$NAMESPACE\..*" apiEndpoints=$(oc get -n $NAMESPACE ironics.ironic.openstack.org ironic -o go-template="$template") matches=$(echo "$apiEndpoints" | sed -e "s?$regex??") if [ -z "$matches" ]; then diff --git a/tests/kuttl/tests/deploy_tls/10-assert-deploy-ironic.yaml b/tests/kuttl/tests/deploy_tls/10-assert-deploy-ironic.yaml index d53ad274..a5912910 100644 --- a/tests/kuttl/tests/deploy_tls/10-assert-deploy-ironic.yaml +++ b/tests/kuttl/tests/deploy_tls/10-assert-deploy-ironic.yaml @@ -109,7 +109,7 @@ commands: - script: | set -euxo pipefail template='{{.spec.endpoints.internal}}{{":"}}{{.spec.endpoints.public}}{{"\n"}}' - regex="https:\/\/ironic-internal.$NAMESPACE.*:https:\/\/ironic-public.$NAMESPACE.*" + regex="https:\/\/ironic-internal\.$NAMESPACE\..*:https:\/\/ironic-public\.$NAMESPACE\..*" apiEndpoints=$(oc get -n $NAMESPACE KeystoneEndpoint ironic -o go-template="$template") matches=$(echo "$apiEndpoints" | sed -e "s?$regex??") if [[ -n "$matches" ]]; then @@ -118,10 +118,11 @@ commands: # the actual addresses of the api endpoints are platform specific, so we can't rely on # kuttl asserts to check them. This short script gathers the addresses and checks that # the two endpoints are defined and their addresses follow the default pattern +# TODO(sbaker) switch the regex back to https as part of https://issues.redhat.com/browse/OSPRH-7038 - script: | set -euxo pipefail template='{{.spec.endpoints.internal}}{{":"}}{{.spec.endpoints.public}}{{"\n"}}' - regex="https:\/\/ironic-inspector-internal.$NAMESPACE.*:https:\/\/ironic-inspector-public.$NAMESPACE.*" + regex="http:\/\/ironic-inspector-internal\.$NAMESPACE\..*:http:\/\/ironic-inspector-public\.$NAMESPACE\..*" apiEndpoints=$(oc get -n $NAMESPACE KeystoneEndpoint ironic-inspector -o go-template="$template") matches=$(echo "$apiEndpoints" | sed -e "s?$regex??") if [[ -n "$matches" ]]; then