summaryrefslogtreecommitdiff
path: root/test/apiv2/20-containers.at
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-01-18 16:05:35 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2022-01-19 13:03:58 -0500
commitc674d3cc756742d2987d6f392f502e39673a5044 (patch)
tree8f2668c6b1ce670fdc1d4a7590ed62a410ebbfad /test/apiv2/20-containers.at
parent1c81b67341300853d7fe9b6568b247e579c34969 (diff)
downloadpodman-c674d3cc756742d2987d6f392f502e39673a5044.tar.gz
podman-c674d3cc756742d2987d6f392f502e39673a5044.tar.bz2
podman-c674d3cc756742d2987d6f392f502e39673a5044.zip
Handle changes in docker compat mode
Fixes: https://github.com/containers/podman/issues/12830 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/apiv2/20-containers.at')
-rw-r--r--test/apiv2/20-containers.at26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index e6d49ac25..5f926ccc1 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -408,3 +408,29 @@ t GET containers/$cid/json 200 \
.HostConfig.Binds[0]~/tmp:/mnt:.* \
t DELETE containers/$cid?v=true 204
+
+# test apiv2 create/commit
+t POST containers/create \
+ Image=$IMAGE \
+ Entrypoint='["echo"]' \
+ Cmd='["param1","param2"]' \
+ 201 \
+ .Id~[0-9a-f]\\{64\\}
+cid=$(jq -r '.Id' <<<"$output")
+
+# No such container
+t POST "commit?container=nonesuch" 404
+
+cparam="repo=newrepo&tag=v3&comment=abcd&author=eric"
+cparam="$cparam&format=docker&changes=CMD=/bin/bar,EXPOSE=9090"
+t POST "commit?container=${cid:0:12}&$cparam" 201 \
+ .Id~[0-9a-f]\\{64\\}
+iid=$(jq -r '.Id' <<<"$output")
+t GET images/$iid/json 200 \
+ .RepoTags[0]=docker.io/library/newrepo:v3 \
+ .Config.ExposedPorts~.*"9090/tcp" \
+ .Config.Cmd~.*"/bin/bar" \
+ .Comment="abcd"
+
+t DELETE containers/$cid 204
+t DELETE images/docker.io/library/newrepo:v3?force=false 200