From: Alfredo Deza Date: Thu, 3 May 2018 16:45:05 +0000 (-0400) Subject: ceph-volume tests add tests for get_block_devs X-Git-Tag: v14.0.0~189^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=672c4c4d1c31b4631b1238ed0efb98fef34f2a3d;p=ceph.git ceph-volume tests add tests for get_block_devs Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/tests/util/test_disk.py b/src/ceph-volume/ceph_volume/tests/util/test_disk.py index 625116b44b404..dc6f208f7a824 100644 --- a/src/ceph-volume/ceph_volume/tests/util/test_disk.py +++ b/src/ceph-volume/ceph_volume/tests/util/test_disk.py @@ -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']