diff options
author | Matthew Heon <matthew.heon@pm.me> | 2021-02-24 23:30:15 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-02-25 13:09:29 -0500 |
commit | 43d010bd0f9e01d1652e284c77d1839a4bf16607 (patch) | |
tree | 49d6e1da0e19d8156276a958a57f55f4901f77e5 /test/apiv2 | |
parent | 4aaaa6c1df3a1c90a930b97552bcc970d7d99dd4 (diff) | |
download | podman-43d010bd0f9e01d1652e284c77d1839a4bf16607.tar.gz podman-43d010bd0f9e01d1652e284c77d1839a4bf16607.tar.bz2 podman-43d010bd0f9e01d1652e284c77d1839a4bf16607.zip |
Fix parsing of Tmpfs field in compat create
Create is not formatted as `key=value` but rather `key:value`
(technically `path:option1,option2`). As such we can't use the
stringMapToArray function, and instead need to generate it
manually.
Fixes #9511
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test/apiv2')
-rw-r--r-- | test/apiv2/44-mounts.at | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/apiv2/44-mounts.at b/test/apiv2/44-mounts.at new file mode 100644 index 000000000..fe202576d --- /dev/null +++ b/test/apiv2/44-mounts.at @@ -0,0 +1,21 @@ +# -*- sh -*- + +podman pull $IMAGE &>/dev/null + +# Test various HostConfig options +tmpfs_name="/mytmpfs" +t POST containers/create?name=hostconfig_test '"Image":"'$IMAGE'","Cmd":["df"],"HostConfig":{"TmpFs":{"'$tmpfs_name'":"rw"}}' 201 \ + .Id~[0-9a-f]\\{64\\} +cid=$(jq -r '.Id' <<<"$output") + +# Prior to #9512, the tmpfs would be called '/mytmpfs=rw', with the '=rw' +t GET containers/${cid}/json 200 \ + .HostConfig.Tmpfs[\"${tmpfs_name}\"]~rw, + +# Run the container, verify output +t POST containers/${cid}/start '' 204 +t POST containers/${cid}/wait '' 200 +t GET containers/${cid}/logs?stdout=true 200 + +like "$(<$WORKDIR/curl.result.out)" ".* ${tmpfs_name}" \ + "'df' output includes tmpfs name" |