summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-04-05 22:15:16 +0200
committerGitHub <noreply@github.com>2021-04-05 22:15:16 +0200
commita64f39ba3c3cfb1c3dd761fb464cf3c87a1b5e22 (patch)
tree0df9b1bd1b26961e761077f38e2b1ae4e6adabf9 /test
parent626b7ebd74dbd2614c4e6e9f99514404c50e806a (diff)
parent27ebbe3fe7e8daa4f25dd124270326325d210de5 (diff)
downloadpodman-a64f39ba3c3cfb1c3dd761fb464cf3c87a1b5e22.tar.gz
podman-a64f39ba3c3cfb1c3dd761fb464cf3c87a1b5e22.tar.bz2
podman-a64f39ba3c3cfb1c3dd761fb464cf3c87a1b5e22.zip
Merge pull request #9933 from jmguzik/network-prune-with-until-tests
Http api tests for network prune with until filter
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/35-networks.at23
1 files changed, 22 insertions, 1 deletions
diff --git a/test/apiv2/35-networks.at b/test/apiv2/35-networks.at
index 21840a42d..59947faac 100644
--- a/test/apiv2/35-networks.at
+++ b/test/apiv2/35-networks.at
@@ -106,7 +106,7 @@ t POST libpod/networks/prune?filters='{"label":["tes' 500 \
# prune networks using filter - compat api
t POST networks/prune?filters='{"label":["xyz"]}' 200
-t GET networks/json?filters='{"label":["xyz"]}' 404
+t GET networks?filters='{"label":["xyz"]}' 200 length=0
# prune networks using filter - libpod api
t POST libpod/networks/prune?filters='{"label":["zaq=val"]}' 200
@@ -120,5 +120,26 @@ t DELETE libpod/networks/network2 200 \
.[0].Name~network2 \
.[0].Err=null
+# test until filter - libpod api
+podman network create network5 --label xyz
+
+# with date way back in the past, network should not be deleted
+t POST libpod/networks/prune?filters='{"until":["500000"]}' 200
+t GET libpod/networks/json?filters='{"label":["xyz"]}' 200 length=1
+
+# with date far in the future, network should be deleted
+t POST libpod/networks/prune?filters='{"until":["5000000000"]}' 200
+t GET libpod/networks/json?filters='{"label":["xyz"]}' 200 length=0
+
+# test until filter - compat api
+podman network create network6 --label zaq
+
+# with date way back in the past, network should not be deleted
+t POST networks/prune?filters='{"until":["500000"]}' 200
+t GET networks?filters='{"label":["zaq"]}' 200 length=1
+
+# with date far in the future, network should be deleted
+t POST networks/prune?filters='{"until":["5000000000"]}' 200
+t GET networks?filters='{"label":["zaq"]}' 200 length=0
# vim: filetype=sh