From: John Spray Date: Thu, 26 Apr 2018 12:56:46 +0000 (-0400) Subject: qa: update dashboard tests for https:// X-Git-Tag: v13.1.0~25^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b7a5da8bf085dba24795c11b3204286b4014fb6b;p=ceph.git qa: update dashboard tests for https:// Signed-off-by: John Spray --- diff --git a/qa/tasks/mgr/dashboard/helper.py b/qa/tasks/mgr/dashboard/helper.py index b49126c904393..1be8243d34d45 100644 --- a/qa/tasks/mgr/dashboard/helper.py +++ b/qa/tasks/mgr/dashboard/helper.py @@ -82,13 +82,16 @@ class DashboardTestCase(MgrTestCase): url = "{}{}".format(cls.base_uri, url) log.info("request %s to %s", method, url) if method == 'GET': - cls._resp = cls._session.get(url, params=params) + cls._resp = cls._session.get(url, params=params, verify=False) elif method == 'POST': - cls._resp = cls._session.post(url, json=data, params=params) + cls._resp = cls._session.post(url, json=data, params=params, + verify=False) elif method == 'DELETE': - cls._resp = cls._session.delete(url, json=data, params=params) + cls._resp = cls._session.delete(url, json=data, params=params, + verify=False) elif method == 'PUT': - cls._resp = cls._session.put(url, json=data, params=params) + cls._resp = cls._session.put(url, json=data, params=params, + verify=False) else: assert False try: diff --git a/qa/tasks/mgr/test_dashboard.py b/qa/tasks/mgr/test_dashboard.py index 79aebee4eabfd..6a98e0ec4b2a0 100644 --- a/qa/tasks/mgr/test_dashboard.py +++ b/qa/tasks/mgr/test_dashboard.py @@ -12,10 +12,15 @@ log = logging.getLogger(__name__) class TestDashboard(MgrTestCase): MGRS_REQUIRED = 3 - def test_standby(self): + def setUp(self): + super(TestDashboard, self).setUp() + self._assign_ports("dashboard", "server_port") self._load_module("dashboard") + self.mgr_cluster.mon_manager.raw_cluster_cmd("dashboard", + "create-self-signed-cert") + def test_standby(self): original_active = self.mgr_cluster.get_active_id() original_uri = self._get_uri("dashboard") @@ -30,14 +35,11 @@ class TestDashboard(MgrTestCase): # The original active daemon should have come back up as a standby # and be doing redirects to the new active daemon - r = requests.get(original_uri, allow_redirects=False) + r = requests.get(original_uri, allow_redirects=False, verify=False) self.assertEqual(r.status_code, 303) self.assertEqual(r.headers['Location'], failed_over_uri) def test_urls(self): - self._assign_ports("dashboard", "server_port") - self._load_module("dashboard") - base_uri = self._get_uri("dashboard") # This is a very simple smoke test to check that the dashboard can @@ -51,7 +53,8 @@ class TestDashboard(MgrTestCase): failures = [] for url in urls: - r = requests.get(base_uri + url, allow_redirects=False) + r = requests.get(base_uri + url, allow_redirects=False, + verify=False) if r.status_code >= 300 and r.status_code < 400: log.error("Unexpected redirect to: {0} (from {1})".format( r.headers['Location'], base_uri)) diff --git a/qa/tasks/mgr/test_module_selftest.py b/qa/tasks/mgr/test_module_selftest.py index 21aa4a3d232d4..d13f67920431d 100644 --- a/qa/tasks/mgr/test_module_selftest.py +++ b/qa/tasks/mgr/test_module_selftest.py @@ -172,6 +172,8 @@ class TestModuleSelftest(MgrTestCase): # Use the dashboard to test that the mgr is still able to do its job self._assign_ports("dashboard", "server_port") self._load_module("dashboard") + self.mgr_cluster.mon_manager.raw_cluster_cmd("dashboard", + "create-self-signed-cert") original_active = self.mgr_cluster.get_active_id() original_standbys = self.mgr_cluster.get_standby_ids() @@ -187,7 +189,7 @@ class TestModuleSelftest(MgrTestCase): for i in range(0, periods): t1 = time.time() # Check that an HTTP module remains responsive - r = requests.get(dashboard_uri) + r = requests.get(dashboard_uri, verify=False) self.assertEqual(r.status_code, 200) # Check that a native non-module command remains responsive