summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-05-27 08:51:21 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2017-05-27 08:51:21 +0200
commit38bff3eb43ee6526b3e3b35c8207fac9ef9bc9d9 (patch)
treecb086bf44c72005f932e40e641487bc3d779b7c4
parentac3aef64d8d1275a457fc4164cafda85c2a42b1a (diff)
downloadgitlab-38bff3eb43ee6526b3e3b35c8207fac9ef9bc9d9.tar.gz
Prepare for v4 API testing
-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):"