summaryrefslogtreecommitdiff
path: root/test/functional/test_account.py
diff options
context:
space:
mode:
authorHisashi Osanai <osanai.hisashi@jp.fujitsu.com>2015-06-02 17:00:42 +0900
committerAlistair Coles <alistair.coles@hp.com>2015-06-04 15:08:13 +0000
commit93de6c73e587a672663fa0997f439b73b336769c (patch)
treeff08f65c4952ac9f375d4939a85d1f2fc34965bf /test/functional/test_account.py
parent1c8f6759588402916d70415508df155b1985896f (diff)
downloadswift-93de6c73e587a672663fa0997f439b73b336769c.tar.gz
Add metadata size tests on the border
This patch adds a test for a 204 when a single metadata item in a POST causes the backend aggregate constraints check to be on the border. Background: Overall metadata size constraint is enforced in the container and account backends as well as in the proxy controllers. Whereas the proxy controller can check that constraints are not exceeded by a single PUT or POST request, the backend checks that constraints are not exceeded by the aggregate of all PUTs and POSTs. The change [1] added a test for a 400 when a single metadata item in a POST causes the backend aggregate constraints check to go over limit. [1] I1489e29686013cbd3d70283d8756b548aea3c2e1 Change-Id: Iac86ea71240ddde177e625c279c21aef67659d10
Diffstat (limited to 'test/functional/test_account.py')
-rwxr-xr-xtest/functional/test_account.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/functional/test_account.py b/test/functional/test_account.py
index d0d18c052..0bd7b886c 100755
--- a/test/functional/test_account.py
+++ b/test/functional/test_account.py
@@ -829,14 +829,21 @@ class TestAccount(unittest.TestCase):
self.assertEqual(resp.status, 204)
# this POST includes metadata size that is over limit
headers['X-Account-Meta-k'] = \
- 'v' * (self.max_meta_overall_size - size)
+ 'x' * (self.max_meta_overall_size - size)
resp = retry(post, headers)
resp.read()
self.assertEqual(resp.status, 400)
+ # this POST would be ok and the aggregate backend metadata
+ # size is on the border
+ headers = {'X-Account-Meta-k':
+ 'y' * (self.max_meta_overall_size - size - 1)}
+ resp = retry(post, headers)
+ resp.read()
+ self.assertEqual(resp.status, 204)
# this last POST would be ok by itself but takes the aggregate
# backend metadata size over limit
headers = {'X-Account-Meta-k':
- 'v' * (self.max_meta_overall_size - size)}
+ 'z' * (self.max_meta_overall_size - size)}
resp = retry(post, headers)
resp.read()
self.assertEqual(resp.status, 400)