]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: add test for create_lv using a PV 27282/head
authorMohamad Gebai <mgebai@suse.com>
Tue, 2 Apr 2019 10:51:14 +0000 (06:51 -0400)
committerMohamad Gebai <mgebai@suse.com>
Fri, 12 Apr 2019 16:54:08 +0000 (12:54 -0400)
Signed-off-by: Mohamad Gebai <mgebai@suse.com>
src/ceph-volume/ceph_volume/tests/api/test_lvm.py

index 5e58aaa4dc97dc0785ace11f17f5a8682e8cc28f..272b3636e4c6d3e5e50f6342db3ca75d4487a146 100644 (file)
@@ -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)