From 1e271d8d077833ceed1bc0fcb1eb9629ea5ea410 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 3 Jul 2024 09:22:27 +0200 Subject: [PATCH] Fix image_availability test. add echo in case test passed Signed-off-by: Petr "Stone" Hracek --- tests/failures/check/v0/Dockerfile.c10s | 2 +- tests/test-lib/image_availability | 22 +++++++++++++++++++--- tests/test-lib/public_image_name | 4 ++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/failures/check/v0/Dockerfile.c10s b/tests/failures/check/v0/Dockerfile.c10s index 4e90409..7034314 100644 --- a/tests/failures/check/v0/Dockerfile.c10s +++ b/tests/failures/check/v0/Dockerfile.c10s @@ -1,2 +1,2 @@ -FROM quay.io/sclorg/s2i-core-c10s +FROM quay.io/sclorg/s2i-core-c9s LABEL name=test-image diff --git a/tests/test-lib/image_availability b/tests/test-lib/image_availability index 2406aa7..f725e01 100755 --- a/tests/test-lib/image_availability +++ b/tests/test-lib/image_availability @@ -5,21 +5,37 @@ set -e . test-lib.sh # This should succeed -if ! ct_pull_image quay.io/sclorg/ruby-27-c9s:c9s; then +if ! ct_pull_image quay.io/sclorg/mysql-80-c9s:c9s; then echo "image_availability test failed" false +else + echo "image_availability test passed for 'ct_pull_image quay.io/sclorg/mysql-80-c9s:c9s'" fi # This should fail -if ct_pull_image quay.io/sclorg/ruby-24-c9s:c9s false 1; then +if ct_pull_image quay.io/sclorg/postgresql-96-c9s:c9s false 1; then echo "image_availability test failed" false +else + echo "image_availability test passed for 'ct_pull_image quay.io/sclorg/postgresql-96-c9s:c9s false 1'" fi # This should succeed -if ! ct_check_image_availability quay.io/sclorg/python-27-c9s:c9s; then +if ! ct_check_image_availability quay.io/sclorg/postgresql-15-c9s:c9s; then echo "check_image_availability test failed" false +else + echo "check_image_availability test passed for 'ct_check_image_availability quay.io/sclorg/postgresql-15-c9s:c9s'" fi +# This should fail +if ct_check_image_availability quay.io/sclorg/python-27-c9s:c9s; then + echo "check_image_availability test failed" + false +else + echo "check_image_availability test passed for 'ct_check_image_availability quay.io/sclorg/python-27-c9s:c9s'" +fi + + + echo "image_availability test completed successfully." diff --git a/tests/test-lib/public_image_name b/tests/test-lib/public_image_name index 00c2d16..e9cd647 100755 --- a/tests/test-lib/public_image_name +++ b/tests/test-lib/public_image_name @@ -4,13 +4,13 @@ set -e . test-lib.sh -combinations="c9s:quay.io/c9s/postgresql-15-c9s:c9s +combinations="c9s:quay.io/sclorg/postgresql-15-c9s rhel8:registry.redhat.io/rhel8/postgresql-15 rhel9:registry.redhat.io/rhel9/postgresql-15 " for c in $combinations; do - public_name=$(ct_get_public_image_name "${c%%:*}" postgresql 10) + public_name=$(ct_get_public_image_name "${c%%:*}" postgresql 15) [ "$public_name" == "${c#*:}" ] done