summaryrefslogtreecommitdiff
path: root/test/apiv2
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-29 04:13:38 -0400
committerGitHub <noreply@github.com>2021-07-29 04:13:38 -0400
commit1ec1c85b5a44afb0e76c40e0e908c6e55ab9c3dd (patch)
tree888c3edb6838cdba4b3c86168aee3e7b0f7bdbf5 /test/apiv2
parentf9395ddc5ad8b32e4e9b24542f0869722f7c9743 (diff)
parenta9f6592af6646d3692e8a7260df98dd606aa4d9b (diff)
downloadpodman-1ec1c85b5a44afb0e76c40e0e908c6e55ab9c3dd.tar.gz
podman-1ec1c85b5a44afb0e76c40e0e908c6e55ab9c3dd.tar.bz2
podman-1ec1c85b5a44afb0e76c40e0e908c6e55ab9c3dd.zip
Merge pull request #11048 from cdoern/heatlhCheckCompat
Fixed Healthcheck formatting, string to []string
Diffstat (limited to 'test/apiv2')
-rw-r--r--test/apiv2/python/rest_api/test_v2_0_0_container.py10
1 files changed, 9 insertions, 1 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 f252bd401..30d902d8c 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
@@ -33,9 +33,10 @@ class ContainerTestCase(APITestCase):
self.assertId(r.content)
_ = parse(r.json()["Created"])
+
r = requests.post(
self.podman_url + "/v1.40/containers/create?name=topcontainer",
- json={"Cmd": ["top"], "Image": "alpine:latest"},
+ json={"Healthcheck": {"Test": ["CMD-SHELL", "exit 0"], "Interval":1000, "Timeout":1000, "Retries": 5}, "Cmd": ["top"], "Image": "alpine:latest"},
)
self.assertEqual(r.status_code, 201, r.text)
payload = r.json()
@@ -49,6 +50,13 @@ class ContainerTestCase(APITestCase):
state = out["State"]["Health"]
self.assertIsInstance(state, dict)
+ r = requests.get(self.uri(f"/containers/{payload['Id']}/json"))
+ self.assertEqual(r.status_code, 200, r.text)
+ self.assertId(r.content)
+ out = r.json()
+ hc = out["Config"]["Healthcheck"]["Test"]
+ self.assertListEqual(["CMD-SHELL", "exit 0"], hc)
+
def test_stats(self):
r = requests.get(self.uri(self.resolve_container("/containers/{}/stats?stream=false")))
self.assertIn(r.status_code, (200, 409), r.text)