Allow out of quota failure status code to be 413 or 403
The commit I2bb8a60ef254afbfed514cfeebe75355d0de4475 tries to change
error codes of quota-out to suitable ones (HTTPForbidden).
We need to allow both HTTP413 and HTTP403 because branchless Tempest
needs to support both master and icehouse/stable branches.
Change-Id: I4a867ba9ffa43801bb05ce1d33687cb5b9a3e0fb
Related-Bug: #1298131
diff --git a/tempest/api/compute/limits/test_absolute_limits_negative.py b/tempest/api/compute/limits/test_absolute_limits_negative.py
index f88699b..b2e2981 100644
--- a/tempest/api/compute/limits/test_absolute_limits_negative.py
+++ b/tempest/api/compute/limits/test_absolute_limits_negative.py
@@ -39,7 +39,9 @@
for xx in range(max_meta_data):
meta_data[str(xx)] = str(xx)
- self.assertRaises(exceptions.OverLimit,
+ # A 403 Forbidden or 413 Overlimit (old behaviour) exception
+ # will be raised when out of quota
+ self.assertRaises((exceptions.Unauthorized, exceptions.OverLimit),
self.server_client.create_server,
name='test', meta=meta_data,
flavor_ref=self.flavor_ref,
diff --git a/tempest/api/compute/servers/test_server_personality.py b/tempest/api/compute/servers/test_server_personality.py
index b7e4e38..6cc463d 100644
--- a/tempest/api/compute/servers/test_server_personality.py
+++ b/tempest/api/compute/servers/test_server_personality.py
@@ -40,8 +40,10 @@
path = 'etc/test' + str(i) + '.txt'
personality.append({'path': path,
'contents': base64.b64encode(file_contents)})
- self.assertRaises(exceptions.OverLimit, self.create_test_server,
- personality=personality)
+ # A 403 Forbidden or 413 Overlimit (old behaviour) exception
+ # will be raised when out of quota
+ self.assertRaises((exceptions.Unauthorized, exceptions.OverLimit),
+ self.create_test_server, personality=personality)
@test.attr(type='gate')
def test_can_create_server_with_max_number_personality_files(self):