aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorcdoern <cdoern@redhat.com>2021-07-06 14:53:56 -0400
committercdoern <cdoern@redhat.com>2021-07-09 12:21:46 -0400
commit4624142c2db039343efc8c9b8070cf1e0d3a7262 (patch)
treeca5af233eb2ed67036eeffa05f939743196fac38 /test
parent1a9cb93f16cf19e14581319e2fd1b60e791f74dd (diff)
downloadpodman-4624142c2db039343efc8c9b8070cf1e0d3a7262.tar.gz
podman-4624142c2db039343efc8c9b8070cf1e0d3a7262.tar.bz2
podman-4624142c2db039343efc8c9b8070cf1e0d3a7262.zip
Implemented Until Query Parameter for Containers/logs
compat containers/logs was missing actual usage of until query param. fixes #10859 Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/python/rest_api/test_v2_0_0_container.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/apiv2/python/rest_api/test_v2_0_0_container.py b/test/apiv2/python/rest_api/test_v2_0_0_container.py
index 2fab4aeb9..f252bd401 100644
--- a/test/apiv2/python/rest_api/test_v2_0_0_container.py
+++ b/test/apiv2/python/rest_api/test_v2_0_0_container.py
@@ -1,5 +1,6 @@
import random
import unittest
+import json
import requests
from dateutil.parser import parse
@@ -97,6 +98,18 @@ class ContainerTestCase(APITestCase):
def test_logs(self):
r = requests.get(self.uri(self.resolve_container("/containers/{}/logs?stdout=true")))
self.assertEqual(r.status_code, 200, r.text)
+ r = requests.post(
+ self.podman_url + "/v1.40/containers/create?name=topcontainer",
+ json={"Cmd": ["top", "ls"], "Image": "alpine:latest"},
+ )
+ self.assertEqual(r.status_code, 201, r.text)
+ payload = r.json()
+ container_id = payload["Id"]
+ self.assertIsNotNone(container_id)
+ r = requests.get(self.podman_url + f"/v1.40/containers/{payload['Id']}/logs?follow=false&stdout=true&until=0")
+ self.assertEqual(r.status_code, 200, r.text)
+ r = requests.get(self.podman_url + f"/v1.40/containers/{payload['Id']}/logs?follow=false&stdout=true&until=1")
+ self.assertEqual(r.status_code, 200, r.text)
def test_commit(self):
r = requests.post(self.uri(self.resolve_container("/commit?container={}")))