Merge pull request #2337 from dgageot/fix-its

Fix its
This commit is contained in:
Nathan LeClaire 2015-11-18 16:17:45 -08:00
commit ffbfb443c2
4 changed files with 6 additions and 11 deletions

View File

@ -6,7 +6,7 @@ test-short:
test-long:
$(GO) test $(VERBOSE_GO) -race -tags "$(BUILDTAGS)" $(PKGS)
test-integration:
test-integration: build
$(eval TESTSUITE=$(filter-out $@,$(MAKECMDGOALS)))
test/integration/run-bats.sh $(TESTSUITE)

View File

@ -14,5 +14,6 @@ load ${BASE_TEST_DIR}/helpers.bash
docker $(machine config $NAME) run --name nolog busybox echo this should not be logged
run docker $(machine config $NAME) logs nolog
echo ${output}
[ $status -eq 1 ]
[ $status -eq 0 ]
[[ ${lines[0]} =~ "no log driver named 'none' is registered" ]]
}

View File

@ -6,7 +6,7 @@ load ${BASE_TEST_DIR}/helpers.bash
run machine inspect $NAME
echo ${output}
[ "$status" -eq 1 ]
[[ ${lines[0]} == "Host \"$NAME\" does not exist" ]]
[[ ${lines[0]} =~ "Host does not exist: \"$NAME\"" ]]
}
@test "$DRIVER: create" {

View File

@ -26,6 +26,8 @@ function machine() {
function run_bats() {
for bats_file in $(find "$1" -name \*.bats); do
export NAME="bats-$DRIVER-test-$(date +%s)"
# BATS returns non-zero to indicate the tests have failed, we shouldn't
# neccesarily bail in this case, so that's the reason for the e toggle.
set +e
@ -62,7 +64,6 @@ fi
# TODO: Should the script bail out if these are set already?
export BASE_TEST_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
export MACHINE_ROOT="$BASE_TEST_DIR/../.."
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"
@ -90,11 +91,4 @@ if [[ -d "$MACHINE_STORAGE_PATH" ]]; then
rm -r "$MACHINE_STORAGE_PATH"
fi
set +e
pkill docker-machine
if [[ $? -eq 0 ]]; then
EXIT_STATUS=1
fi
set -e
exit ${EXIT_STATUS}