From a7865afb6426562f545281317f2d40bbf206d795 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Fri, 26 Nov 2021 18:29:29 -0300 Subject: [PATCH 01/10] Test the enhancements of the 'add-disk' action for ceph-osd This PR tests that a new device is succesfully added to the OSD charm, and that it's done so via the 'bcache' mechanism. The backing storage is provided via a loopback device, whereas the caching storage is provided by Juju itself. --- zaza/openstack/charm_tests/ceph/tests.py | 44 +++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index a99795a..dee5311 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -22,6 +22,7 @@ from os import ( path ) import requests +import subprocess import tempfile import tenacity @@ -37,6 +38,33 @@ import zaza.utilities.juju as juju_utils import zaza.openstack.utilities.openstack as zaza_openstack +def add_storage(unit, label, pool, size): + rv = subprocess.check_output(['juju', 'add-storage', unit, + '{}={},{}'.format(label, pool, + str(size) + 'GB')], + stderr=subprocess.STDOUT) + return rv.decode('UTF-8').replace('added storage ', '').split(' ')[0] + + +def detach_storage(storage_name): + subprocess.check_call(['juju', 'detach-storage', storage_name]) + + +def remove_storage(storage_name, force=False): + cmd = ['juju', 'remove-storage', storage_name] + if force: + cmd.append('--force') + subprocess.check_call(cmd) + +def add_loop_device(unit, size=10): + loop_name = '/home/ubuntu/loop.img' + truncate = 'truncate --size {}GB {}'.format(size, loop_name) + losetup = 'losetup --find {}'.format(loop_name) + lofind = 'losetup -a | grep {} | cut -f1 -d ":"'.format(loop_name) + cmd = "sudo sh -c '{} && {} && {}'".format(truncate, losetup, lofind) + return zaza_model.run_on_unit(unit, cmd) + + class CephLowLevelTest(test_utils.OpenStackBaseTest): """Ceph Low Level Test Class.""" @@ -463,7 +491,7 @@ class CephTest(test_utils.OpenStackBaseTest): The blacklist actions execute and behave as expected. """ - logging.info('Checking blacklist-add-disk and' + logging.info('Checking blacklist-add-disk and ' 'blacklist-remove-disk actions...') unit_name = 'ceph-osd/0' @@ -545,6 +573,20 @@ class CephTest(test_utils.OpenStackBaseTest): ) logging.debug('OK') + def test_cache_device(self): + logging.info('Running add-disk action with a caching device') + osds = [x.entity_id for x in zaza_model.get_units('ceph-osd')] + for unit in osds: + add_storage(unit, 'cache-devices', 'cinder', 10) + loop_dev = add_loop_device(unit, 10) + action_obj = zaza_model.run_action( + unit_name=unit, + action_name='add-disk', + action_params={'osd-devices': loop_dev.get('Stdout'), + 'partition-size': 5} + ) + zaza_utils.assertActionRanOK(action_obj) + class CephRGWTest(test_utils.OpenStackBaseTest): """Ceph RADOS Gateway Daemons Test Class.""" From 4a52ba1dba4f147709307524b4a8095972d1933d Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Fri, 26 Nov 2021 18:40:14 -0300 Subject: [PATCH 02/10] Add docstrings. --- zaza/openstack/charm_tests/ceph/tests.py | 40 +++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index dee5311..0b09781 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -39,24 +39,61 @@ import zaza.openstack.utilities.openstack as zaza_openstack def add_storage(unit, label, pool, size): + """Add storage to a Juju unit. + + :param unit: The unit name (i.e: ceph-osd/0) + :type unit: str + + :param label: The storage label (i.e: osd-devices) + :type label: str + + :param pool: The pool on which to allocate the storage (i.e: cinder) + :type pool: str + + :size: The size in GB of the storage to attach. + :type size: int + + :returns: The name of the allocated storage. + """ rv = subprocess.check_output(['juju', 'add-storage', unit, '{}={},{}'.format(label, pool, str(size) + 'GB')], - stderr=subprocess.STDOUT) + stderr=subprocess.STDOUT) return rv.decode('UTF-8').replace('added storage ', '').split(' ')[0] def detach_storage(storage_name): + """Detach previously allocated Juju storage.""" subprocess.check_call(['juju', 'detach-storage', storage_name]) def remove_storage(storage_name, force=False): + """Remove Juju storage. + + :param storage_name: The name of the previously allocated Juju storage. + :type storage_name: str + + :param force: If False (default), require that the storage be detached + before it can be removed. + :type force: bool + """ cmd = ['juju', 'remove-storage', storage_name] if force: cmd.append('--force') subprocess.check_call(cmd) + def add_loop_device(unit, size=10): + """Add a loopback device to a Juju unit. + + :param unit: The unit name on which to create the device. + :type unit: str + + :param size: The size in GB of the device. + :type size: int + + :returns: The device name. + """ loop_name = '/home/ubuntu/loop.img' truncate = 'truncate --size {}GB {}'.format(size, loop_name) losetup = 'losetup --find {}'.format(loop_name) @@ -574,6 +611,7 @@ class CephTest(test_utils.OpenStackBaseTest): logging.debug('OK') def test_cache_device(self): + """Test adding a new disk with a caching device.""" logging.info('Running add-disk action with a caching device') osds = [x.entity_id for x in zaza_model.get_units('ceph-osd')] for unit in osds: From 97f1ea5693e830e86743b0868bc42464b4ed385b Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Mon, 29 Nov 2021 12:08:28 -0300 Subject: [PATCH 03/10] Move functions into juju utilities. --- zaza/openstack/charm_tests/ceph/tests.py | 68 +----------------------- zaza/openstack/utilities/juju.py | 66 +++++++++++++++++++++++ 2 files changed, 68 insertions(+), 66 deletions(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index 0b09781..3bc7c43 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -38,70 +38,6 @@ import zaza.utilities.juju as juju_utils import zaza.openstack.utilities.openstack as zaza_openstack -def add_storage(unit, label, pool, size): - """Add storage to a Juju unit. - - :param unit: The unit name (i.e: ceph-osd/0) - :type unit: str - - :param label: The storage label (i.e: osd-devices) - :type label: str - - :param pool: The pool on which to allocate the storage (i.e: cinder) - :type pool: str - - :size: The size in GB of the storage to attach. - :type size: int - - :returns: The name of the allocated storage. - """ - rv = subprocess.check_output(['juju', 'add-storage', unit, - '{}={},{}'.format(label, pool, - str(size) + 'GB')], - stderr=subprocess.STDOUT) - return rv.decode('UTF-8').replace('added storage ', '').split(' ')[0] - - -def detach_storage(storage_name): - """Detach previously allocated Juju storage.""" - subprocess.check_call(['juju', 'detach-storage', storage_name]) - - -def remove_storage(storage_name, force=False): - """Remove Juju storage. - - :param storage_name: The name of the previously allocated Juju storage. - :type storage_name: str - - :param force: If False (default), require that the storage be detached - before it can be removed. - :type force: bool - """ - cmd = ['juju', 'remove-storage', storage_name] - if force: - cmd.append('--force') - subprocess.check_call(cmd) - - -def add_loop_device(unit, size=10): - """Add a loopback device to a Juju unit. - - :param unit: The unit name on which to create the device. - :type unit: str - - :param size: The size in GB of the device. - :type size: int - - :returns: The device name. - """ - loop_name = '/home/ubuntu/loop.img' - truncate = 'truncate --size {}GB {}'.format(size, loop_name) - losetup = 'losetup --find {}'.format(loop_name) - lofind = 'losetup -a | grep {} | cut -f1 -d ":"'.format(loop_name) - cmd = "sudo sh -c '{} && {} && {}'".format(truncate, losetup, lofind) - return zaza_model.run_on_unit(unit, cmd) - - class CephLowLevelTest(test_utils.OpenStackBaseTest): """Ceph Low Level Test Class.""" @@ -615,8 +551,8 @@ class CephTest(test_utils.OpenStackBaseTest): logging.info('Running add-disk action with a caching device') osds = [x.entity_id for x in zaza_model.get_units('ceph-osd')] for unit in osds: - add_storage(unit, 'cache-devices', 'cinder', 10) - loop_dev = add_loop_device(unit, 10) + juju_utils.add_storage(unit, 'cache-devices', 'cinder', 10) + loop_dev = juju_utils.add_loop_device(unit, 10) action_obj = zaza_model.run_action( unit_name=unit, action_name='add-disk', diff --git a/zaza/openstack/utilities/juju.py b/zaza/openstack/utilities/juju.py index 073a26f..e4646a5 100644 --- a/zaza/openstack/utilities/juju.py +++ b/zaza/openstack/utilities/juju.py @@ -17,7 +17,9 @@ import logging import functools +import subprocess +import zaza.model import zaza.utilities.juju @@ -310,3 +312,67 @@ def get_subordinate_units(unit_list, charm_name=None, status=None, charm_name=charm_name, status=status, model_name=model_name) + + +def add_storage(unit, label, pool, size): + """Add storage to a Juju unit. + + :param unit: The unit name (i.e: ceph-osd/0) + :type unit: str + + :param label: The storage label (i.e: osd-devices) + :type label: str + + :param pool: The pool on which to allocate the storage (i.e: cinder) + :type pool: str + + :size: The size in GB of the storage to attach. + :type size: int + + :returns: The name of the allocated storage. + """ + rv = subprocess.check_output(['juju', 'add-storage', unit, + '{}={},{}'.format(label, pool, + str(size) + 'GB')], + stderr=subprocess.STDOUT) + return rv.decode('UTF-8').replace('added storage ', '').split(' ')[0] + + +def detach_storage(storage_name): + """Detach previously allocated Juju storage.""" + subprocess.check_call(['juju', 'detach-storage', storage_name]) + + +def remove_storage(storage_name, force=False): + """Remove Juju storage. + + :param storage_name: The name of the previously allocated Juju storage. + :type storage_name: str + + :param force: If False (default), require that the storage be detached + before it can be removed. + :type force: bool + """ + cmd = ['juju', 'remove-storage', storage_name] + if force: + cmd.append('--force') + subprocess.check_call(cmd) + + +def add_loop_device(unit, size=10): + """Add a loopback device to a Juju unit. + + :param unit: The unit name on which to create the device. + :type unit: str + + :param size: The size in GB of the device. + :type size: int + + :returns: The device name. + """ + loop_name = '/home/ubuntu/loop.img' + truncate = 'truncate --size {}GB {}'.format(size, loop_name) + losetup = 'losetup --find {}'.format(loop_name) + lofind = 'losetup -a | grep {} | cut -f1 -d ":"'.format(loop_name) + cmd = "sudo sh -c '{} && {} && {}'".format(truncate, losetup, lofind) + return zaza.model.run_on_unit(unit, cmd) From 7933615a7e9be3b260f16d20320a29f5ef947503 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Mon, 29 Nov 2021 12:09:28 -0300 Subject: [PATCH 04/10] Remove unused import --- zaza/openstack/charm_tests/ceph/tests.py | 1 - 1 file changed, 1 deletion(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index 3bc7c43..7fd2127 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -22,7 +22,6 @@ from os import ( path ) import requests -import subprocess import tempfile import tenacity From f6a0b14df47fe02b5a2c2c4203b888fdcb4d4c68 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Mon, 29 Nov 2021 16:00:26 -0300 Subject: [PATCH 05/10] Fix import of juju utilities --- zaza/openstack/charm_tests/ceph/tests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index 7fd2127..b6496bb 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -35,6 +35,7 @@ import zaza.openstack.utilities.exceptions as zaza_exceptions import zaza.openstack.utilities.generic as zaza_utils import zaza.utilities.juju as juju_utils import zaza.openstack.utilities.openstack as zaza_openstack +import zaza.openstack.utilities.juju as zaza_juju class CephLowLevelTest(test_utils.OpenStackBaseTest): @@ -550,8 +551,8 @@ class CephTest(test_utils.OpenStackBaseTest): logging.info('Running add-disk action with a caching device') osds = [x.entity_id for x in zaza_model.get_units('ceph-osd')] for unit in osds: - juju_utils.add_storage(unit, 'cache-devices', 'cinder', 10) - loop_dev = juju_utils.add_loop_device(unit, 10) + zaza_juju.add_storage(unit, 'cache-devices', 'cinder', 10) + loop_dev = zaza_juju.add_loop_device(unit, 10) action_obj = zaza_model.run_action( unit_name=unit, action_name='add-disk', From c8302161a12aca1be5d6ccad693369a08ca62fe4 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Thu, 20 Jan 2022 20:47:12 -0300 Subject: [PATCH 06/10] Also test that the new number of OSD's is correct. --- zaza/openstack/charm_tests/ceph/tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index b6496bb..c52c331 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -546,10 +546,17 @@ class CephTest(test_utils.OpenStackBaseTest): ) logging.debug('OK') + def get_num_osds(self, osd): + """Compute the number of active OSD's.""" + result = zaza_model.run_on_unit(osd, 'ceph osd stat --format=json') + result = json.loads(result['Stdout']) + return int(result['num_osds']) + def test_cache_device(self): """Test adding a new disk with a caching device.""" logging.info('Running add-disk action with a caching device') osds = [x.entity_id for x in zaza_model.get_units('ceph-osd')] + num_osds = self.get_num_osds(osds[0]) for unit in osds: zaza_juju.add_storage(unit, 'cache-devices', 'cinder', 10) loop_dev = zaza_juju.add_loop_device(unit, 10) @@ -560,6 +567,7 @@ class CephTest(test_utils.OpenStackBaseTest): 'partition-size': 5} ) zaza_utils.assertActionRanOK(action_obj) + self.assertEqual(num_osds + len(osds), self.get_num_osds(osds[0])) class CephRGWTest(test_utils.OpenStackBaseTest): From e751e4a989f4ff94580cad14116cc83da5e69d63 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Thu, 10 Feb 2022 14:28:50 -0300 Subject: [PATCH 07/10] Rearrange functions into separate modules --- zaza/openstack/charm_tests/ceph/tests.py | 5 +- zaza/openstack/utilities/generic.py | 19 +++++++ zaza/openstack/utilities/juju.py | 66 ------------------------ 3 files changed, 21 insertions(+), 69 deletions(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index c52c331..61c2d47 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -35,7 +35,6 @@ import zaza.openstack.utilities.exceptions as zaza_exceptions import zaza.openstack.utilities.generic as zaza_utils import zaza.utilities.juju as juju_utils import zaza.openstack.utilities.openstack as zaza_openstack -import zaza.openstack.utilities.juju as zaza_juju class CephLowLevelTest(test_utils.OpenStackBaseTest): @@ -558,8 +557,8 @@ class CephTest(test_utils.OpenStackBaseTest): osds = [x.entity_id for x in zaza_model.get_units('ceph-osd')] num_osds = self.get_num_osds(osds[0]) for unit in osds: - zaza_juju.add_storage(unit, 'cache-devices', 'cinder', 10) - loop_dev = zaza_juju.add_loop_device(unit, 10) + zaza_model.add_storage(unit, 'cache-devices', 'cinder', 10) + loop_dev = zaza_utils.add_loop_device(unit, 10) action_obj = zaza_model.run_action( unit_name=unit, action_name='add-disk', diff --git a/zaza/openstack/utilities/generic.py b/zaza/openstack/utilities/generic.py index be19c31..88711a1 100644 --- a/zaza/openstack/utilities/generic.py +++ b/zaza/openstack/utilities/generic.py @@ -723,3 +723,22 @@ def get_leaders_and_non_leaders(application_name): else: non_leaders.append(unit) return leader, non_leaders + + +def add_loop_device(unit, size=10): + """Add a loopback device to a Juju unit. + + :param unit: The unit name on which to create the device. + :type unit: str + + :param size: The size in GB of the device. + :type size: int + + :returns: The device name. + """ + loop_name = '/home/ubuntu/loop.img' + truncate = 'truncate --size {}GB {}'.format(size, loop_name) + losetup = 'losetup --find {}'.format(loop_name) + lofind = 'losetup -a | grep {} | cut -f1 -d ":"'.format(loop_name) + cmd = "sudo sh -c '{} && {} && {}'".format(truncate, losetup, lofind) + return model.run_on_unit(unit, cmd) diff --git a/zaza/openstack/utilities/juju.py b/zaza/openstack/utilities/juju.py index e4646a5..073a26f 100644 --- a/zaza/openstack/utilities/juju.py +++ b/zaza/openstack/utilities/juju.py @@ -17,9 +17,7 @@ import logging import functools -import subprocess -import zaza.model import zaza.utilities.juju @@ -312,67 +310,3 @@ def get_subordinate_units(unit_list, charm_name=None, status=None, charm_name=charm_name, status=status, model_name=model_name) - - -def add_storage(unit, label, pool, size): - """Add storage to a Juju unit. - - :param unit: The unit name (i.e: ceph-osd/0) - :type unit: str - - :param label: The storage label (i.e: osd-devices) - :type label: str - - :param pool: The pool on which to allocate the storage (i.e: cinder) - :type pool: str - - :size: The size in GB of the storage to attach. - :type size: int - - :returns: The name of the allocated storage. - """ - rv = subprocess.check_output(['juju', 'add-storage', unit, - '{}={},{}'.format(label, pool, - str(size) + 'GB')], - stderr=subprocess.STDOUT) - return rv.decode('UTF-8').replace('added storage ', '').split(' ')[0] - - -def detach_storage(storage_name): - """Detach previously allocated Juju storage.""" - subprocess.check_call(['juju', 'detach-storage', storage_name]) - - -def remove_storage(storage_name, force=False): - """Remove Juju storage. - - :param storage_name: The name of the previously allocated Juju storage. - :type storage_name: str - - :param force: If False (default), require that the storage be detached - before it can be removed. - :type force: bool - """ - cmd = ['juju', 'remove-storage', storage_name] - if force: - cmd.append('--force') - subprocess.check_call(cmd) - - -def add_loop_device(unit, size=10): - """Add a loopback device to a Juju unit. - - :param unit: The unit name on which to create the device. - :type unit: str - - :param size: The size in GB of the device. - :type size: int - - :returns: The device name. - """ - loop_name = '/home/ubuntu/loop.img' - truncate = 'truncate --size {}GB {}'.format(size, loop_name) - losetup = 'losetup --find {}'.format(loop_name) - lofind = 'losetup -a | grep {} | cut -f1 -d ":"'.format(loop_name) - cmd = "sudo sh -c '{} && {} && {}'".format(truncate, losetup, lofind) - return zaza.model.run_on_unit(unit, cmd) From e6d6b9e4b517b6bd737a2866ed5b23e2ab8720b6 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Thu, 17 Feb 2022 18:12:05 -0300 Subject: [PATCH 08/10] Run command on ceph-mon since some versions don't allow ceph-osd for it --- zaza/openstack/charm_tests/ceph/tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index 61c2d47..5bede4a 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -552,13 +552,13 @@ class CephTest(test_utils.OpenStackBaseTest): return int(result['num_osds']) def test_cache_device(self): - """Test adding a new disk with a caching device.""" + """Test adding a new disk with a caching device.""" logging.info('Running add-disk action with a caching device') + mon = next(iter(zaza_model.get_units('ceph-mon'))).entity_id osds = [x.entity_id for x in zaza_model.get_units('ceph-osd')] - num_osds = self.get_num_osds(osds[0]) for unit in osds: - zaza_model.add_storage(unit, 'cache-devices', 'cinder', 10) - loop_dev = zaza_utils.add_loop_device(unit, 10) + add_storage(unit, 'cache-devices', 'cinder', 10) + loop_dev = add_loop_device(unit, 10) action_obj = zaza_model.run_action( unit_name=unit, action_name='add-disk', @@ -566,7 +566,7 @@ class CephTest(test_utils.OpenStackBaseTest): 'partition-size': 5} ) zaza_utils.assertActionRanOK(action_obj) - self.assertEqual(num_osds + len(osds), self.get_num_osds(osds[0])) + self.assertEqual(len(osds) * 2, self.get_num_osds(mon)) class CephRGWTest(test_utils.OpenStackBaseTest): From ed47cb718a5fe230b06b5c92bbca9f720a14ee73 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Thu, 17 Feb 2022 18:15:46 -0300 Subject: [PATCH 09/10] Correctly indent docstring --- zaza/openstack/charm_tests/ceph/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index 5bede4a..1ef7c10 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -552,7 +552,7 @@ class CephTest(test_utils.OpenStackBaseTest): return int(result['num_osds']) def test_cache_device(self): - """Test adding a new disk with a caching device.""" + """Test adding a new disk with a caching device.""" logging.info('Running add-disk action with a caching device') mon = next(iter(zaza_model.get_units('ceph-mon'))).entity_id osds = [x.entity_id for x in zaza_model.get_units('ceph-osd')] From 11fa17fc6e13bfd7db51fabf44466e2581f8499b Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Thu, 17 Feb 2022 18:19:49 -0300 Subject: [PATCH 10/10] Correctly prefix module access --- zaza/openstack/charm_tests/ceph/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index 1ef7c10..de493a3 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -557,8 +557,8 @@ class CephTest(test_utils.OpenStackBaseTest): mon = next(iter(zaza_model.get_units('ceph-mon'))).entity_id osds = [x.entity_id for x in zaza_model.get_units('ceph-osd')] for unit in osds: - add_storage(unit, 'cache-devices', 'cinder', 10) - loop_dev = add_loop_device(unit, 10) + zaza_model.add_storage(unit, 'cache-devices', 'cinder', 10) + loop_dev = zaza_utils.add_loop_device(unit, 10) action_obj = zaza_model.run_action( unit_name=unit, action_name='add-disk',