Skip to content

Commit

Permalink
Merge pull request #1032 from sabaini/refactor/move-pristine-test
Browse files Browse the repository at this point in the history
Move pristine test to ceph-osd tests
  • Loading branch information
lmlg authored Mar 31, 2023
2 parents 14c8d59 + 9880637 commit 2c61ed7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
23 changes: 23 additions & 0 deletions zaza/openstack/charm_tests/ceph/osd/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,26 @@ def test_start_specific(self):
wait_for_service(unit_name=self.TESTED_UNIT,
services=should_stop,
target_status='stopped')

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()
23 changes: 0 additions & 23 deletions zaza/openstack/charm_tests/ceph/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,29 +413,6 @@ 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

0 comments on commit 2c61ed7

Please sign in to comment.