diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-07-10 06:31:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-10 06:31:49 -0400 |
commit | bef1f03d3ca8bfd90f4cbb295d99bf97df74a815 (patch) | |
tree | 79d4a907422c070ec0a2db9628eea170bc16dfaa /test/apiv2 | |
parent | 24a5eeafc54ef7b1c04bfa8efe78fddd3f7e4014 (diff) | |
parent | 4624142c2db039343efc8c9b8070cf1e0d3a7262 (diff) | |
download | podman-bef1f03d3ca8bfd90f4cbb295d99bf97df74a815.tar.gz podman-bef1f03d3ca8bfd90f4cbb295d99bf97df74a815.tar.bz2 podman-bef1f03d3ca8bfd90f4cbb295d99bf97df74a815.zip |
Merge pull request #10868 from cdoern/untilLog
Implemented Until Query Parameter for Containers/logs
Diffstat (limited to 'test/apiv2')
-rw-r--r-- | test/apiv2/python/rest_api/test_v2_0_0_container.py | 13 |
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={}"))) |