Merge pull request #2332 from jeanlaurent/it-copy-boot2docker.iso

IT: Bootstrap test quicker by caching boot2docker iso if present
This commit is contained in:
Nathan LeClaire 2015-11-18 13:43:17 -08:00
commit 299d4f6a07
1 changed files with 6 additions and 0 deletions

View File

@ -66,6 +66,7 @@ export NAME="bats-$DRIVER-test"
export MACHINE_STORAGE_PATH="/tmp/machine-bats-test-$DRIVER"
export MACHINE_BIN_NAME=docker-machine
export BATS_LOG="$MACHINE_ROOT/bats.log"
B2D_LOCATION=~/.docker/machine/cache/boot2docker.iso
# This function gets used in the integration tests, so export it.
export -f machine
@ -78,6 +79,11 @@ if [[ -d "$MACHINE_STORAGE_PATH" ]]; then
rm -r "$MACHINE_STORAGE_PATH"
fi
if [[ "$b2dcache" == "1" ]] && [[ -f $B2D_LOCATION ]]; then
mkdir -p "${MACHINE_STORAGE_PATH}/cache"
cp $B2D_LOCATION "${MACHINE_STORAGE_PATH}/cache/boot2docker.iso"
fi
run_bats "$BATS_FILE"
if [[ -d "$MACHINE_STORAGE_PATH" ]]; then