Check error message returned by the system

Testcases should check the error message returned
by the system, not the error message defined in Tempest,
that is meaningless.

ref: https://tools.ietf.org/html/rfc7231#section-6.5.8

Change-Id: If84b7dc1f4b7681169d9041288169d81c5ebe586
This commit is contained in:
zhufl 2016-12-20 14:53:21 +08:00
parent 3dbde9de52
commit 80223c38c6
3 changed files with 4 additions and 5 deletions

View File

@ -57,8 +57,7 @@ class QuotasNegativeTest(base.BaseAdminNetworkTest):
# Try to create a third network while the quota is two
with self.assertRaisesRegex(
lib_exc.Conflict,
"An object with that identifier already exists\\n" +
"Details.*Quota exceeded for resources: \['network'\].*"):
"Quota exceeded for resources: \['network'\].*"):
n3 = self.networks_client.create_network()
self.addCleanup(self.networks_client.delete_network,
n3['network']['id'])

View File

@ -340,7 +340,7 @@ class NetworksTestDHCPv6(base.BaseNetworkTest):
{'subnet_id': subnet['id'],
'ip_address': ip}])
self.assertRaisesRegex(lib_exc.Conflict,
"object with that identifier already exists",
"IpAddressAlreadyAllocated|IpAddressInUse",
self.create_port,
self.network,
fixed_ips=[{'subnet_id': subnet['id'],

View File

@ -173,5 +173,5 @@ class ContainerNegativeTest(base.BaseObjectTest):
ex = self.assertRaises(exceptions.Conflict,
self.container_client.delete_container,
container_name)
self.assertIn('An object with that identifier already exists',
str(ex))
self.assertIn('There was a conflict when trying to complete your '
'request.', str(ex))