summaryrefslogtreecommitdiff
path: root/test/apiv2/40-pods.at
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2020-02-24 09:47:13 -0700
committerEd Santiago <santiago@redhat.com>2020-02-25 06:42:27 -0700
commitf25c595cb8af5d6fe491d6974f206d6a5db552cb (patch)
tree874616fc318e5f6a5820d287d17fe4c12ec0a823 /test/apiv2/40-pods.at
parentafd5cbff1e147bdad200b47fb2bd0992684c7fd4 (diff)
downloadpodman-f25c595cb8af5d6fe491d6974f206d6a5db552cb.tar.gz
podman-f25c595cb8af5d6fe491d6974f206d6a5db552cb.tar.bz2
podman-f25c595cb8af5d6fe491d6974f206d6a5db552cb.zip
apiv2 tests: add more pod tests, timing check
Looks like /libpod/pods/create has been fixed to return an actual pod ID. Extend those tests. Also, update timeout in the server command: it's now seconds, not milliseconds. Also, update FIXME comments in /pods/prune . Still doesn't work, but clarify what we're seeing. Also, add a new test that runs ten /info requests and barfs if it takes more than 5 seconds. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/apiv2/40-pods.at')
-rw-r--r--test/apiv2/40-pods.at26
1 files changed, 15 insertions, 11 deletions
diff --git a/test/apiv2/40-pods.at b/test/apiv2/40-pods.at
index 705de94d2..8b5651cff 100644
--- a/test/apiv2/40-pods.at
+++ b/test/apiv2/40-pods.at
@@ -3,18 +3,20 @@
# test pod-related endpoints
#
-# FIXME! Shouldn't /create give an actual pod ID?
-expected_id='machine.slice'
-if rootless; then
- expected_id=/libpod_parent
-fi
-
t GET libpod/pods/json 200 null
-t POST libpod/pods/create name=foo 201 .id=$expected_id
+t POST libpod/pods/create name=foo 201 .id~[0-9a-f]\\{64\\}
+pod_id=$(jq -r .id <<<"$output")
t GET libpod/pods/foo/exists 204
+t GET libpod/pods/$pod_id/exists 204
t GET libpod/pods/notfoo/exists 404
-t GET libpod/pods/foo/json 200 .Config.name=foo .Containers=null
-t GET libpod/pods/json 200 .[0].Config.name=foo .[0].Containers=null
+t GET libpod/pods/foo/json 200 \
+ .Config.name=foo \
+ .Config.id=$pod_id \
+ .Containers=null
+t GET libpod/pods/json 200 \
+ .[0].Config.name=foo \
+ .[0].Config.id=$pod_id \
+ .[0].Containers=null
# Cannot create a dup pod with the same name
t POST libpod/pods/create name=foo 409 .cause="pod already exists"
@@ -35,8 +37,10 @@ t POST libpod/pods/foo/restart '' 500 .cause="no such container"
t POST libpod/pods/bar/restart '' 404
-#t POST libpod/pods/prune '' 200 # FIXME: unimplemented, returns 500
-#t POST libpod/pods/prune 'a=b' 400 # FIXME: unimplemented, returns 500
+# FIXME: I'm not sure what 'prune' is supposed to do; as of 20200224 it
+# just returns 200 (ok) with empty result list.
+#t POST libpod/pods/prune '' 200 # FIXME: 2020-02-24 returns 200 {}
+#t POST libpod/pods/prune 'a=b' 400 # FIXME: 2020-02-24 returns 200
# Clean up; and try twice, making sure that the second time fails
t DELETE libpod/pods/foo 204