Exemplo n.º 1
0
 def test_get_edd_dict_1(self):
     """ Test get_edd_dict()'s pci_dev matching. """
     from storage.devicelibs import edd
     fs = EddTestFS(edd).sda_vda()
     self.assertEqual(edd.get_edd_dict([]),
                      {'sda' : 0x80,
                       'vda' : 0x81})
 def test_get_edd_dict_2(self):
     """ Test get_edd_dict()'s pci_dev matching. """
     from storage.devicelibs import edd
     edd.collect_mbrs = mock.Mock(return_value={
         'sda': '0x000ccb01',
         'vda': '0x0006aef1'
     })
     fs = EddTestFS(edd).sda_vda_missing_details()
     self.assertEqual(edd.get_edd_dict([]), {'sda': 0x80, 'vda': 0x81})
Exemplo n.º 3
0
 def test_get_edd_dict_2(self):
     """ Test get_edd_dict()'s pci_dev matching. """
     from storage.devicelibs import edd
     edd.collect_mbrs = mock.Mock(return_value = {
             'sda' : '0x000ccb01',
             'vda' : '0x0006aef1'})
     fs = EddTestFS(edd).sda_vda_missing_details()
     self.assertEqual(edd.get_edd_dict([]),
                      {'sda' : 0x80,
                       'vda' : 0x81})
Exemplo n.º 4
0
 def test_get_edd_dict_3(self):
     """ Test scenario when the 0x80 and 0x81 edd directories contain the
         same data and give no way to distinguish among the two devices.
     """
     from storage.devicelibs import edd
     edd.log = mock.Mock()
     edd.collect_mbrs = mock.Mock(return_value={'sda' : '0x000ccb01',
                                                'vda' : '0x0006aef1'})
     fs = EddTestFS(edd).sda_sdb_same()
     self.assertEqual(edd.get_edd_dict([]), {})
     self.assertIn((('edd: both edd entries 0x80 and 0x81 seem to map to sda',), {}),
                   edd.log.info.call_args_list)
 def test_get_edd_dict_3(self):
     """ Test scenario when the 0x80 and 0x81 edd directories contain the
         same data and give no way to distinguish among the two devices.
     """
     from storage.devicelibs import edd
     edd.log = mock.Mock()
     edd.collect_mbrs = mock.Mock(return_value={
         'sda': '0x000ccb01',
         'vda': '0x0006aef1'
     })
     fs = EddTestFS(edd).sda_sdb_same()
     self.assertEqual(edd.get_edd_dict([]), {})
     self.assertIn(
         (('edd: both edd entries 0x80 and 0x81 seem to map to sda', ), {}),
         edd.log.info.call_args_list)
 def test_get_edd_dict_1(self):
     """ Test get_edd_dict()'s pci_dev matching. """
     from storage.devicelibs import edd
     fs = EddTestFS(edd).sda_vda()
     self.assertEqual(edd.get_edd_dict([]), {'sda': 0x80, 'vda': 0x81})