summaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-06-09 15:31:26 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-06-09 16:00:46 +0200
commit5614c29ce1132ac8ee05687910248134d0f5c766 (patch)
tree59d07118d90bacaef24c2b6d520ce58390012b87 /test/apiv2
parent643a692360bf769d12dc8b73acaa3481b0f07992 (diff)
downloadpodman-5614c29ce1132ac8ee05687910248134d0f5c766.tar.gz
podman-5614c29ce1132ac8ee05687910248134d0f5c766.tar.bz2
podman-5614c29ce1132ac8ee05687910248134d0f5c766.zip
compat api: fix regressions from "Swagger refactor/cleanup"
For some reason commit 5b79cf15a022 moved the container create options parsing from cmd/podman/common to pkg/api/handlers. However it did not remove the old code. Unfortunately it moved the code from an outdated version and did not update it before this commit was merged. Therefore a couple of regressions were introduced. I manually compared both versions and found three missing bugfixes. I fixed the network test again that was changed in bce97a3b5dd1. We want bridge as default even as rootless. Sine the test is not run as rootless in CI the regression was not caught. Also the no hosts test never worked since it was missing the import check if the hosts file exists. I don't think we can check for the volume parsing change since this only works on windows/wsl. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/apiv2')
-rw-r--r--test/apiv2/20-containers.at15
1 files changed, 4 insertions, 11 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index 8f34b7e05..383c527b4 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -240,14 +240,11 @@ t POST containers/create Image=$IMAGE Entrypoint='["top"]' 201 \
.Id~[0-9a-f]\\{64\\}
cid_top=$(jq -r '.Id' <<<"$output")
-# Unexpected difference between /containers/json and /containers/CID/json:
-# in rootless, the former returns .Networks=none, the latter .Networks={}
-network_expect=${network_expect/=null/='{}'}
t GET containers/${cid_top}/json 200 \
.Config.Entrypoint[0]="top" \
.Config.Cmd='[]' \
.Path="top" \
- .NetworkSettings.$network_expect
+ .NetworkSettings.Networks.podman.NetworkID=podman
t POST containers/${cid_top}/start 204
# make sure the container is running
t GET containers/${cid_top}/json 200 \
@@ -378,13 +375,8 @@ t DELETE containers/$cid?v=true 204
t POST containers/create Image=$IMAGE HostConfig='{"NetworkMode":"default"}' 201 \
.Id~[0-9a-f]\\{64\\}
cid=$(jq -r '.Id' <<<"$output")
-if root; then
- network_type=bridge
-else
- network_type=slirp4netns
-fi
t GET containers/$cid/json 200 \
- .HostConfig.NetworkMode="$network_type"
+ .HostConfig.NetworkMode="bridge"
t DELETE containers/$cid?v=true 204
@@ -486,7 +478,8 @@ for endpoint in containers/create libpod/containers/create; do
t POST libpod/containers/$cid/init 204
- t GET libpod/containers/$cid/json 200
+ t GET libpod/containers/$cid/json 200 \
+ .HostsPath=""
t DELETE containers/$cid 204
done