def test_base_eth_device(self): net = self.eth_int('0000:10:00.0') expect = { 'interface_name': 'eth2', 'mac_address': 'a8:9d:21:cf:93:fc', 'pci_address': '0000:10:00.0', 'state': 'up', } self.assertTrue(check_device(net, expect))
def test_get_device_from_pci_address(self): devices = self.pci_devs() expect = { '0000:10:00.1': { 'interface_name': 'eth3', 'mac_address': 'a8:9d:21:cf:93:fd', 'pci_address': '0000:10:00.1', 'state': 'down', }, } self.assertTrue( check_device(devices.get_device_from_pci_address('0000:10:00.1'), expect['0000:10:00.1']))
def test_get_device_from_pci_address(self): devices = self.pci_devs() expect = { '0000:10:00.1': { 'interface_name': 'eth3', 'mac_address': 'a8:9d:21:cf:93:fd', 'pci_address': '0000:10:00.1', 'state': 'down', }, } self.assertTrue(check_device( devices.get_device_from_pci_address('0000:10:00.1'), expect['0000:10:00.1']))
def test_base(self): devices = self.pci_devs() self.assertEqual(len(devices.pci_devices), 2) expect = { '0000:10:00.0': { 'interface_name': 'eth2', 'mac_address': 'a8:9d:21:cf:93:fc', 'pci_address': '0000:10:00.0', 'state': 'up', }, '0000:10:00.1': { 'interface_name': 'eth3', 'mac_address': 'a8:9d:21:cf:93:fd', 'pci_address': '0000:10:00.1', 'state': 'down', }, } for device in devices.pci_devices: self.assertTrue(check_device(device, expect[device.pci_address]))