def test_show_maps(self):
     self.m_subp.return_value = ("foo=bar wark=2", "")
     expected = [
         'multipathd', 'show', 'maps', 'raw', 'format',
         multipath.SHOW_MAPS_FMT
     ]
     self.assertEqual([{'foo': 'bar', 'wark': '2'}], multipath.show_maps())
     self.m_subp.assert_called_with(expected, capture=True)
Example #2
0
 def test_show_maps_nvme(self):
     """verify show_maps extracts mulitpath map data correctly."""
     NVME_MP = multipath.util.load_file('tests/data/multipath-nvme.txt')
     self.m_subp.return_value = (NVME_MP, "")
     expected = [
         'multipathd', 'show', 'maps', 'raw', 'format',
         multipath.SHOW_MAPS_FMT
     ]
     self.assertEqual([{
         'name':
         ('nqn.1994-11.com.samsung:nvme:PM1725a:HHHL:S3RVNA0J300208      '
          ':nsid.1'),
         'multipath':
         'eui.335256304a3002080025384100000001',
         'sysfs':
         'nvme0n1',
         'paths':
         '1'
     }], multipath.show_maps())
     self.m_subp.assert_called_with(expected, capture=True)