Skip to content

Commit

Permalink
Fix image_availability test.
Browse files Browse the repository at this point in the history
add echo in case test passed

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed Jul 4, 2024
1 parent 91e70d1 commit 1e271d8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/failures/check/v0/Dockerfile.c10s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM quay.io/sclorg/s2i-core-c10s
FROM quay.io/sclorg/s2i-core-c9s
LABEL name=test-image
22 changes: 19 additions & 3 deletions tests/test-lib/image_availability
Original file line number Diff line number Diff line change
Expand Up @@ -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."
4 changes: 2 additions & 2 deletions tests/test-lib/public_image_name
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1e271d8

Please sign in to comment.