Correct tests.sh.
OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=299
This commit is contained in:
parent
1dba49a151
commit
aa8b889eb5
19
tests.sh
19
tests.sh
@ -86,7 +86,7 @@ require_git() { git version >/dev/null 2>&1 ; }
|
||||
|
||||
################################################################################
|
||||
|
||||
[ "${#TESTS[@]}" -eq 0 ] || abort "integration tests executable not found in $DOCKER_DIR"
|
||||
[ "${#TESTS[@]}" -gt 0 ] || abort "integration tests executable not found in $DOCKER_DIR"
|
||||
[ "$EUID" -eq 0 ] || abort "this script must be run as root"
|
||||
[ -n "$VERSION" ] || abort "could not obtain version"
|
||||
|
||||
@ -191,8 +191,8 @@ cleanup() {
|
||||
systemctl restart docker.service
|
||||
|
||||
log "Removing images and containers..."
|
||||
docker ps -aq | xargs docker rm -f
|
||||
docker images -q | xargs docker rmi -f
|
||||
docker ps -aq | xargs docker rm -f &>/dev/null || :
|
||||
docker images -q | xargs docker rmi -f &>/dev/null || :
|
||||
|
||||
log "Removing extra files and restoring backups..."
|
||||
restore_backup /etc/subuid /etc/subgid
|
||||
@ -202,14 +202,16 @@ trap cleanup EXIT
|
||||
|
||||
cd "$DOCKER_DIR"
|
||||
|
||||
log "Preparing the environment..."
|
||||
export MAKEDIR="$SCRIPTS_DIR/make"
|
||||
export DOCKER_HOST="$DOCKER_TEST_HOST"
|
||||
bundle .integration-daemon-setup
|
||||
|
||||
# Clean up all images on the host -- this is key to avoid test run failures.
|
||||
docker ps -aq | xargs docker rm -f
|
||||
docker images -q | xargs docker rmi -f
|
||||
log "Cleaning the environment..."
|
||||
docker ps -aq | xargs docker rm -f &>/dev/null || :
|
||||
docker images -q | xargs docker rmi -f &>/dev/null || :
|
||||
|
||||
log "Preparing the environment..."
|
||||
bundle .integration-daemon-setup
|
||||
|
||||
# XXX: Really this should be sourced from the Dockerfile but this is good
|
||||
# enough for now. This comes from the Docker 18.09.1-ce Dockerfile.
|
||||
@ -223,11 +225,12 @@ ln -sf "$FROZEN_IMAGES_DIR" "$FROZEN_IMAGES_LINK"
|
||||
debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
|
||||
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
|
||||
|
||||
rm "$TEST_LOG"
|
||||
for TEST in "${TESTS[@]}"
|
||||
do
|
||||
cd "$(dirname "$TEST")"
|
||||
log "Running integration test ($TEST)..." | tee -a "$TEST_LOG"
|
||||
"$TEST" "${TEST_ARGS[@]}" 2>&1 | tee -a "$TEST_LOG" || /bin/true
|
||||
"$TEST" "${TEST_ARGS[@]}" 2>&1 | tee -a "$TEST_LOG" || :
|
||||
done
|
||||
if [ -n "$ENABLE_XUNIT" ] ; then
|
||||
log "Generating xunit logs..."
|
||||
|
Loading…
Reference in New Issue
Block a user