From f471fb4ce9d10dd523c3772ca9239ab1cfc8f4f4 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 1 Jan 2021 22:43:31 +0100 Subject: Compat api containers/json add support for filters Fixes #8860 Signed-off-by: Paul Holzinger --- test/apiv2/20-containers.at | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/apiv2') diff --git a/test/apiv2/20-containers.at b/test/apiv2/20-containers.at index bc6efc20d..decdc4754 100644 --- a/test/apiv2/20-containers.at +++ b/test/apiv2/20-containers.at @@ -203,6 +203,15 @@ t GET 'containers/json?limit=0&all=1' 200 \ .[0].Id~[0-9a-f]\\{64\\} \ .[1].Id~[0-9a-f]\\{64\\} +t GET containers/json?limit=2 200 length=2 + +# Filter with two ids should return both container +t GET "containers/json?filters=%7B%22id%22%3A%5B%22${cid}%22%2C%22${cid_top}%22%5D%7D&all=1" 200 length=2 +# Filter with two ids and status running should return only 1 container +t GET "containers/json?filters=%7B%22id%22%3A%5B%22${cid}%22%2C%22${cid_top}%22%5D%2C%22status%22%3A%5B%22running%22%5D%7D&all=1" 200 \ + length=1 \ + .[0].Id=${cid_top} + t POST containers/${cid_top}/stop "" 204 t DELETE containers/$cid 204 -- cgit v1.2.3-54-g00ecf