Skip to content

Commit

Permalink
Test both templates
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed Dec 4, 2023
1 parent 0dff11b commit effc0f0
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions test/test-lib-redis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,22 @@ source "${THISDIR}/test-lib-remote-openshift.sh"

function test_redis_integration() {
local service_name=redis
ct_os_test_template_app_func "${IMAGE_NAME}" \
"https://raw.githubusercontent.com/openshift/origin/master/examples/db-templates/redis-ephemeral-template.json" \
if [ "${OS}" == "rhel7" ]; then
namespace_image="rhscl/redis-${VERSION}-rhel7"
else
namespace_image="${OS}/redis-${VERSION}"
fi
TEMPLATES="redis-ephemeral-template.json
redis-persistent-template.json"
for template in $TEMPLATES; do
ct_os_test_template_app_func "${IMAGE_NAME}" \
"${THISDIR}/examples/${template}" \
"${service_name}" \
"ct_os_check_cmd_internal '<SAME_IMAGE>' '${service_name}-testing' 'timeout 15 redis-cli -h <IP> -a testp ping' 'PONG'" \
"ct_os_check_cmd_internal 'registry.redhat.io/${namespace_image}' '${service_name}-testing' 'timeout 15 redis-cli -h <IP> -a testp ping' 'PONG'" \
"-p REDIS_VERSION=${VERSION} \
-p DATABASE_SERVICE_NAME="${service_name}-testing" \
-p REDIS_PASSWORD=testp"
done
}

# Check the imagestream
Expand All @@ -35,7 +44,11 @@ function test_redis_imagestream() {
elif [ "${OS}" == "rhel9" ]; then
tag="-el9"
fi
ct_os_test_image_stream_template "${THISDIR}/imagestreams/redis-${OS%[0-9]*}.json" "${THISDIR}/examples/redis-ephemeral-template.json" redis "-p REDIS_VERSION=${VERSION}${tag}"
TEMPLATES="redis-ephemeral-template.json
redis-persistent-template.json"
for template in $TEMPLATES; do
ct_os_test_image_stream_template "${THISDIR}/imagestreams/redis-${OS%[0-9]*}.json" "${THISDIR}/examples/${template}" redis "-p REDIS_VERSION=${VERSION}${tag}"
done
}

function test_latest_imagestreams() {
Expand Down

0 comments on commit effc0f0

Please sign in to comment.