diff options
author | Jhon Honce <jhonce@redhat.com> | 2020-07-30 08:16:14 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2020-07-31 10:19:23 -0700 |
commit | cff727d488f2951d9c07056fb40d642d39c18f42 (patch) | |
tree | e7f2d6dbe549f6c180b8d566641176e49f618435 /test/apiv2/rest_api | |
parent | 7a15be546adffe4f884abfbd4ed02f69ac7659e0 (diff) | |
download | podman-cff727d488f2951d9c07056fb40d642d39c18f42.tar.gz podman-cff727d488f2951d9c07056fb40d642d39c18f42.tar.bz2 podman-cff727d488f2951d9c07056fb40d642d39c18f42.zip |
Add versioned _ping endpoint
Fixes #7008
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'test/apiv2/rest_api')
-rw-r--r-- | test/apiv2/rest_api/test_rest_v1_0_0.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/test/apiv2/rest_api/test_rest_v1_0_0.py b/test/apiv2/rest_api/test_rest_v1_0_0.py index 7c53623cb..2e574e015 100644 --- a/test/apiv2/rest_api/test_rest_v1_0_0.py +++ b/test/apiv2/rest_api/test_rest_v1_0_0.py @@ -13,9 +13,11 @@ from multiprocessing import Process import requests from dateutil.parser import parse +PODMAN_URL = "http://localhost:8080" + def _url(path): - return "http://localhost:8080/v1.0.0/libpod" + path + return PODMAN_URL + "/v1.0.0/libpod" + path def podman(): @@ -205,7 +207,21 @@ class TestApi(unittest.TestCase): search.join(timeout=10) self.assertFalse(search.is_alive(), "/images/search took too long") - def validateObjectFields(self, buffer): + def test_ping(self): + r = requests.get(PODMAN_URL + "/_ping") + self.assertEqual(r.status_code, 200, r.text) + + r = requests.head(PODMAN_URL + "/_ping") + self.assertEqual(r.status_code, 200, r.text) + + r = requests.get(_url("/_ping")) + self.assertEqual(r.status_code, 200, r.text) + + r = requests.get(_url("/_ping")) + self.assertEqual(r.status_code, 200, r.text) + + +def validateObjectFields(self, buffer): objs = json.loads(buffer) if not isinstance(objs, dict): for o in objs: @@ -214,6 +230,5 @@ class TestApi(unittest.TestCase): _ = objs["Id"] return objs - if __name__ == '__main__': unittest.main() |