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

Commit

Permalink
Merge pull request #5807 from ldoktor/ocp-curl-fix
Browse files Browse the repository at this point in the history
ci.ocp: Improve the service-up detection
  • Loading branch information
wainersm authored Feb 22, 2024
2 parents f15be37 + 9060e93 commit 8589ea7
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .ci/openshift-ci/run_smoke_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,26 @@ 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
tempfile=$(mktemp)
check_cmd="curl -vvv '${host}:${port}${hello_file}' 2>&1 | tee -a '$tempfile' | grep -q '$hello_msg'"
if waitForProcess 60 1 "${check_cmd}"; then
test_status=0
info "HTTP server is working"
else
test_status=1
echo "::error:: HTTP server not working"
echo "::group::Output of the \"curl -vvv '${host}:${port}${hello_file}'\""
cat "${tempfile}"
echo "::endgroup::"
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
rm -f "$tempfile"

# Delete the resources.
#
Expand Down

0 comments on commit 8589ea7

Please sign in to comment.