From 454d48eb29f4429370b831645a29e0450b5b46b1 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 20 Oct 2017 08:10:26 -0400 Subject: [PATCH] ceph-volume tests add support for bluestore list verification Signed-off-by: Alfredo Deza (cherry picked from commit 4674da9c07f871bf1f25bb782c136fe082095a14) --- .../tests/devices/lvm/test_listing.py | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_listing.py b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_listing.py index 71946dd3b10c8..b780ea2e99ccb 100644 --- a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_listing.py +++ b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_listing.py @@ -101,7 +101,21 @@ class TestFullReport(object): assert result['0'][0]['name'] == 'volume1' assert result['0'][1]['name'] == 'journal' - def test_physical_disk_gets_reported(self, volumes, monkeypatch): + def test_ceph_wal_lv_reported(self, volumes, monkeypatch): + tags = 'ceph.osd_id=0,ceph.wal_uuid=x,ceph.type=data' + wal_tags = 'ceph.osd_id=0,ceph.wal_uuid=x,ceph.type=wal' + osd = api.Volume( + lv_name='volume1', lv_uuid='y', lv_path='/dev/VolGroup/lv', lv_tags=tags) + wal = api.Volume( + lv_name='wal', lv_uuid='x', lv_path='/dev/VolGroup/wal', lv_tags=wal_tags) + volumes.append(osd) + volumes.append(wal) + monkeypatch.setattr(lvm.listing.api, 'Volumes', lambda: volumes) + result = lvm.listing.List([]).full_report() + assert result['0'][0]['name'] == 'volume1' + assert result['0'][1]['name'] == 'wal' + + def test_physical_journal_gets_reported(self, volumes, monkeypatch): tags = 'ceph.osd_id=0,ceph.journal_uuid=x,ceph.type=data' osd = api.Volume( lv_name='volume1', lv_uuid='y', lv_path='/dev/VolGroup/lv', lv_tags=tags) @@ -113,6 +127,18 @@ class TestFullReport(object): assert result['0'][1]['tags'] == {'PARTUUID': 'x'} assert result['0'][1]['type'] == 'journal' + def test_physical_wal_gets_reported(self, volumes, monkeypatch): + tags = 'ceph.osd_id=0,ceph.wal_uuid=x,ceph.type=data' + osd = api.Volume( + lv_name='volume1', lv_uuid='y', lv_path='/dev/VolGroup/lv', lv_tags=tags) + volumes.append(osd) + monkeypatch.setattr(lvm.listing.api, 'Volumes', lambda: volumes) + monkeypatch.setattr(lvm.listing.disk, 'get_device_from_partuuid', lambda x: '/dev/sda1') + result = lvm.listing.List([]).full_report() + assert result['0'][1]['path'] == '/dev/sda1' + assert result['0'][1]['tags'] == {'PARTUUID': 'x'} + assert result['0'][1]['type'] == 'wal' + class TestSingleReport(object): -- 2.39.5