diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-26 13:04:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 13:04:37 -0400 |
commit | f99954c7ca4428e501676fa47a63b5cecadd9454 (patch) | |
tree | 2e62d26620f7feca4b98d63b56c88fd27d322124 /test/apiv2 | |
parent | 3a9d5248ac65358e7a4f123c2cdbe93584084d6a (diff) | |
parent | fa6ba6802618e3e23746c4b4707fb403a55514ae (diff) | |
download | podman-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/apiv2')
-rw-r--r-- | test/apiv2/20-containers.at | 27 |
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 |