Skip to content

Commit

Permalink
Merge pull request #286 from ashu-011/master
Browse files Browse the repository at this point in the history
add kuttl test to check dashboard reachability
  • Loading branch information
openshift-merge-bot[bot] authored Feb 20, 2024
2 parents 7715ca6 + de7bdef commit 40f475a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/kuttl/common/assert-sample-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,18 @@ spec:
LOGGING['handlers']['console']['level'] = 'DEBUG'
status:
readyCount: 1
---
# Test status code to check dashboard reachability
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
commands:
- script: |
set -x
RETURN_CODE=0
PUBLIC_URL=$(oc get -n $NAMESPACE horizon horizon -o jsonpath='{.status.endpoint}')
STATUSCODE=$(oc exec -it deployment/horizon -- curl --silent --output /dev/stderr --head --write-out "%{http_code}" "$PUBLIC_URL/dashboard/auth/login/?next=/dashboard/" -k)
if test $STATUSCODE -ne 200; then
RETURN_CODE=1
echo "${PUBLIC_URL} status code expected is 200 but was ${STATUSCODE}"
fi
exit $RETURN_CODE

0 comments on commit 40f475a

Please sign in to comment.