From 80223c38c6b146af62ec396753ca254bf114de8f Mon Sep 17 00:00:00 2001 From: zhufl Date: Tue, 20 Dec 2016 14:53:21 +0800 Subject: [PATCH] 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 --- tempest/api/network/admin/test_negative_quotas.py | 3 +-- tempest/api/network/test_dhcp_ipv6.py | 2 +- .../api/object_storage/test_container_services_negative.py | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tempest/api/network/admin/test_negative_quotas.py b/tempest/api/network/admin/test_negative_quotas.py index c256b5b156..beb6ce615c 100644 --- a/tempest/api/network/admin/test_negative_quotas.py +++ b/tempest/api/network/admin/test_negative_quotas.py @@ -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']) diff --git a/tempest/api/network/test_dhcp_ipv6.py b/tempest/api/network/test_dhcp_ipv6.py index 84c48ec065..b4dcb356ce 100644 --- a/tempest/api/network/test_dhcp_ipv6.py +++ b/tempest/api/network/test_dhcp_ipv6.py @@ -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'], diff --git a/tempest/api/object_storage/test_container_services_negative.py b/tempest/api/object_storage/test_container_services_negative.py index f63c51832f..2856fabf5c 100644 --- a/tempest/api/object_storage/test_container_services_negative.py +++ b/tempest/api/object_storage/test_container_services_negative.py @@ -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))