summaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-19 17:19:00 -0500
committerGitHub <noreply@github.com>2022-01-19 17:19:00 -0500
commitd2c892c7299a6da07f84a6c99dace833dc946ce5 (patch)
tree1390219e3a8dc964066b5634ef83b693017e9312 /test/apiv2
parent5e2fcf813d54980df00976a01fca571b7007ae16 (diff)
parentc674d3cc756742d2987d6f392f502e39673a5044 (diff)
downloadpodman-d2c892c7299a6da07f84a6c99dace833dc946ce5.tar.gz
podman-d2c892c7299a6da07f84a6c99dace833dc946ce5.tar.bz2
podman-d2c892c7299a6da07f84a6c99dace833dc946ce5.zip
Merge pull request #12914 from rhatdan/commit
Handle changes in docker compat mode
Diffstat (limited to 'test/apiv2')
-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 e5b9eeef3..45c040fbc 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -420,3 +420,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