Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry ceph-dashboard ssl verification test #1137

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading