]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: update dashboard tests for https://
authorJohn Spray <john.spray@redhat.com>
Thu, 26 Apr 2018 12:56:46 +0000 (08:56 -0400)
committerJohn Spray <john.spray@redhat.com>
Fri, 27 Apr 2018 13:58:47 +0000 (09:58 -0400)
Signed-off-by: John Spray <john.spray@redhat.com>
qa/tasks/mgr/dashboard/helper.py
qa/tasks/mgr/test_dashboard.py
qa/tasks/mgr/test_module_selftest.py

index b49126c9043935750d6aab65c0c647b82b42dcb3..1be8243d34d45ef10129a48ca7d592af2674b5df 100644 (file)
@@ -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:
index 79aebee4eabfd508dcb69c71a05160bfe92f3413..6a98e0ec4b2a00326e559346db02a80f043224e0 100644 (file)
@@ -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))
index 21aa4a3d232d4426b3d683f2e63a1712dfd4432f..d13f67920431d8100a9392557a6defb28825dbaa 100644 (file)
@@ -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