Do not parse Neutron error message to tolerate message changing
Two Neutron exception messages are being refined in
https://review.openstack.org/#/c/121767/. Need to use assertRaises instead of
assertRaisesRegexp to make test case tolerate message changing in the future.
Change-Id: Ia92f750c81b29ebe15e06d62a08b3f0ef14f3b84
Related-Bug: 1369871
diff --git a/tempest/api/network/test_dhcp_ipv6.py b/tempest/api/network/test_dhcp_ipv6.py
index 6ce1216..1257699 100644
--- a/tempest/api/network/test_dhcp_ipv6.py
+++ b/tempest/api/network/test_dhcp_ipv6.py
@@ -327,12 +327,11 @@
subnet["allocation_pools"][0]["end"])
ip = netaddr.IPAddress(random.randrange(
ip_range.last + 1, ip_range.last + 10)).format()
- self.assertRaisesRegexp(exceptions.BadRequest,
- "not a valid IP for the defined subnet",
- self.create_port,
- self.network,
- fixed_ips=[{'subnet_id': subnet['id'],
- 'ip_address': ip}])
+ self.assertRaises(exceptions.BadRequest,
+ self.create_port,
+ self.network,
+ fixed_ips=[{'subnet_id': subnet['id'],
+ 'ip_address': ip}])
def test_dhcp_stateful_fixedips_duplicate(self):
"""When port gets IP address from fixed IP range it