From: Mohamad Gebai Date: Tue, 2 Apr 2019 10:51:14 +0000 (-0400) Subject: ceph-volume: add test for create_lv using a PV X-Git-Tag: v15.1.0~2912^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=90d296b302e74b59fc67c395b4d08537e2d37a1e;p=ceph.git ceph-volume: add test for create_lv using a PV Signed-off-by: Mohamad Gebai --- diff --git a/src/ceph-volume/ceph_volume/tests/api/test_lvm.py b/src/ceph-volume/ceph_volume/tests/api/test_lvm.py index 5e58aaa4dc97d..272b3636e4c6d 100644 --- a/src/ceph-volume/ceph_volume/tests/api/test_lvm.py +++ b/src/ceph-volume/ceph_volume/tests/api/test_lvm.py @@ -568,6 +568,14 @@ class TestCreateLV(object): expected = ['lvcreate', '--yes', '-L', '5G', '-n', 'foo', 'foo_group'] assert capture.calls[0]['args'][0] == expected + def test_with_pv(self, monkeypatch, capture): + monkeypatch.setattr(process, 'run', capture) + monkeypatch.setattr(process, 'call', capture) + monkeypatch.setattr(api, 'get_lv', lambda *a, **kw: self.foo_volume) + api.create_lv('foo', 'foo_group', size='5G', tags={'ceph.type': 'data'}, pv='/path') + expected = ['lvcreate', '--yes', '-L', '5G', '-n', 'foo', 'foo_group', '/path'] + assert capture.calls[0]['args'][0] == expected + def test_calls_to_set_type_tag(self, monkeypatch, capture): monkeypatch.setattr(process, 'run', capture) monkeypatch.setattr(process, 'call', capture)