From 672c4c4d1c31b4631b1238ed0efb98fef34f2a3d Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 3 May 2018 12:45:05 -0400 Subject: [PATCH] ceph-volume tests add tests for get_block_devs Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/tests/util/test_disk.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 625116b44b4..dc6f208f7a8 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'] -- 2.39.5