]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume tests add support for bluestore list verification
authorAlfredo Deza <adeza@redhat.com>
Fri, 20 Oct 2017 12:10:26 +0000 (08:10 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 20 Oct 2017 16:10:07 +0000 (12:10 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/tests/devices/lvm/test_listing.py

index 71946dd3b10c8edf5dc51ea4b3c217c2346d7b73..b780ea2e99ccbbf0175c08ed94ed8d386f8a5e71 100644 (file)
@@ -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):