From 488f8c839f034172d20b3f28ca851d83b7a3bfff Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Thu, 2 Feb 2023 15:33:54 -0800 Subject: [PATCH] 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 --- test/functional/test_account.py | 8 ++++++++ test/functional/test_container.py | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/test/functional/test_account.py b/test/functional/test_account.py index b4598dd084..6cf30968d5 100644 --- a/test/functional/test_account.py +++ b/test/functional/test_account.py @@ -796,6 +796,14 @@ class TestAccount(unittest.TestCase): 'k' * self.max_meta_name_length): 'v'}) resp.read() 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( post, {'X-Account-Meta-' + ('k' * ( diff --git a/test/functional/test_container.py b/test/functional/test_container.py index 4fdbe27f31..b6a4a2384a 100644 --- a/test/functional/test_container.py +++ b/test/functional/test_container.py @@ -407,6 +407,13 @@ class TestContainer(unittest.TestCase): {'X-Container-Meta-' + ('k' * self.max_meta_name_length): 'v'}) resp.read() 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( post, {'X-Container-Meta-' + (