예제 #1
0
 def _set_ip_address(self, ip_address, iface):
     ip_data = address.IPAddressData(ip_address, device=iface)
     IPAddress.add(ip_data)
예제 #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))
예제 #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'))
예제 #4
0
 def test_ipv6_init_invalid(self):
     with self.assertRaises(address.IPAddressDataError):
         address.IPAddressData(IPV6_INVALID_WITH_PREFIXLEN,
                               device=DEVICE_NAME)
예제 #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)
             )
예제 #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')
         )