コード例 #1
0
 def test_get_sysnet_interfaces_and_macs_virtio(self, _update, _interface,
                                                _mac, _state, _sriov,
                                                _osrealpath, _osislink):
     self.glob.glob.return_value = ['/sys/class/net/eth2']
     _interface.return_value = 'eth2'
     _mac.return_value = 'a8:9d:21:cf:93:fc'
     _state.return_value = 'up'
     _sriov.return_value = False
     _osrealpath.return_value = ('/sys/devices/pci0000:00/0000:00:07.0/'
                                 'virtio5')
     expect = {
         'interface': 'eth2',
         'mac_address': 'a8:9d:21:cf:93:fc',
         'pci_address': '0000:00:07.0',
         'state': 'up',
         'sriov': False,
     }
     self.assertEqual(pci.get_sysnet_interfaces_and_macs(), [expect])
コード例 #2
0
 def test_get_sysnet_interfaces_and_macs_virtio(self, _update, _interface,
                                                _mac, _state, _sriov,
                                                _osrealpath,
                                                _osislink):
     self.glob.glob.return_value = ['/sys/class/net/eth2']
     _interface.return_value = 'eth2'
     _mac.return_value = 'a8:9d:21:cf:93:fc'
     _state.return_value = 'up'
     _sriov.return_value = False
     _osrealpath.return_value = ('/sys/devices/pci0000:00/0000:00:07.0/'
                                 'virtio5')
     expect = {
         'interface': 'eth2',
         'mac_address': 'a8:9d:21:cf:93:fc',
         'pci_address': '0000:00:07.0',
         'state': 'up',
         'sriov': False,
     }
     self.assertEqual(pci.get_sysnet_interfaces_and_macs(), [expect])