mirror of
https://github.com/containers/podman.git
synced 2025-06-17 06:57:43 +08:00
Fixed Healthcheck formatting, string to []string
Compat healthcheck tests are of the format []string but podman's were of the format string. Converted podman's to []string at the specgen level since it has the same effect and removed the incorrect parsing of compat healthchecks. fixes #10617 Signed-off-by: cdoern <cdoern@redhat.com>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user