1
0
mirror of https://github.com/ceph/ceph synced 2025-03-30 07:19:14 +00:00

ceph-volume lvm.tests conftest fixtures for custom vgs

Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
Alfredo Deza 2018-09-11 16:53:54 -04:00
parent 2ced05a2bc
commit 9f14db4323

View File

@ -52,6 +52,24 @@ def fake_call(monkeypatch):
return fake_call
@pytest.fixture
def fakedevice(factory):
def apply(**kw):
params = dict(
path='/dev/sda',
abspath='/dev/sda',
lv_api=None,
pvs_api=[],
disk_api={},
sys_api={},
exists=True,
is_lvm_member=True,
)
params.update(dict(kw))
return factory(**params)
return apply
@pytest.fixture
def stub_call(monkeypatch):
"""
@ -117,6 +135,13 @@ def volume_groups(monkeypatch):
return vgs
@pytest.fixture
def stub_vgs(monkeypatch, volume_groups):
def apply(vgs):
monkeypatch.setattr(lvm_api, 'get_api_vgs', lambda: vgs)
return apply
@pytest.fixture
def pvolumes(monkeypatch):
monkeypatch.setattr('ceph_volume.process.call', lambda x: ('', '', 0))