Skip to content

Commit

Permalink
Prepare for v4 API testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauvain Pocentek committed May 27, 2017
1 parent ac3aef6 commit 38bff3e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools/build_test_env.sh
Expand Up @@ -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}";;
Expand All @@ -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 \
Expand Down Expand Up @@ -130,6 +137,7 @@ timeout = 10
[local]
url = http://localhost:8080
private_token = $TOKEN
api_version = $API_VER
EOF

log "Config file content ($CONFIG):"
Expand Down

0 comments on commit 38bff3e

Please sign in to comment.