Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
ci.ocp: Improve the service-up detection
Browse files Browse the repository at this point in the history
waiting for the first response is not sufficient as OCP returns html
page without error even when the route is not yet established describing
the issue (why it doesn't reply with 500?). Waiting for the correct
output should do better.

Signed-off-by: Lukáš Doktor <[email protected]>
  • Loading branch information
ldoktor committed Feb 7, 2024
1 parent f15be37 commit 6669db0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .ci/openshift-ci/run_smoke_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,19 @@ else
fi

info "Wait for the HTTP server to respond"
rm -f hello_msg.txt
waitForProcess 60 1 "curl '${host}:${port}${hello_file}' -s -o hello_msg.txt"

grep "${hello_msg}" hello_msg.txt > /dev/null
test_status=$?
if [ $test_status -eq 0 ]; then
if waitForProcess 60 1 "curl '${host}:${port}${hello_file}' 2>/dev/null | grep -q '$hello_msg'"; then
test_status=0
info "HTTP server is working"
else
test_status=1
echo "::error:: HTTP server not working"
curl -vvv "${host}:${port}${hello_file}"
echo "::group::Describe kube-system namespace"
oc describe -n kube-system all
echo "::endgroup::"
echo "::group::Descibe current namespace"
oc describe all
echo "::endgroup::"
info "HTTP server is unreachable"
fi

Expand Down

0 comments on commit 6669db0

Please sign in to comment.