summaryrefslogtreecommitdiff
path: root/test/apiv2/20-containers.at
diff options
context:
space:
mode:
authorzhangguanzhang <zhangguanzhang@qq.com>2020-08-22 18:15:53 +0800
committerzhangguanzhang <zhangguanzhang@qq.com>2020-08-24 23:07:30 +0800
commitfa6ba6802618e3e23746c4b4707fb403a55514ae (patch)
tree807e78f11803170afec2b27963398218ce1df4d0 /test/apiv2/20-containers.at
parent4828455055010a1376f1e83832bfa34787f3a1e7 (diff)
downloadpodman-fa6ba6802618e3e23746c4b4707fb403a55514ae.tar.gz
podman-fa6ba6802618e3e23746c4b4707fb403a55514ae.tar.bz2
podman-fa6ba6802618e3e23746c4b4707fb403a55514ae.zip
fix apiv2 will create containers with incorrect commands
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'test/apiv2/20-containers.at')
-rw-r--r--test/apiv2/20-containers.at27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at
index ed333d382..9ea3cb7ed 100644
--- a/test/apiv2/20-containers.at
+++ b/test/apiv2/20-containers.at
@@ -151,4 +151,31 @@ t DELETE images/localhost/newrepo:v2?force=true 200
t DELETE libpod/containers/$cid 204
t DELETE libpod/containers/myctr 204
+
+# test apiv2 create container with correct entrypoint and cmd
+# --data '{"Image":"quay.io/libpod/alpine_labels:latest","Entrypoint":["echo"],"Cmd":["param1","param2"]}'
+t POST containers/create '"Image":"'$IMAGE'","Entrypoint":["echo"],"Cmd":["param1","param2"]' 201 \
+ .Id~[0-9a-f]\\{64\\}
+cid=$(jq -r '.Id' <<<"$output")
+t GET containers/$cid/json 200 \
+ .Config.Entrypoint[0]="echo" \
+ .Config.Cmd[0]="param1" \
+ .Config.Cmd[1]="param2" \
+ .Path="echo" \
+ .Args[0]="param1" \
+ .Args[1]="param2"
+t DELETE containers/$cid 204
+
+# test only set the entrpoint, Cmd should be []
+t POST containers/create '"Image":"'$IMAGE'","Entrypoint":["echo","param1"]' 201 \
+ .Id~[0-9a-f]\\{64\\}
+cid=$(jq -r '.Id' <<<"$output")
+t GET containers/$cid/json 200 \
+ .Config.Entrypoint[0]="echo" \
+ .Config.Entrypoint[1]="param1" \
+ .Config.Cmd='[]' \
+ .Path="echo" \
+ .Args[0]="param1"
+t DELETE containers/$cid 204
+
# vim: filetype=sh