tests: Fix some func tests to do with metadata maximums

Previously, if a cluster's combined configured max_meta_name_length and
max_meta_value_length constraints were larger than the configured
max_meta_overall_size, we would accidentally go over the overall size
while intending to just test being exactly at the value length-limit.

Change-Id: I42a5287011509e5b43959aab060f9ec7405ae5b9
This commit is contained in:
Tim Burke 2023-02-02 15:33:54 -08:00
parent 65fd75f710
commit 488f8c839f
2 changed files with 15 additions and 0 deletions

View File

@ -796,6 +796,14 @@ class TestAccount(unittest.TestCase):
'k' * self.max_meta_name_length): 'v'}) 'k' * self.max_meta_name_length): 'v'})
resp.read() resp.read()
self.assertEqual(resp.status, 204) self.assertEqual(resp.status, 204)
# Clear it, so the value-length checking doesn't accidentally trip
# the overall max
resp = retry(post,
{'X-Account-Meta-' + (
'k' * self.max_meta_name_length): ''})
resp.read()
self.assertEqual(resp.status, 204)
resp = retry( resp = retry(
post, post,
{'X-Account-Meta-' + ('k' * ( {'X-Account-Meta-' + ('k' * (

View File

@ -407,6 +407,13 @@ class TestContainer(unittest.TestCase):
{'X-Container-Meta-' + ('k' * self.max_meta_name_length): 'v'}) {'X-Container-Meta-' + ('k' * self.max_meta_name_length): 'v'})
resp.read() resp.read()
self.assertEqual(resp.status, 204) self.assertEqual(resp.status, 204)
# Clear it, so the value-length checking doesn't accidentally trip
# the overall max
resp = retry(
post,
{'X-Container-Meta-' + ('k' * self.max_meta_name_length): ''})
resp.read()
self.assertEqual(resp.status, 204)
resp = retry( resp = retry(
post, post,
{'X-Container-Meta-' + ( {'X-Container-Meta-' + (