summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-26 13:04:37 -0400
committerGitHub <noreply@github.com>2020-08-26 13:04:37 -0400
commitf99954c7ca4428e501676fa47a63b5cecadd9454 (patch)
tree2e62d26620f7feca4b98d63b56c88fd27d322124 /test
parent3a9d5248ac65358e7a4f123c2cdbe93584084d6a (diff)
parentfa6ba6802618e3e23746c4b4707fb403a55514ae (diff)
downloadpodman-f99954c7ca4428e501676fa47a63b5cecadd9454.tar.gz
podman-f99954c7ca4428e501676fa47a63b5cecadd9454.tar.bz2
podman-f99954c7ca4428e501676fa47a63b5cecadd9454.zip
Merge pull request #7409 from zhangguanzhang/apiv2-create-ctr-with-invalid-entrypoint
fix apiv2 will create containers with incorrect commands
Diffstat (limited to 'test')
-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