Skip to content

Commit

Permalink
Unblock after pristine status (#1025)
Browse files Browse the repository at this point in the history
When a charm has a non-pristine status, it should leave the
previously-set blocked state (LP #1988088) if there are no
non-pristine disks

Also: seeing some spurious test failures due to timeouts
waiting on disk removal -- wait a bit longer
  • Loading branch information
sabaini authored Mar 21, 2023
1 parent 296c06d commit ef62272
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion zaza/openstack/charm_tests/ceph/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,29 @@ def test_blocked_when_non_pristine_disk_appears(self):

zaza_model.wait_for_application_states()

def test_active_after_pristine_block(self):
"""Test if we can get back to active state after pristine block.
Set a non-pristine status, then trigger update-status to see if it
clears.
"""
logging.info('Setting Non-pristine status')
zaza_model.run_on_leader(
"ceph-osd",
"status-set blocked 'Non-pristine'"
)
ceph_osd_states = {
'ceph-osd': {
'workload-status': 'blocked',
'workload-status-message-prefix': 'Non-pristine'
}
}
zaza_model.wait_for_application_states(states=ceph_osd_states)
logging.info('Running update-status action')
zaza_model.run_on_leader('ceph-osd', 'hooks/update-status')
logging.info('Wait for idle/ready status')
zaza_model.wait_for_application_states()

def test_pause_and_resume(self):
"""The services can be paused and resumed."""
logging.info('Checking pause and resume actions...')
Expand Down Expand Up @@ -552,7 +575,7 @@ def remove_disk_from_osd_unit(self, unit, osd_id, is_purge=False):
action_name='remove-disk',
action_params={
'osd-ids': osd_id,
'timeout': 5,
'timeout': 10,
'format': 'json',
'purge': is_purge
}
Expand Down

0 comments on commit ef62272

Please sign in to comment.