Пример #1
0
 def test_get_physical_function_mac(self, mock_join, mock_listdir):
     mock_listdir.return_value = [self.if_name]
     mock_join.return_value = self.fake_file
     mac = utils.get_mac_by_pci_address(self.pci_address, pf_interface=True)
     mock_join.assert_called_once_with(
         "/sys/bus/pci/devices/%s/physfn/net" % self.pci_address,
         self.if_name, "address")
     self.assertEqual("a0:36:9f:72:00:00", mac)
Пример #2
0
 def test_get_physical_function_mac(self, mock_join, mock_listdir):
     mock_listdir.return_value = [self.if_name]
     mock_join.return_value = self.fake_file
     mac = utils.get_mac_by_pci_address(self.pci_address, pf_interface=True)
     mock_join.assert_called_once_with(
         "/sys/bus/pci/devices/%s/physfn/net" % self.pci_address,
         self.if_name, "address")
     self.assertEqual("a0:36:9f:72:00:00", mac)
Пример #3
0
 def test_get_mac(self, mock_join, mock_listdir):
     mock_listdir.return_value = [self.if_name]
     mock_join.return_value = self.fake_file
     mac = utils.get_mac_by_pci_address(self.pci_address)
     mock_join.assert_called_once_with(
         "/sys/bus/pci/devices/{0!s}/net".format(self.pci_address), self.if_name,
         "address")
     self.assertEqual("a0:36:9f:72:00:00", mac)