Skip to content

Commit

Permalink
Fix all kuttl asserts
Browse files Browse the repository at this point in the history
These tests were not running, and need fixing either due to changes in
endpoint names, or incorrect regex patterns.
  • Loading branch information
steveb committed May 15, 2024
1 parent 4d8c070 commit 9bcebfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/kuttl/common/assert-endpoints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions tests/kuttl/tests/deploy_tls/10-assert-deploy-ironic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9bcebfa

Please sign in to comment.