diff --git a/pytest_tests/lib/helpers/grpc_responses.py b/pytest_tests/lib/helpers/grpc_responses.py index df86b431c..3e4597594 100644 --- a/pytest_tests/lib/helpers/grpc_responses.py +++ b/pytest_tests/lib/helpers/grpc_responses.py @@ -19,6 +19,7 @@ # LOCK_NON_REGULAR_OBJECT = "code = 2051.*message = ..." will be available once 2092 is fixed OBJECT_IS_LOCKED = "code = 2050" LOCK_NON_REGULAR_OBJECT = "code = 2051" +OBJECT_HEADER_LENGTH_LIMIT = ".*object header length exceeds the limit.*" LIFETIME_REQUIRED = ".*at least one of the flags in the group [expire-at lifetime] is required.*" LOCK_OBJECT_REMOVAL = "lock object removal" diff --git a/pytest_tests/tests/object/test_object_api.py b/pytest_tests/tests/object/test_object_api.py index 551facdf9..de4f3aee9 100755 --- a/pytest_tests/tests/object/test_object_api.py +++ b/pytest_tests/tests/object/test_object_api.py @@ -19,6 +19,7 @@ INVALID_RANGE_OVERFLOW, INVALID_RANGE_ZERO_LENGTH, INVALID_SEARCH_QUERY, + OBJECT_HEADER_LENGTH_LIMIT, OUT_OF_RANGE, ) from helpers.neofs_verbs import ( @@ -736,6 +737,25 @@ def test_object_get_range_hash_negatives( endpoint=self.neofs_env.sn_rpc, range_cut=range_cut, ) + + def test_put_object_header_limitation( + self, default_wallet: NodeWallet, container: str, simple_object_size: int + ): + file_path = generate_file(simple_object_size) + attr_key = "attr" + attr_val = "val" + attr_len = len(attr_key) + len(attr_val) + 9 + api_limit = 16384 + limit = api_limit // attr_len + with pytest.raises(Exception, match=OBJECT_HEADER_LENGTH_LIMIT): + put_object_to_random_node( + default_wallet.path, + file_path, + container, + shell=self.shell, + neofs_env=self.neofs_env, + attributes={f"{attr_key}{i}": f"{attr_val}{i}" for i in range(limit)} + ) def check_header_is_presented(self, head_info: dict, object_header: dict) -> None: for key_to_check, val_to_check in object_header.items():