1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00
Files
docs/test/integration/helpers.bash
Nathan LeClaire 64a3a2f804 Update DRIVER checking to universal function
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-11-25 23:01:47 -08:00

36 lines
658 B
Bash

#!/bin/bash
echo_to_log() {
echo "$BATS_TEST_NAME
----------
$output
----------
" >> ${BATS_LOG}
}
teardown() {
echo_to_log
}
function errecho () {
>&2 echo "$@"
}
function only_if_env () {
if [[ ${!1} != "$2" ]]; then
errecho "This test requires the $1 environment variable to be set to $2. Skipping..."
skip
fi
}
function require_env () {
if [[ -z ${!1} ]]; then
errecho "This test requires the $1 environment variable to be set in order to run."
exit 1
fi
}
# Make sure these aren't set while tests run (can cause confusing behavior)
unset DOCKER_HOST DOCKER_TLS_VERIFY DOCKER_CERT_DIR