aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-10 10:17:57 -0500
committerGitHub <noreply@github.com>2022-02-10 10:17:57 -0500
commitc4a9aa7c73e120fc2e246f056fec83ff35854dba (patch)
treeb68b3af194f296edad1931e108b91c722baa3224 /test
parentec889c819a5ae514e80eca1d2c032d9b95a01651 (diff)
parent71d1514490e9366646bb28fa151c6b6c8f5745dd (diff)
downloadpodman-c4a9aa7c73e120fc2e246f056fec83ff35854dba.tar.gz
podman-c4a9aa7c73e120fc2e246f056fec83ff35854dba.tar.bz2
podman-c4a9aa7c73e120fc2e246f056fec83ff35854dba.zip
Merge pull request #13195 from jwhonce/wip/network_version_4.0
[4.0] Add version guard to libpod API endpoints
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/35-networks.at5
-rwxr-xr-xtest/apiv2/test-apiv210
2 files changed, 9 insertions, 6 deletions
diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at
index 0e2389bd5..3502b89e0 100644
--- a/test/apiv2/35-networks.at
+++ b/test/apiv2/35-networks.at
@@ -8,7 +8,10 @@ t GET networks/non-existing-network 404 \
t POST libpod/networks/create name='"network1"' 200 \
.name=network1 \
- .created~[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}.* \
+ .created~[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}.*
+
+t POST /v3.4.0/libpod/networks/create name='"bad_version"' 400 \
+ .cause='given version is not supported'
# --data '{"name":"network2","subnets":[{"subnet":"10.10.254.0/24"}],"Labels":{"abc":"val"}}'
t POST libpod/networks/create name='"network2"' \
diff --git a/test/apiv2/test-apiv2 b/test/apiv2/test-apiv2
index 56280f04e..bd728e130 100755
--- a/test/apiv2/test-apiv2
+++ b/test/apiv2/test-apiv2
@@ -256,11 +256,11 @@ function t() {
# If given path begins with /, use it as-is; otherwise prepend /version/
local url=http://$HOST:$PORT
- if expr "$path" : "/" >/dev/null; then
- url="$url$path"
- else
- url="$url/v1.40/$path"
- fi
+ case "$path" in
+ /*) url="$url$path" ;;
+ libpod/*) url="$url/v4.0.0/$path" ;;
+ *) url="$url/v1.41/$path" ;;
+ esac
# Log every action we do
echo "-------------------------------------------------------------" >>$LOG