diff --git a/pytest_tests/helpers/grpc_responses.py b/pytest_tests/helpers/grpc_responses.py index 08c0a76..1e9fdc3 100644 --- a/pytest_tests/helpers/grpc_responses.py +++ b/pytest_tests/helpers/grpc_responses.py @@ -11,6 +11,7 @@ OBJECT_NOT_FOUND = "code = 2049.*message = object not found" OBJECT_ALREADY_REMOVED = "code = 2052.*message = object already removed" SESSION_NOT_FOUND = "code = 4096.*message = session token not found" OUT_OF_RANGE = "code = 2053.*message = out of range" +EXPIRED_SESSION_TOKEN = "code = 4097.*message = expired session token" # TODO: Due to https://github.com/nspcc-dev/neofs-node/issues/2092 we have to check only codes until fixed # OBJECT_IS_LOCKED = "code = 2050.*message = object is locked" # LOCK_NON_REGULAR_OBJECT = "code = 2051.*message = ..." will be available once 2092 is fixed diff --git a/pytest_tests/testsuites/session_token/test_static_object_session_token.py b/pytest_tests/testsuites/session_token/test_static_object_session_token.py index 9107b06..701ecba 100644 --- a/pytest_tests/testsuites/session_token/test_static_object_session_token.py +++ b/pytest_tests/testsuites/session_token/test_static_object_session_token.py @@ -6,7 +6,12 @@ from cluster import Cluster from cluster_test_base import ClusterTestBase from epoch import ensure_fresh_epoch from file_helper import generate_file -from grpc_responses import MALFORMED_REQUEST, OBJECT_ACCESS_DENIED, OBJECT_NOT_FOUND +from grpc_responses import ( + EXPIRED_SESSION_TOKEN, + MALFORMED_REQUEST, + OBJECT_ACCESS_DENIED, + OBJECT_NOT_FOUND, +) from neofs_testlib.shell import Shell from pytest import FixtureRequest from python_keywords.container import create_container @@ -516,7 +521,7 @@ class TestObjectStaticSession(ClusterTestBase): self.tick_epoch() - with pytest.raises(Exception, match=MALFORMED_REQUEST): + with pytest.raises(Exception, match=EXPIRED_SESSION_TOKEN): head_object( user_wallet.path, container, @@ -581,7 +586,7 @@ class TestObjectStaticSession(ClusterTestBase): ) self.tick_epoch() - with pytest.raises(Exception, match=MALFORMED_REQUEST): + with pytest.raises(Exception, match=EXPIRED_SESSION_TOKEN): head_object( user_wallet.path, container, @@ -625,7 +630,7 @@ class TestObjectStaticSession(ClusterTestBase): expiration, ) - with pytest.raises(Exception, match=MALFORMED_REQUEST): + with pytest.raises(Exception, match=EXPIRED_SESSION_TOKEN): head_object( user_wallet.path, container,