Exemplo n.º 1
0
 def test_dmname_to_blkdev_mapping_empty(self):
     """dmname_to_blkdev_mapping returns empty dict when dmsetup is empty.
     """
     self.m_subp.return_value = ("No devices found", "")
     expected_mapping = {}
     self.assertEqual(expected_mapping,
                      multipath.dmname_to_blkdev_mapping())
Exemplo n.º 2
0
 def test_dmname_to_blkdev_mapping(self):
     """dmname_to_blkdev_mapping returns dmname to blkdevice dictionary."""
     self.m_subp.return_value = (DMSETUP_LS_BLKDEV_OUTPUT, "")
     expected_mapping = {
         'mpatha': '/dev/dm-0',
         'mpatha-part1': '/dev/dm-1',
         '1gb zero': '/dev/dm-2',
     }
     self.assertEqual(expected_mapping,
                      multipath.dmname_to_blkdev_mapping())