summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-10-14 17:28:57 +0200
committerGitHub <noreply@github.com>2021-10-14 17:28:57 +0200
commitac733032c19a711317edc889bd2cb6321ee3bbdf (patch)
treee89d80039ea1f6e6c674e457b13d9a25eb4394c4 /test
parentc19f257181db6f2c8af1d208ef8c3c846593813e (diff)
parent8cae2978ef1b84708df1f872c2340ec109537996 (diff)
downloadpodman-ac733032c19a711317edc889bd2cb6321ee3bbdf.tar.gz
podman-ac733032c19a711317edc889bd2cb6321ee3bbdf.tar.bz2
podman-ac733032c19a711317edc889bd2cb6321ee3bbdf.zip
Merge pull request #11966 from Luap99/panic
Fix panic in container create compat api
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/20-containers.at18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index afff68c22..748a0750f 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -379,3 +379,21 @@ t GET containers/$cid/json 200 \
.HostConfig.Tmpfs['"/mnt/scratch"']~.*mode=755.*
t DELETE containers/$cid?v=true 204
+
+# compat api: tmpfs without mount options
+payload='{"Mounts":[{"Type":"tmpfs","Target":"/mnt/scratch"}]}'
+t POST containers/create Image=$IMAGE HostConfig="$payload" 201 .Id~[0-9a-f]\\{64\\}
+cid=$(jq -r '.Id' <<<"$output")
+t GET containers/$cid/json 200 \
+ .HostConfig.Tmpfs['"/mnt/scratch"']~.*tmpcopyup.* \
+
+t DELETE containers/$cid?v=true 204
+
+# compat api: bind mount without mount options
+payload='{"Mounts":[{"Type":"bind","Source":"/tmp","Target":"/mnt"}]}'
+t POST containers/create Image=$IMAGE HostConfig="$payload" 201 .Id~[0-9a-f]\\{64\\}
+cid=$(jq -r '.Id' <<<"$output")
+t GET containers/$cid/json 200 \
+ .HostConfig.Binds[0]~/tmp:/mnt:.* \
+
+t DELETE containers/$cid?v=true 204