From 4624142c2db039343efc8c9b8070cf1e0d3a7262 Mon Sep 17 00:00:00 2001 From: cdoern Date: Tue, 6 Jul 2021 14:53:56 -0400 Subject: Implemented Until Query Parameter for Containers/logs compat containers/logs was missing actual usage of until query param. fixes #10859 Signed-off-by: cdoern --- test/apiv2/python/rest_api/test_v2_0_0_container.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/apiv2/python') 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={}"))) -- cgit v1.2.3-54-g00ecf