Refresh kernel partition table between tests (#779)

The test suite for ceph-iscsi does a bunch of operations on filesystems
in quick succession, so some tests are prone to fail if the kernel doesn't
update the partition table. This PR does this manually between tests by
calling the 'partprobe' command.

Co-authored-by: Luciano Lo Giudice <luciano.logiudice@canonical.com>
This commit is contained in:
Luciano Lo Giudice
2022-06-09 11:58:37 -03:00
committed by GitHub
parent 251d6a85a0
commit 3ab81b4ebb

View File

@@ -238,6 +238,10 @@ class CephISCSIGatewayTest(test_utils.BaseCharmTest):
action_params={
'name': self.EC_METADATA_POOL}))
def refresh_partitions(self, ctxt):
"""Refresh kernel partition tables in client."""
self.run_commands(ctxt['client_entity_id'], ('partprobe', ), ctxt)
def run_client_checks(self, test_ctxt):
"""Check access to mulipath device.
@@ -254,6 +258,7 @@ class CephISCSIGatewayTest(test_utils.BaseCharmTest):
self.logout_iscsi_targets(test_ctxt)
self.login_iscsi_target(test_ctxt)
self.check_client_device(test_ctxt, init_client=False)
self.refresh_partitions(test_ctxt)
def test_create_and_mount_volume(self):
"""Test creating a target and mounting it on a client."""