summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/build_test_env.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/build_test_env.sh b/tools/build_test_env.sh
index 3f6191a..96d341a 100755
--- a/tools/build_test_env.sh
+++ b/tools/build_test_env.sh
@@ -26,9 +26,11 @@ fatal() { error "$@"; exit 1; }
try() { "$@" || fatal "'$@' failed"; }
PY_VER=2
-while getopts :p: opt "$@"; do
+API_VER=3
+while getopts :p:a: opt "$@"; do
case $opt in
p) PY_VER=$OPTARG;;
+ a) API_VER=$OPTARG;;
:) fatal "Option -${OPTARG} requires a value";;
'?') fatal "Unknown option: -${OPTARG}";;
*) fatal "Internal error: opt=${opt}";;
@@ -41,6 +43,11 @@ case $PY_VER in
*) fatal "Wrong python version (2 or 3)";;
esac
+case $API_VER in
+ 3|4) ;;
+ *) fatal "Wrong API version (3 or 4)";;
+esac
+
for req in \
curl \
docker \
@@ -130,6 +137,7 @@ timeout = 10
[local]
url = http://localhost:8080
private_token = $TOKEN
+api_version = $API_VER
EOF
log "Config file content ($CONFIG):"