Skip to content

Commit

Permalink
feat: Switch test to leverage test_http_endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuxdude committed Jun 6, 2024
1 parent 754fe19 commit 81a0d4a
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions metadata/metadata
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,5 @@ test_start_container() {

test_image_after_container_startup() {
local container_name="${1:?}"

set +e
local http_status_code=$(\
curl -w "%{http_code}" --silent --output /dev/null --location http://127.0.0.1:8082/)
local return_code=$?
set -e

if [[ $return_code != "0" ]]; then
echo "Test failed: Obtained non-zero return code"
echo "Output: ${http_status_code}"
echo "Return Code: ${return_code}"
test_cleanup_container ${container_name:?}
exit 1
fi
if [[ ${http_status_code:?} != "200" ]]; then
echo "Test failed: Status code is not 200"
echo "Output: ${http_status_code}"
echo "Return Code: ${return_code}"
test_cleanup_container ${container_name:?}
exit 1
fi
test_http_endpoint "${container_name:?}" http 127.0.0.1 8082
}

0 comments on commit 81a0d4a

Please sign in to comment.