Merge pull request #525 from sclorg/use_internal_openshift_registry

Use internal openshift registry
This commit is contained in:
phracek 2022-06-14 09:37:22 +00:00
commit 3e1d82ec39
12 changed files with 471 additions and 242 deletions

View file

@ -13,8 +13,14 @@ source "${THISDIR}/test-lib-openshift.sh"
source "${THISDIR}/test-lib-python.sh"
source "${THISDIR}/test-lib-remote-openshift.sh"
set -eo nounset
TEST_LIST="\
test_python_s2i_app_ex_standalone
test_python_s2i_app_ex
test_python_imagestream
test_python_s2i_templates
"
set -u
# Pull image before going throw tests
# Exit in case of failure
ct_pull_image "quay.io/centos7/postgresql-10-centos7" "true"
@ -28,45 +34,14 @@ ct_os_check_compulsory_vars
oc status || false "It looks like oc is not properly logged in."
# For testing on OpenShift 4 we use internal registry
export CT_EXTERNAL_REGISTRY=true
export CT_OCP4_TEST=true
test -n "${IMAGE_NAME-}" || false 'make sure $IMAGE_NAME is defined'
test -n "${VERSION-}" || false 'make sure $VERSION is defined'
if [ -z "${EPHEMERAL_TEMPLATES:-}" ]; then
EPHEMERAL_TEMPLATES="
https://raw.githubusercontent.com/sclorg/django-ex/master/openshift/templates/django-postgresql.json \
https://raw.githubusercontent.com/openshift/origin/master/examples/quickstarts/django-postgresql.json"
fi
ct_os_test_s2i_app "${IMAGE_NAME}" "https://github.com/sclorg/s2i-python-container.git" "examples/standalone-test-app" "Hello World from standalone WSGI application!"
if [[ ${VERSION} == "2.7" ]] || docker inspect ${IMAGE_NAME} --format "{{.Config.Env}}" | tr " " "\n" | grep -q "^PLATFORM=el7"; then
django_example_repo_url="https://github.com/sclorg/django-ex.git"
else
django_example_repo_url="https://github.com/sclorg/django-ex.git#2.2.x"
fi
ct_os_test_s2i_app "${IMAGE_NAME}" "${django_example_repo_url}" . 'Welcome to your Django application on OpenShift'
for template in $EPHEMERAL_TEMPLATES; do
if [[ ${VERSION} == "2.7" ]] || docker inspect ${IMAGE_NAME} --format "{{.Config.Env}}" | tr " " "\n" | grep -q "^PLATFORM=el7"; then
branch="master"
else
branch="2.2.x"
fi
ct_os_test_template_app "$IMAGE_NAME" \
"$template" \
python \
'Welcome to your Django application on OpenShift' \
8080 http 200 "-p SOURCE_REPOSITORY_REF=$branch -p PYTHON_VERSION=${VERSION} -p POSTGRESQL_VERSION=10 -p NAME=python-testing" \
"quay.io/centos7/postgresql-10-centos7|postgresql:10"
done
# Check the imagestream
test_python_imagestream
OS_TESTSUITE_RESULT=0
TEST_SUMMARY=''
TEST_SET=${TESTS:-$TEST_LIST} ct_run_tests_from_testset "openshift-remote-cluster"
# vim: set tabstop=2:shiftwidth=2:expandtab: