]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: add test for create_lv using a PV 32544/head
authorMohamad Gebai <mgebai@suse.com>
Tue, 2 Apr 2019 10:51:14 +0000 (06:51 -0400)
committerJan Fajerski <jfajerski@suse.com>
Wed, 8 Jan 2020 09:35:59 +0000 (10:35 +0100)
Signed-off-by: Mohamad Gebai <mgebai@suse.com>
(cherry picked from commit 90d296b302e74b59fc67c395b4d08537e2d37a1e)

src/ceph-volume/ceph_volume/tests/api/test_lvm.py

index 6e057c02fe4693584751992551e17f5c2cd84ca3..223ac501382f99641260ccf79bed5f133c8f8000 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)