Esempio n. 1
0
 def _set_ip_address(self, ip_address, iface):
     ip_data = address.IPAddressData(ip_address, device=iface)
     IPAddress.add(ip_data)
Esempio n. 2
0
 def _test_delete_non_existing_ip(self, ip):
     with dummy_device() as nic:
         with self.assertRaises(address.IPAddressDeleteError):
             IPAddressTest.IPAddress.delete(
                 address.IPAddressData(ip, device=nic))
Esempio n. 3
0
 def _test_add_with_non_existing_device(self, ip):
     with self.assertRaises(address.IPAddressAddError):
         IPAddressTest.IPAddress.add(
             address.IPAddressData(ip, device='tim the enchanter'))
Esempio n. 4
0
 def test_ipv6_init_invalid(self):
     with self.assertRaises(address.IPAddressDataError):
         address.IPAddressData(IPV6_INVALID_WITH_PREFIXLEN,
                               device=DEVICE_NAME)
Esempio n. 5
0
 def _test_delete_non_existing_ip(self, ip):
     with dummy_device() as nic:
         with pytest.raises(address.IPAddressDeleteError):
             TestIPAddress.IPAddress.delete(
                 address.IPAddressData(ip, device=nic)
             )
Esempio n. 6
0
 def _test_add_with_non_existing_device(self, ip):
     with pytest.raises(address.IPAddressAddError):
         TestIPAddress.IPAddress.add(
             address.IPAddressData(ip, device='tim the enchanter')
         )