Pull changes from upstream repository.

This commit is contained in:
Marek Skalický 2018-10-29 09:36:11 +00:00
commit 8de2f6ec06
No known key found for this signature in database
GPG key ID: ADCAA1DEE100A66D
28 changed files with 2262 additions and 129 deletions

View file

@ -6,14 +6,21 @@
# IMAGE_NAME specifies a name of the candidate image used for testing.
# The image has to be available before this script is executed.
#
IMAGE_NAME=${IMAGE_NAME:-openshift/python-36-centos7-candidate}
declare -a WEB_APPS=({standalone,setup,django,numpy,app-home,virtualenv-uwsgi,locale,mod-wsgi}-test-app)
declare -a WEB_APPS=({standalone,setup,setup-requirements,django,numpy,app-home,npm-virtualenv-uwsgi,locale,mod-wsgi,pipenv}-test-app)
# TODO: Make command compatible for Mac users
test_dir="$(readlink -zf $(dirname "${BASH_SOURCE[0]}"))"
image_dir=$(readlink -zf ${test_dir}/..)
if [[ -z $VERSION ]]; then
echo "ERROR: The VERSION variable must be set."
exit 1
fi
IMAGE_NAME=${IMAGE_NAME:-centos/python-${VERSION//./}-centos7}
. test/test-lib.sh
# TODO: This should be part of the image metadata
test_port=8080
@ -35,7 +42,7 @@ container_ip() {
run_s2i_build() {
info "Building the ${1} application image ..."
s2i build ${s2i_args} file://${test_dir}/${1} ${IMAGE_NAME} ${IMAGE_NAME}-testapp
ct_s2i_build_as_df file://${test_dir}/${1} ${IMAGE_NAME} ${IMAGE_NAME}-testapp ${s2i_args}
}
prepare() {
@ -98,7 +105,7 @@ wait_for_cid() {
test_s2i_usage() {
info "Testing 's2i usage' ..."
s2i usage ${s2i_args} ${IMAGE_NAME} &>/dev/null
ct_s2i_usage ${IMAGE_NAME} ${s2i_args} 1>/dev/null
}
test_docker_run_usage() {
@ -158,7 +165,11 @@ test_application() {
# Wait for the container to write it's CID file
wait_for_cid
test_scl_usage "python --version" "Python 3.6." "${cid_file}"
test_scl_usage "python --version" "Python $VERSION." "${cid_file}"
check_result $?
test_scl_usage "node --version" "^v[0-9]*\.[0-9]*\.[0-9]*" "${cid_file}"
check_result $?
test_scl_usage "npm --version" "^[0-9]*\.[0-9]*\.[0-9]*" "${cid_file}"
check_result $?
test_connection
check_result $?
@ -168,7 +179,7 @@ test_application() {
# Since we built the candidate image locally, we don't want S2I attempt to pull
# it from Docker hub
s2i_args="--force-pull=false"
s2i_args="--pull-policy=never"
# Verify the 'usage' script is working properly when running the base image with 's2i usage ...'
test_s2i_usage
@ -187,7 +198,7 @@ for app in ${WEB_APPS[@]}; do
test_application
# test application with random user
CONTAINER_ARGS="-u 12345" test_application
CONTAINER_ARGS="--user 12345" test_application
info "All tests for the ${app} finished successfully."
cleanup ${app}