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:
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")
# 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
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))
# 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()
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