]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume tests add tests for get_block_devs
authorAlfredo Deza <adeza@redhat.com>
Thu, 3 May 2018 16:45:05 +0000 (12:45 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 4 May 2018 17:22:52 +0000 (13:22 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/tests/util/test_disk.py

index 625116b44b404618e9a40aecc2e3e0df552dc72c..dc6f208f7a82432f079b58fc6c7ca1b40b32d2d2 100644 (file)
@@ -84,3 +84,16 @@ class TestMapDevPaths(object):
         assert result['dm-0'] == dm_path
         assert result[sda_path] == sda_path
         assert result[dm_path] == 'dm-0'
+
+
+class TestGetBlockDevs(object):
+
+    def test_loop_devices_are_missing(self, tmpfile):
+        path = os.path.dirname(tmpfile(name='loop0', contents=''))
+        result = disk.get_block_devs(sys_block_path=path)
+        assert result == []
+
+    def test_loop_devices_are_included(self, tmpfile):
+        path = os.path.dirname(tmpfile(name='loop0', contents=''))
+        result = disk.get_block_devs(sys_block_path=path, skip_loop=False)
+        assert result == ['loop0']