summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-12 02:07:36 -0400
committerGitHub <noreply@github.com>2021-09-12 02:07:36 -0400
commitf785d8d1940a6cf3ac76f4c333d157bd9d4c76b7 (patch)
tree215fcf8cac010819b632cc4c564025413b93728c /test
parent72662f790bad0a3dc26a6a1498b6daa936702bb6 (diff)
parentdeaf9692432bb6a9353fe56cecb6cddf0401a78c (diff)
downloadpodman-f785d8d1940a6cf3ac76f4c333d157bd9d4c76b7.tar.gz
podman-f785d8d1940a6cf3ac76f4c333d157bd9d4c76b7.tar.bz2
podman-f785d8d1940a6cf3ac76f4c333d157bd9d4c76b7.zip
Merge pull request #11517 from jwhonce/issues/10053
Refactor API server emphasis on logging
Diffstat (limited to 'test')
-rw-r--r--test/apiv2/python/rest_api/test_v2_0_0_system.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/apiv2/python/rest_api/test_v2_0_0_system.py b/test/apiv2/python/rest_api/test_v2_0_0_system.py
index 3dfd08525..2d3935c9c 100644
--- a/test/apiv2/python/rest_api/test_v2_0_0_system.py
+++ b/test/apiv2/python/rest_api/test_v2_0_0_system.py
@@ -1,5 +1,6 @@
import json
import unittest
+import uuid
import requests
from .fixtures import APITestCase
@@ -92,6 +93,18 @@ class SystemTestCase(APITestCase):
r = requests.get(self.uri("/system/df"))
self.assertEqual(r.status_code, 200, r.text)
+ def test_reference_id(self):
+ rid = str(uuid.uuid4())
+ r = requests.get(self.uri("/info"), headers={"X-Reference-Id": rid})
+ self.assertEqual(r.status_code, 200, r.text)
+
+ self.assertIn("X-Reference-Id", r.headers)
+ self.assertEqual(r.headers["X-Reference-Id"], rid)
+
+ r = requests.get(self.uri("/info"))
+ self.assertIn("X-Reference-Id", r.headers)
+ self.assertNotEqual(r.headers["X-Reference-Id"], rid)
+
if __name__ == "__main__":
unittest.main()