コード例 #1
0
ファイル: test_network.py プロジェクト: tdutrion/salt
 def test_hw_addr(self):
     '''
     Test for return the hardware address (a.k.a. MAC address)
      for a given interface
     '''
     with patch.object(salt.utils.network, 'hw_addr', return_value={}):
         self.assertDictEqual(network.hw_addr('iface'), {})
コード例 #2
0
ファイル: network_test.py プロジェクト: DaveQB/salt
 def test_hw_addr(self):
     '''
     Test for return the hardware address (a.k.a. MAC address)
      for a given interface
     '''
     with patch.object(salt.utils.network, 'hw_addr', return_value={}):
         self.assertDictEqual(network.hw_addr('iface'), {})
コード例 #3
0
 def test_hw_addr(self):
     """
     Test for return the hardware address (a.k.a. MAC address)
      for a given interface
     """
     with patch.object(salt.utils.network, "hw_addr", return_value={}):
         self.assertDictEqual(network.hw_addr("iface"), {})
コード例 #4
0
 def test_hw_addr(self):
     """
     Test for return the hardware address (a.k.a. MAC address)
      for a given interface
     """
     with patch.dict(network.__utils__,
                     {"network.hw_addr": MagicMock(return_value={})}):
         self.assertDictEqual(network.hw_addr("iface"), {})
コード例 #5
0
def lb_iptables():
    hw_addrs=[]
    for i in salt_network.interfaces().keys():
        if i.startswith('eth'):
	    hw_addrs.append(salt_network.hw_addr(i))
    return {'hw_addrs':hw_addrs}