Skip to content

Commit

Permalink
Merge pull request #1137 from sabaini/ceph-dashboard-verify-ssl
Browse files Browse the repository at this point in the history
Retry ceph-dashboard ssl verification test
  • Loading branch information
wolsen authored Sep 26, 2023
2 parents ea36acd + cfcee88 commit eba90c7
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions zaza/openstack/charm_tests/ceph/dashboard/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,19 +331,27 @@ def _get_wait_for_dashboard_assert_state(

def verify_ssl_config(self, ca_file):
"""Check if request validates the configured SSL cert."""
rcs = collections.defaultdict(list)
units = zaza.model.get_units('ceph-mon')
for unit in units:
req = self._run_request_get(
'https://{}:8443'.format(
zaza.model.get_unit_public_address(unit)),
verify=ca_file,
allow_redirects=False)
rcs[req.status_code].append(
zaza.model.get_unit_public_address(unit)
)
self.assertEqual(len(rcs[requests.codes.ok]), 1)
self.assertEqual(len(rcs[requests.codes.see_other]), len(units) - 1)

for attempt in tenacity.Retrying(
wait=tenacity.wait_exponential(max=60),
reraise=True, stop=tenacity.stop_after_attempt(10)
):
with attempt:
rcs = collections.defaultdict(list)
for unit in units:
req = self._run_request_get(
'https://{}:8443'.format(
zaza.model.get_unit_public_address(unit)),
verify=ca_file,
allow_redirects=False)
rcs[req.status_code].append(
zaza.model.get_unit_public_address(unit)
)
self.assertEqual(len(rcs[requests.codes.ok]), 1)
self.assertEqual(
len(rcs[requests.codes.see_other]),
len(units) - 1)

def _get_dashboard_hostnames_sans(self):
"""Get a generator for Dashboard unit public addresses."""
Expand Down

0 comments on commit eba90c7

Please sign in to comment.