Only run integration tests on Bash 4.1 or later

Fixes #2200

Signed-off-by: Dave Tucker <dt@docker.com>
This commit is contained in:
Dave Tucker 2015-11-24 09:58:43 +00:00
parent f9979c285d
commit 3a332c8d47
1 changed files with 13 additions and 1 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
@ -54,6 +54,18 @@ function run_bats() {
EXIT_STATUS=0
export BATS_FILE="$1"
# Check we're not running bash 3.x
if [ "${BASH_VERSINFO[0]}" -lt 4 ]; then
echo "Bash 4.1 or later is required to run these tests"
exit 1
fi
# If bash 4.x, check the minor version is 1 or later
if [ "${BASH_VERSINFO[0]}" -eq 4 ] && [ "${BASH_VERSINFO[1]}" -lt 1 ]; then
echo "Bash 4.1 or later is required to run these tests"
exit 1
fi
if [[ -z "$DRIVER" ]]; then
echo "You must specify the DRIVER environment variable."
exit 1