From 494ece30994c9d80c9f4afc72213515f8ed63698 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 23 Aug 2018 15:46:43 -0400 Subject: [PATCH] ceph-volume tests check uuid_name when creating an lv Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/tests/api/test_lvm.py | 9 +++++++++ 1 file changed, 9 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 aa9dbe68d41..d4c0b723161 100644 --- a/src/ceph-volume/ceph_volume/tests/api/test_lvm.py +++ b/src/ceph-volume/ceph_volume/tests/api/test_lvm.py @@ -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): -- 2.39.5