From 6cff7e526f35bb0377cbad42139b2fa8b5a996c8 Mon Sep 17 00:00:00 2001 From: Mohamad Gebai Date: Tue, 2 Apr 2019 06:51:14 -0400 Subject: [PATCH] ceph-volume: add test for create_lv using a PV Signed-off-by: Mohamad Gebai (cherry picked from commit 90d296b302e74b59fc67c395b4d08537e2d37a1e) --- src/ceph-volume/ceph_volume/tests/api/test_lvm.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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 6e057c02fe469..223ac501382f9 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) -- 2.39.5