26 lines
756 B
Bash
Executable file
26 lines
756 B
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# The 'run' performs a simple test that verifies that STI image.
|
|
# The main focus is that the image prints out the base-usage properly.
|
|
#
|
|
# 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-centos/s2i-base-centos7-candidate}
|
|
|
|
test_docker_run_usage() {
|
|
echo "Testing 'docker run' usage..."
|
|
docker run --rm ${IMAGE_NAME} &>/dev/null
|
|
}
|
|
|
|
check_result() {
|
|
local result="$1"
|
|
if [[ "$result" != "0" ]]; then
|
|
echo "STI image '${IMAGE_NAME}' test FAILED (exit code: ${result})"
|
|
exit $result
|
|
fi
|
|
}
|
|
|
|
# Verify the 'usage' script is working properly when running the base image with 'docker run ...'
|
|
test_docker_run_usage
|
|
check_result $?
|