Merge "Add max_header_size to swift.conf-sample and relative UT"

This commit is contained in:
Jenkins 2013-06-20 14:04:26 +00:00 committed by Gerrit Code Review
commit c19daab149
2 changed files with 18 additions and 3 deletions

View File

@ -48,6 +48,14 @@ swift_hash_path_prefix = changeme
#max_meta_overall_size = 4096
# max_header_size is the max number of bytes in the utf8 encoding of each
# header. Using 8192 as default becasue eventlet use 8192 as max size of
# header line and the longest header passed from Keystone(PKI token) uses
# 8192 as default too.
#max_header_size = 8192
# max_object_name_length is the max number of bytes in the utf8 encoding
# of an object name

View File

@ -210,5 +210,12 @@ class TestConstraints(unittest.TestCase):
self.assertEquals(constraints.check_metadata(req, 'object').status_int,
HTTP_BAD_REQUEST)
def test_validate_constraints(self):
c = constraints
self.assertTrue(c.MAX_META_OVERALL_SIZE > c.MAX_META_NAME_LENGTH)
self.assertTrue(c.MAX_META_OVERALL_SIZE > c.MAX_META_VALUE_LENGTH)
self.assertTrue(c.MAX_HEADER_SIZE > c.MAX_META_NAME_LENGTH)
self.assertTrue(c.MAX_HEADER_SIZE > c.MAX_META_VALUE_LENGTH)
if __name__ == '__main__':
unittest.main()