summaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2021-01-19 13:41:50 -0500
committerMatthew Heon <mheon@redhat.com>2021-01-26 14:38:25 -0500
commit1ae410d19e0ead7db89192b3d0e290a677314d6e (patch)
tree2dfb45f3e22e74ee3e86e96d99a6017bc04b8517 /test/apiv2
parent5d444466e1b55edbf48a2ad4999d4564bc20d01f (diff)
downloadpodman-1ae410d19e0ead7db89192b3d0e290a677314d6e.tar.gz
podman-1ae410d19e0ead7db89192b3d0e290a677314d6e.tar.bz2
podman-1ae410d19e0ead7db89192b3d0e290a677314d6e.zip
Ensure the Volumes field in Compat Create is honored
Docker has, for unclear reasons, three separate fields in their Create Container struct in which volumes can be placed. Right now we support two of those - Binds and Mounts, which (roughly) correspond to `-v` and `--mount` respectively. Unfortunately, we did not support the third, `Volumes`, which is used for anonymous named volumes created by `-v` (e.g. `-v /test`). It seems that volumes listed here are *not* included in the remaining two from my investigation, so it should be safe to just append them into our handling of the `Binds` (`-v`) field. Fixes #8649 Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'test/apiv2')
-rw-r--r--test/apiv2/20-containers.at9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index decdc4754..0da196e46 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -237,3 +237,12 @@ t GET containers/$cid/json 200 \
t DELETE containers/$cid 204
t DELETE images/${MultiTagName}?force=true 200
# vim: filetype=sh
+
+# Test Volumes field adds an anonymous volume
+t POST containers/create '"Image":"'$IMAGE'","Volumes":{"/test":{}}' 201 \
+ .Id~[0-9a-f]\\{64\\}
+cid=$(jq -r '.Id' <<<"$output")
+t GET containers/$cid/json 200 \
+ .Mounts[0].Destination="/test"
+
+t DELETE containers/$cid?v=true 204