]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume tests check uuid_name when creating an lv
authorAlfredo Deza <adeza@redhat.com>
Thu, 23 Aug 2018 19:46:43 +0000 (15:46 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 24 Aug 2018 15:18:03 +0000 (11:18 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/tests/api/test_lvm.py

index aa9dbe68d417d0734859c5abe43a0bc48fb3ee2a..d4c0b7231615f2ff0b7929dc97e21106d16ec7ed 100644 (file)
@@ -578,6 +578,15 @@ class TestCreateLV(object):
         data_tag = ['lvchange', '--addtag', 'ceph.data_device=/path', '/path']
         assert capture.calls[2]['args'][0] == data_tag
 
+    def test_uses_uuid(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'}, uuid_name=True)
+        result = capture.calls[0]['args'][0][5]
+        assert result.startswith('foo-')
+        assert len(result) == 40
+
 
 class TestExtendVG(object):