class TestCreateLVs(object):
- def setup(self):
+ def setup_method(self):
self.vg = api.VolumeGroup(vg_name='ceph',
vg_extent_size=1073741824,
vg_extent_count=99999999,
class TestVolumeGroupSizing(object):
- def setup(self):
+ def setup_method(self):
self.vg = api.VolumeGroup(vg_name='ceph',
vg_extent_size=1073741824,
vg_free_count=1024)
class TestCreateLV(object):
- def setup(self):
+ def setup_method(self):
self.foo_volume = api.Volume(lv_name='foo', lv_path='/path', vg_name='foo_group', lv_tags='')
self.foo_group = api.VolumeGroup(vg_name='foo_group',
vg_extent_size="4194304",
class TestTags(object):
- def setup(self):
+ def setup_method(self):
self.foo_volume_clean = api.Volume(lv_name='foo_clean', lv_path='/pathclean',
vg_name='foo_group',
lv_tags='')
class TestExtendVG(object):
- def setup(self):
+ def setup_method(self):
self.foo_volume = api.VolumeGroup(vg_name='foo', lv_tags='')
def test_uses_single_device_in_list(self, monkeypatch, fake_run):
class TestReduceVG(object):
- def setup(self):
+ def setup_method(self):
self.foo_volume = api.VolumeGroup(vg_name='foo', lv_tags='')
def test_uses_single_device_in_list(self, monkeypatch, fake_run):
class TestCreateVG(object):
- def setup(self):
+ def setup_method(self):
self.foo_volume = api.VolumeGroup(vg_name='foo', lv_tags='')
def test_no_name(self, monkeypatch, fake_run):
class TestWipeFs(object):
- def setup(self):
+ def setup_method(self):
os.environ['CEPH_VOLUME_WIPEFS_INTERVAL'] = '0'
def test_works_on_second_try(self, stub_call):
class TestGetContents(object):
- def setup(self):
+ def setup_method(self):
self.magic_file_name = '/tmp/magic-file'
def test_multiple_lines_are_left_as_is(self, fake_filesystem):
class TestMain(object):
- def setup(self):
+ def setup_method(self):
conf.log_path = '/tmp/'
def test_no_arguments_parsing_error(self):
class TestConf(object):
- def setup(self):
+ def setup_method(self):
self.conf_file = StringIO(dedent("""
[foo]
default = 0
class TestCatches(object):
- def teardown(self):
+ def teardown_method(self):
try:
del(os.environ['CEPH_VOLUME_DEBUG'])
except KeyError:
class TestWriteUnicode(object):
- def setup(self):
+ def setup_method(self):
self.octpus_and_squid_en = u'octpus and squid'
self.octpus_and_squid_zh = u'章鱼和鱿鱼'
self.message = self.octpus_and_squid_en + self.octpus_and_squid_zh
class TestOSDPath(object):
- def setup(self):
+ def setup_method(self):
self.validator = arg_validators.OSDPath()
def test_is_not_root(self, monkeypatch):
class TestExcludeGroupOptions(object):
- def setup(self):
+ def setup_method(self):
self.parser = argparse.ArgumentParser()
def test_flags_in_one_group(self):
class TestValidDevice(object):
- def setup(self, fake_filesystem):
+ def setup_method(self, fake_filesystem):
self.validator = arg_validators.ValidDevice()
@patch('ceph_volume.util.arg_validators.disk.has_bluestore_label', return_value=False)
self.validator('/dev/foo')
class TestValidZapDevice(object):
- def setup(self):
+ def setup_method(self):
self.validator = arg_validators.ValidZapDevice()
@patch('ceph_volume.util.arg_validators.Device')
assert self.validator('/dev/foo')
class TestValidDataDevice(object):
- def setup(self):
+ def setup_method(self):
self.validator = arg_validators.ValidDataDevice()
@patch('ceph_volume.util.arg_validators.Device')
self.validator('/dev/foo')
class TestValidRawDevice(object):
- def setup(self):
+ def setup_method(self):
self.validator = arg_validators.ValidRawDevice()
@patch('ceph_volume.util.arg_validators.Device')
assert self.validator('/dev/foo')
class TestValidBatchDevice(object):
- def setup(self):
+ def setup_method(self):
self.validator = arg_validators.ValidBatchDevice()
@patch('ceph_volume.util.arg_validators.Device')
assert self.validator('/dev/foo')
class TestValidBatchDataDevice(object):
- def setup(self):
+ def setup_method(self):
self.validator = arg_validators.ValidBatchDataDevice()
@patch('ceph_volume.util.arg_validators.Device')
class TestValidFraction(object):
- def setup(self):
+ def setup_method(self):
self.validator = arg_validators.ValidFraction()
def test_fraction_is_valid(self, fake_call):
class TestDeviceOrdering(object):
- def setup(self):
+ def setup_method(self):
self.data = {
"/dev/sda": {"removable": 0},
"/dev/sdb": {"removable": 1}, # invalid
class TestSetContext(object):
- def setup(self):
+ def setup_method(self):
try:
os.environ.pop('CEPH_VOLUME_SKIP_RESTORECON')
except KeyError: