From 81a0d4a4925353ec5f3a6bd2ab11be837d0cde67 Mon Sep 17 00:00:00 2001 From: Ash Date: Thu, 6 Jun 2024 16:26:54 -0700 Subject: [PATCH] feat: Switch test to leverage test_http_endpoint. --- metadata/metadata | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/metadata/metadata b/metadata/metadata index f950fb6..918d158 100644 --- a/metadata/metadata +++ b/metadata/metadata @@ -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 }