summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-02 06:46:48 -0400
committerGitHub <noreply@github.com>2020-09-02 06:46:48 -0400
commit96079e2d18a0a7219a59a98134ad01b962b6f881 (patch)
treeaa5e3e8bfe56f73ada1fc04c5efe1306299b1d4e
parenteb31d8cd654dd26a9e7566a4fa06eb4391797779 (diff)
parent43ad9be7d8f6fd095aa3dec462c5b6f8ce01fada (diff)
downloadpodman-96079e2d18a0a7219a59a98134ad01b962b6f881.tar.gz
podman-96079e2d18a0a7219a59a98134ad01b962b6f881.tar.bz2
podman-96079e2d18a0a7219a59a98134ad01b962b6f881.zip
Merge pull request #7426 from Edward5hen/apiv2-containers-test
APIv2 test: add more tests for containers
-rw-r--r--test/apiv2/25-containersMore.at55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/apiv2/25-containersMore.at b/test/apiv2/25-containersMore.at
new file mode 100644
index 000000000..e0e6f7222
--- /dev/null
+++ b/test/apiv2/25-containersMore.at
@@ -0,0 +1,55 @@
+# -*- sh -*-
+#
+# test more container-related endpoints
+#
+
+podman pull $IMAGE &>/dev/null
+
+# Ensure clean slate
+podman rm -a -f &>/dev/null
+
+podman run -d --name foo $IMAGE top
+
+# Check exists for none such
+t GET libpod/containers/nonesuch/exists 404
+
+# Check container foo exists
+t GET libpod/containers/foo/exists 204
+
+# Pause the container
+t POST libpod/containers/foo/pause '' 204
+
+t GET libpod/containers/foo/json 200 \
+ .Id~[0-9a-f]\\{64\\} \
+ .State.Status=paused \
+ .ImageName=$IMAGE \
+ .Config.Cmd[0]=top \
+ .Name=foo
+
+# Unpause the container
+t POST libpod/containers/foo/unpause '' 204
+
+t GET libpod/containers/foo/json 200 \
+ .Id~[0-9a-f]\\{64\\} \
+ .State.Status=running \
+ .ImageName=$IMAGE \
+ .Config.Cmd[0]=top \
+ .Name=foo
+
+# List processes of the container
+t GET libpod/containers/foo/top 200 \
+ length=2
+
+# List processes of none such
+t GET libpod/containers/nonesuch/top 404
+
+# Mount the container to host filesystem
+t POST libpod/containers/foo/mount '' 200
+like "$output" ".*merged" "Check container mount"
+
+# Unmount the container
+t POST libpod/containers/foo/unmount '' 204
+
+t DELETE libpod/containers/foo?force=true 204
+
+# vim: filetype=sh