From 7a742d57fc65a1dae108c5b297ff16bc177e26bd Mon Sep 17 00:00:00 2001 From: Aleksei Chetaev Date: Fri, 17 Feb 2023 16:12:11 +0100 Subject: [PATCH] Move errors templates to testlib Signed-off-by: Aleksei Chetaev --- .gitignore | 2 + pytest_tests/helpers/cluster.py | 1 - pytest_tests/helpers/grpc_responses.py | 37 ------------------- pytest_tests/steps/storage_object.py | 2 +- pytest_tests/testsuites/acl/conftest.py | 2 +- .../acl/storage_group/test_storagegroup.py | 2 +- pytest_tests/testsuites/acl/test_acl.py | 2 +- pytest_tests/testsuites/acl/test_eacl.py | 3 +- .../testsuites/acl/test_eacl_filters.py | 2 +- .../testsuites/container/test_container.py | 3 +- .../failovers/test_failover_network.py | 2 +- .../failovers/test_failover_storage.py | 2 +- .../network/test_node_management.py | 6 +-- .../testsuites/object/test_object_api.py | 4 +- .../object/test_object_api_bearer.py | 2 +- .../testsuites/object/test_object_lifetime.py | 4 +- .../testsuites/object/test_object_lock.py | 4 +- .../services/http_gate/test_http_bearer.py | 2 +- .../services/http_gate/test_http_gate.py | 4 +- .../services/http_gate/test_http_headers.py | 3 +- .../services/http_gate/test_http_object.py | 3 +- .../services/http_gate/test_http_streaming.py | 2 +- .../http_gate/test_http_system_header.py | 15 ++++---- .../test_object_session_token.py | 2 +- .../test_static_object_session_token.py | 4 +- .../test_static_session_token_container.py | 2 +- requirements.txt | 2 +- .../lib/python_keywords/object_access.py | 3 +- .../lib/python_keywords/storage_policy.py | 4 +- robot/variables/wellknown_acl.py | 11 ------ venv/local-pytest/environment.sh | 0 31 files changed, 42 insertions(+), 95 deletions(-) delete mode 100644 pytest_tests/helpers/grpc_responses.py delete mode 100644 robot/variables/wellknown_acl.py mode change 100644 => 100755 venv/local-pytest/environment.sh diff --git a/.gitignore b/.gitignore index a70de07..6efdff2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ .DS_Store +venv_macos + # ignore test results **/log.html diff --git a/pytest_tests/helpers/cluster.py b/pytest_tests/helpers/cluster.py index b8793ed..bb52a65 100644 --- a/pytest_tests/helpers/cluster.py +++ b/pytest_tests/helpers/cluster.py @@ -8,7 +8,6 @@ import yaml from frostfs_testlib.blockchain import RPCClient from frostfs_testlib.hosting import Host, Hosting from frostfs_testlib.hosting.config import ServiceConfig -from test_control import wait_for_success @dataclass diff --git a/pytest_tests/helpers/grpc_responses.py b/pytest_tests/helpers/grpc_responses.py deleted file mode 100644 index 1e9fdc3..0000000 --- a/pytest_tests/helpers/grpc_responses.py +++ /dev/null @@ -1,37 +0,0 @@ -import re - -# Regex patterns of status codes of Container service (https://github.com/nspcc-dev/neofs-spec/blob/98b154848116223e486ce8b43eaa35fec08b4a99/20-api-v2/container.md) -CONTAINER_NOT_FOUND = "code = 3072.*message = container not found" - - -# Regex patterns of status codes of Object service (https://github.com/nspcc-dev/neofs-spec/blob/98b154848116223e486ce8b43eaa35fec08b4a99/20-api-v2/object.md) -MALFORMED_REQUEST = "code = 1024.*message = malformed request" -OBJECT_ACCESS_DENIED = "code = 2048.*message = access to object operation denied" -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 -OBJECT_IS_LOCKED = "code = 2050" -LOCK_NON_REGULAR_OBJECT = "code = 2051" - -LIFETIME_REQUIRED = "either expiration epoch of a lifetime is required" -LOCK_OBJECT_REMOVAL = "lock object removal" -LOCK_OBJECT_EXPIRATION = "lock object expiration: {expiration_epoch}; current: {current_epoch}" -INVALID_RANGE_ZERO_LENGTH = "invalid '{range}' range: zero length" -INVALID_RANGE_OVERFLOW = "invalid '{range}' range: uint64 overflow" -INVALID_OFFSET_SPECIFIER = "invalid '{range}' range offset specifier" -INVALID_LENGTH_SPECIFIER = "invalid '{range}' range length specifier" - - -def error_matches_status(error: Exception, status_pattern: str) -> bool: - """ - Determines whether exception matches specified status pattern. - - We use re.search to be consistent with pytest.raises. - """ - match = re.search(status_pattern, str(error)) - return match is not None diff --git a/pytest_tests/steps/storage_object.py b/pytest_tests/steps/storage_object.py index 70f004f..40d53ac 100644 --- a/pytest_tests/steps/storage_object.py +++ b/pytest_tests/steps/storage_object.py @@ -5,8 +5,8 @@ import allure import pytest from cluster import Cluster from epoch import tick_epoch +from frostfs_testlib.resources.common import OBJECT_ALREADY_REMOVED from frostfs_testlib.shell import Shell -from grpc_responses import OBJECT_ALREADY_REMOVED from python_keywords.frostfs_verbs import delete_object, get_object from storage_object_info import StorageObjectInfo from tombstone import verify_head_tombstone diff --git a/pytest_tests/testsuites/acl/conftest.py b/pytest_tests/testsuites/acl/conftest.py index 466d33d..73b9438 100644 --- a/pytest_tests/testsuites/acl/conftest.py +++ b/pytest_tests/testsuites/acl/conftest.py @@ -8,12 +8,12 @@ import pytest from cluster import Cluster from common import WALLET_CONFIG, WALLET_PASS from file_helper import generate_file +from frostfs_testlib.resources.common import PUBLIC_ACL from frostfs_testlib.shell import Shell from frostfs_testlib.utils.wallet import init_wallet from python_keywords.acl import EACLRole from python_keywords.container import create_container from python_keywords.frostfs_verbs import put_object_to_random_node -from wellknown_acl import PUBLIC_ACL OBJECT_COUNT = 5 diff --git a/pytest_tests/testsuites/acl/storage_group/test_storagegroup.py b/pytest_tests/testsuites/acl/storage_group/test_storagegroup.py index 4aca204..30f61fc 100644 --- a/pytest_tests/testsuites/acl/storage_group/test_storagegroup.py +++ b/pytest_tests/testsuites/acl/storage_group/test_storagegroup.py @@ -8,8 +8,8 @@ import pytest from cluster_test_base import ClusterTestBase from common import ASSETS_DIR, FREE_STORAGE, WALLET_PASS from file_helper import generate_file +from frostfs_testlib.resources.common import OBJECT_ACCESS_DENIED, OBJECT_NOT_FOUND from frostfs_testlib.utils.wallet import init_wallet -from grpc_responses import OBJECT_ACCESS_DENIED, OBJECT_NOT_FOUND from python_keywords.acl import ( EACLAccess, EACLOperation, diff --git a/pytest_tests/testsuites/acl/test_acl.py b/pytest_tests/testsuites/acl/test_acl.py index 9225708..4a0cc24 100644 --- a/pytest_tests/testsuites/acl/test_acl.py +++ b/pytest_tests/testsuites/acl/test_acl.py @@ -1,6 +1,7 @@ import allure import pytest from cluster_test_base import ClusterTestBase +from frostfs_testlib.resources.common import PRIVATE_ACL_F, PUBLIC_ACL_F, READONLY_ACL_F from python_keywords.acl import EACLRole from python_keywords.container import create_container from python_keywords.container_access import ( @@ -9,7 +10,6 @@ from python_keywords.container_access import ( check_read_only_container, ) from python_keywords.frostfs_verbs import put_object_to_random_node -from wellknown_acl import PRIVATE_ACL_F, PUBLIC_ACL_F, READONLY_ACL_F @pytest.mark.sanity diff --git a/pytest_tests/testsuites/acl/test_eacl.py b/pytest_tests/testsuites/acl/test_eacl.py index 5b77974..d80cc06 100644 --- a/pytest_tests/testsuites/acl/test_eacl.py +++ b/pytest_tests/testsuites/acl/test_eacl.py @@ -2,7 +2,7 @@ import allure import pytest from cluster_test_base import ClusterTestBase from failover_utils import wait_object_replication -from frostfs_testlib.shell import Shell +from frostfs_testlib.resources.common import PUBLIC_ACL from python_keywords.acl import ( EACLAccess, EACLOperation, @@ -28,7 +28,6 @@ from python_keywords.object_access import ( can_put_object, can_search_object, ) -from wellknown_acl import PUBLIC_ACL @pytest.mark.sanity diff --git a/pytest_tests/testsuites/acl/test_eacl_filters.py b/pytest_tests/testsuites/acl/test_eacl_filters.py index 3290e0b..1bfe6c0 100644 --- a/pytest_tests/testsuites/acl/test_eacl_filters.py +++ b/pytest_tests/testsuites/acl/test_eacl_filters.py @@ -1,6 +1,7 @@ import allure import pytest from cluster_test_base import ClusterTestBase +from frostfs_testlib.resources.common import PUBLIC_ACL from python_keywords.acl import ( EACLAccess, EACLFilter, @@ -22,7 +23,6 @@ from python_keywords.container_access import ( ) from python_keywords.frostfs_verbs import put_object_to_random_node from python_keywords.object_access import can_get_head_object, can_get_object, can_put_object -from wellknown_acl import PUBLIC_ACL @pytest.mark.sanity diff --git a/pytest_tests/testsuites/container/test_container.py b/pytest_tests/testsuites/container/test_container.py index 035754b..75079b3 100644 --- a/pytest_tests/testsuites/container/test_container.py +++ b/pytest_tests/testsuites/container/test_container.py @@ -2,7 +2,7 @@ import json import allure import pytest -from epoch import tick_epoch +from frostfs_testlib.resources.common import PRIVATE_ACL_F from python_keywords.container import ( create_container, delete_container, @@ -12,7 +12,6 @@ from python_keywords.container import ( wait_for_container_deletion, ) from utility import placement_policy_from_container -from wellknown_acl import PRIVATE_ACL_F from steps.cluster_test_base import ClusterTestBase diff --git a/pytest_tests/testsuites/failovers/test_failover_network.py b/pytest_tests/testsuites/failovers/test_failover_network.py index a272880..a0157e0 100644 --- a/pytest_tests/testsuites/failovers/test_failover_network.py +++ b/pytest_tests/testsuites/failovers/test_failover_network.py @@ -7,10 +7,10 @@ import pytest from cluster import StorageNode from failover_utils import wait_all_storage_nodes_returned, wait_object_replication from file_helper import generate_file, get_file_hash +from frostfs_testlib.resources.common import PUBLIC_ACL from iptables_helper import IpTablesHelper from python_keywords.container import create_container from python_keywords.frostfs_verbs import get_object, put_object_to_random_node -from wellknown_acl import PUBLIC_ACL from steps.cluster_test_base import ClusterTestBase diff --git a/pytest_tests/testsuites/failovers/test_failover_storage.py b/pytest_tests/testsuites/failovers/test_failover_storage.py index 29e639d..9bb1356 100644 --- a/pytest_tests/testsuites/failovers/test_failover_storage.py +++ b/pytest_tests/testsuites/failovers/test_failover_storage.py @@ -6,10 +6,10 @@ from cluster import Cluster, StorageNode from failover_utils import wait_all_storage_nodes_returned, wait_object_replication from file_helper import generate_file, get_file_hash from frostfs_testlib.hosting import Host +from frostfs_testlib.resources.common import PUBLIC_ACL from frostfs_testlib.shell import CommandOptions from python_keywords.container import create_container from python_keywords.frostfs_verbs import get_object, put_object_to_random_node -from wellknown_acl import PUBLIC_ACL from steps.cluster_test_base import ClusterTestBase diff --git a/pytest_tests/testsuites/network/test_node_management.py b/pytest_tests/testsuites/network/test_node_management.py index f365afc..6691726 100644 --- a/pytest_tests/testsuites/network/test_node_management.py +++ b/pytest_tests/testsuites/network/test_node_management.py @@ -10,7 +10,8 @@ from cluster_test_base import ClusterTestBase from common import FROSTFS_CONTRACT_CACHE_TIMEOUT, MORPH_BLOCK_TIME from epoch import tick_epoch from file_helper import generate_file -from grpc_responses import OBJECT_NOT_FOUND, error_matches_status +from frostfs_testlib.resources.common import OBJECT_NOT_FOUND, PUBLIC_ACL +from frostfs_testlib.utils.errors import error_matches_status from python_keywords.container import create_container, get_container from python_keywords.failover_utils import wait_object_replication from python_keywords.frostfs_verbs import ( @@ -27,17 +28,14 @@ from python_keywords.node_management import ( drop_object, exclude_node_from_network_map, get_locode_from_random_node, - get_netmap_snapshot, include_node_to_network_map, node_shard_list, node_shard_set_mode, - start_storage_nodes, storage_node_healthcheck, storage_node_set_status, ) from storage_policy import get_nodes_with_object, get_simple_object_copies from utility import parse_time, placement_policy_from_container, wait_for_gc_pass_on_storage_nodes -from wellknown_acl import PUBLIC_ACL logger = logging.getLogger("NeoLogger") check_nodes: list[StorageNode] = [] diff --git a/pytest_tests/testsuites/object/test_object_api.py b/pytest_tests/testsuites/object/test_object_api.py index e45a3d6..7dde156 100755 --- a/pytest_tests/testsuites/object/test_object_api.py +++ b/pytest_tests/testsuites/object/test_object_api.py @@ -7,14 +7,14 @@ import pytest from cluster import Cluster from complex_object_actions import get_complex_object_split_ranges from file_helper import generate_file, get_file_content, get_file_hash -from frostfs_testlib.shell import Shell -from grpc_responses import ( +from frostfs_testlib.resources.common import ( INVALID_LENGTH_SPECIFIER, INVALID_OFFSET_SPECIFIER, INVALID_RANGE_OVERFLOW, INVALID_RANGE_ZERO_LENGTH, OUT_OF_RANGE, ) +from frostfs_testlib.shell import Shell from pytest import FixtureRequest from python_keywords.container import create_container from python_keywords.frostfs_verbs import ( diff --git a/pytest_tests/testsuites/object/test_object_api_bearer.py b/pytest_tests/testsuites/object/test_object_api_bearer.py index 8344715..883fcf0 100644 --- a/pytest_tests/testsuites/object/test_object_api_bearer.py +++ b/pytest_tests/testsuites/object/test_object_api_bearer.py @@ -3,11 +3,11 @@ import pytest from cluster import Cluster from container import REP_2_FOR_3_NODES_PLACEMENT_RULE, SINGLE_PLACEMENT_RULE, create_container from epoch import get_epoch +from frostfs_testlib.resources.common import EACL_PUBLIC_READ_WRITE from frostfs_testlib.shell import Shell from frostfs_verbs import delete_object, get_object from pytest import FixtureRequest from python_keywords.acl import EACLAccess, EACLOperation, EACLRole, EACLRule, form_bearertoken_file -from wellknown_acl import EACL_PUBLIC_READ_WRITE from helpers.container import StorageContainer, StorageContainerInfo from helpers.test_control import expect_not_raises diff --git a/pytest_tests/testsuites/object/test_object_lifetime.py b/pytest_tests/testsuites/object/test_object_lifetime.py index 864abe3..2bf1526 100644 --- a/pytest_tests/testsuites/object/test_object_lifetime.py +++ b/pytest_tests/testsuites/object/test_object_lifetime.py @@ -2,9 +2,9 @@ import logging import allure import pytest -from epoch import get_epoch, tick_epoch +from epoch import get_epoch from file_helper import generate_file, get_file_hash -from grpc_responses import OBJECT_NOT_FOUND +from frostfs_testlib.resources.common import OBJECT_NOT_FOUND from pytest import FixtureRequest from python_keywords.container import create_container from python_keywords.frostfs_verbs import get_object_from_random_node, put_object_to_random_node diff --git a/pytest_tests/testsuites/object/test_object_lock.py b/pytest_tests/testsuites/object/test_object_lock.py index f9ec6fd..89a933a 100755 --- a/pytest_tests/testsuites/object/test_object_lock.py +++ b/pytest_tests/testsuites/object/test_object_lock.py @@ -8,8 +8,7 @@ from cluster_test_base import ClusterTestBase from common import STORAGE_GC_TIME from complex_object_actions import get_link_object, get_storage_object_chunks from epoch import ensure_fresh_epoch, get_epoch, tick_epoch -from frostfs_testlib.shell import Shell -from grpc_responses import ( +from frostfs_testlib.resources.common import ( LIFETIME_REQUIRED, LOCK_NON_REGULAR_OBJECT, LOCK_OBJECT_EXPIRATION, @@ -18,6 +17,7 @@ from grpc_responses import ( OBJECT_IS_LOCKED, OBJECT_NOT_FOUND, ) +from frostfs_testlib.shell import Shell from node_management import drop_object from pytest import FixtureRequest from python_keywords.container import create_container diff --git a/pytest_tests/testsuites/services/http_gate/test_http_bearer.py b/pytest_tests/testsuites/services/http_gate/test_http_bearer.py index e1e5d7d..493d78f 100644 --- a/pytest_tests/testsuites/services/http_gate/test_http_bearer.py +++ b/pytest_tests/testsuites/services/http_gate/test_http_bearer.py @@ -4,6 +4,7 @@ import allure import pytest from container import create_container from file_helper import generate_file +from frostfs_testlib.resources.common import PUBLIC_ACL from http_gate import get_object_and_verify_hashes, upload_via_http_gate_curl from python_keywords.acl import ( EACLAccess, @@ -17,7 +18,6 @@ from python_keywords.acl import ( sign_bearer, wait_for_cache_expired, ) -from wellknown_acl import PUBLIC_ACL from steps.cluster_test_base import ClusterTestBase diff --git a/pytest_tests/testsuites/services/http_gate/test_http_gate.py b/pytest_tests/testsuites/services/http_gate/test_http_gate.py index eabee62..e88bbda 100644 --- a/pytest_tests/testsuites/services/http_gate/test_http_gate.py +++ b/pytest_tests/testsuites/services/http_gate/test_http_gate.py @@ -3,8 +3,9 @@ import os import allure import pytest -from epoch import get_epoch, tick_epoch +from epoch import get_epoch from file_helper import generate_file, get_file_hash +from frostfs_testlib.resources.common import PUBLIC_ACL from python_keywords.container import create_container from python_keywords.frostfs_verbs import put_object_to_random_node from python_keywords.http_gate import ( @@ -19,7 +20,6 @@ from python_keywords.http_gate import ( upload_via_http_gate_curl, ) from utility import wait_for_gc_pass_on_storage_nodes -from wellknown_acl import PUBLIC_ACL from steps.cluster_test_base import ClusterTestBase diff --git a/pytest_tests/testsuites/services/http_gate/test_http_headers.py b/pytest_tests/testsuites/services/http_gate/test_http_headers.py index 5679125..b2b8fb0 100644 --- a/pytest_tests/testsuites/services/http_gate/test_http_headers.py +++ b/pytest_tests/testsuites/services/http_gate/test_http_headers.py @@ -9,8 +9,8 @@ from container import ( list_containers, wait_for_container_deletion, ) -from epoch import tick_epoch from file_helper import generate_file +from frostfs_testlib.resources.common import PUBLIC_ACL from http_gate import ( attr_into_str_header_curl, get_object_by_attr_and_verify_hashes, @@ -20,7 +20,6 @@ from http_gate import ( ) from pytest import FixtureRequest from python_keywords.frostfs_verbs import delete_object -from wellknown_acl import PUBLIC_ACL from helpers.storage_object_info import StorageObjectInfo from steps.cluster_test_base import ClusterTestBase diff --git a/pytest_tests/testsuites/services/http_gate/test_http_object.py b/pytest_tests/testsuites/services/http_gate/test_http_object.py index c92ef3b..cc7459b 100644 --- a/pytest_tests/testsuites/services/http_gate/test_http_object.py +++ b/pytest_tests/testsuites/services/http_gate/test_http_object.py @@ -1,17 +1,16 @@ import logging -import os import allure import pytest from container import create_container from file_helper import generate_file +from frostfs_testlib.resources.common import PUBLIC_ACL from http_gate import ( get_object_and_verify_hashes, get_object_by_attr_and_verify_hashes, try_to_get_object_via_passed_request_and_expect_error, ) from python_keywords.frostfs_verbs import put_object_to_random_node -from wellknown_acl import PUBLIC_ACL from steps.cluster_test_base import ClusterTestBase diff --git a/pytest_tests/testsuites/services/http_gate/test_http_streaming.py b/pytest_tests/testsuites/services/http_gate/test_http_streaming.py index 25310e1..f30bb2c 100644 --- a/pytest_tests/testsuites/services/http_gate/test_http_streaming.py +++ b/pytest_tests/testsuites/services/http_gate/test_http_streaming.py @@ -4,8 +4,8 @@ import allure import pytest from container import create_container from file_helper import generate_file +from frostfs_testlib.resources.common import PUBLIC_ACL from http_gate import get_object_and_verify_hashes, upload_via_http_gate_curl -from wellknown_acl import PUBLIC_ACL from steps.cluster_test_base import ClusterTestBase diff --git a/pytest_tests/testsuites/services/http_gate/test_http_system_header.py b/pytest_tests/testsuites/services/http_gate/test_http_system_header.py index ba1e9cc..e6d2db1 100644 --- a/pytest_tests/testsuites/services/http_gate/test_http_system_header.py +++ b/pytest_tests/testsuites/services/http_gate/test_http_system_header.py @@ -8,7 +8,7 @@ import pytest from container import create_container from epoch import get_epoch, wait_for_epochs_align from file_helper import generate_file -from grpc_responses import OBJECT_NOT_FOUND +from frostfs_testlib.resources.common import OBJECT_NOT_FOUND, PUBLIC_ACL from http_gate import ( attr_into_str_header_curl, get_object_and_verify_hashes, @@ -20,7 +20,6 @@ from python_keywords.frostfs_verbs import ( get_object_from_random_node, head_object, ) -from wellknown_acl import PUBLIC_ACL from steps.cluster_test_base import ClusterTestBase @@ -29,10 +28,10 @@ EXPIRATION_TIMESTAMP_HEADER = "__FROSRFS__EXPIRATION_TIMESTAMP" EXPIRATION_EPOCH_HEADER = "__FROSRFS__EXPIRATION_EPOCH" EXPIRATION_DURATION_HEADER = "__FROSRFS__EXPIRATION_DURATION" EXPIRATION_EXPIRATION_RFC = "__FROSRFS__EXPIRATION_RFC3339" -FROSRFS_EXPIRATION_EPOCH = "Frostfs-Expiration-Epoch" -FROSRFS_EXPIRATION_DURATION = "Frostfs-Expiration-Duration" -FROSRFS_EXPIRATION_TIMESTAMP = "Frostfs-Expiration-Timestamp" -FROSRFS_EXIPRATION_RFC3339 = "Frostfs-Expiration-RFC3339" +FROSTFS_EXPIRATION_EPOCH = "Frostfs-Expiration-Epoch" +FROSTFS_EXPIRATION_DURATION = "Frostfs-Expiration-Duration" +FROSTFS_EXPIRATION_TIMESTAMP = "Frostfs-Expiration-Timestamp" +FROSTFS_EXPIRATION_RFC3339 = "Frostfs-Expiration-RFC3339" @pytest.mark.sanity @@ -324,7 +323,7 @@ class Test_http_system_header(ClusterTestBase): FROSTFS_EXPIRATION_TIMESTAMP: self.epoch_count_into_timestamp( epoch_duration=epoch_duration, epoch=2 ), - FROSTFS_EXIPRATION_RFC3339: self.epoch_count_into_timestamp( + FROSTFS_EXPIRATION_RFC3339: self.epoch_count_into_timestamp( epoch_duration=epoch_duration, epoch=1, rfc3339=True ), } @@ -373,7 +372,7 @@ class Test_http_system_header(ClusterTestBase): f"epoch duration={epoch_duration}, current_epoch= {get_epoch(self.shell, self.cluster)} expected_epoch {expected_epoch}" ) attributes = { - FROSTFS_EXIPRATION_RFC3339: self.epoch_count_into_timestamp( + FROSTFS_EXPIRATION_RFC3339: self.epoch_count_into_timestamp( epoch_duration=epoch_duration, epoch=2, rfc3339=True ) } diff --git a/pytest_tests/testsuites/session_token/test_object_session_token.py b/pytest_tests/testsuites/session_token/test_object_session_token.py index 8c517bc..f181f9e 100644 --- a/pytest_tests/testsuites/session_token/test_object_session_token.py +++ b/pytest_tests/testsuites/session_token/test_object_session_token.py @@ -5,8 +5,8 @@ import pytest from cluster_test_base import ClusterTestBase from common import WALLET_PASS from file_helper import generate_file +from frostfs_testlib.resources.common import SESSION_NOT_FOUND from frostfs_testlib.utils.wallet import get_last_address_from_wallet -from grpc_responses import SESSION_NOT_FOUND from python_keywords.container import create_container from python_keywords.frostfs_verbs import delete_object, put_object, put_object_to_random_node 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 9d381bf..f9cdf83 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,13 +6,13 @@ from cluster import Cluster from cluster_test_base import ClusterTestBase from epoch import ensure_fresh_epoch from file_helper import generate_file -from frostfs_testlib.shell import Shell -from grpc_responses import ( +from frostfs_testlib.resources.common import ( EXPIRED_SESSION_TOKEN, MALFORMED_REQUEST, OBJECT_ACCESS_DENIED, OBJECT_NOT_FOUND, ) +from frostfs_testlib.shell import Shell from pytest import FixtureRequest from python_keywords.container import create_container from python_keywords.frostfs_verbs import ( diff --git a/pytest_tests/testsuites/session_token/test_static_session_token_container.py b/pytest_tests/testsuites/session_token/test_static_session_token_container.py index 529b138..591f467 100644 --- a/pytest_tests/testsuites/session_token/test_static_session_token_container.py +++ b/pytest_tests/testsuites/session_token/test_static_session_token_container.py @@ -1,6 +1,7 @@ import allure import pytest from file_helper import generate_file +from frostfs_testlib.resources.common import PUBLIC_ACL from frostfs_testlib.shell import Shell from python_keywords.acl import ( EACLAccess, @@ -19,7 +20,6 @@ from python_keywords.container import ( ) from python_keywords.object_access import can_put_object from wallet import WalletFile -from wellknown_acl import PUBLIC_ACL from steps.cluster_test_base import ClusterTestBase from steps.session_token import ContainerVerb, get_container_signed_token diff --git a/requirements.txt b/requirements.txt index 9a51135..68e0f77 100644 --- a/requirements.txt +++ b/requirements.txt @@ -30,7 +30,7 @@ mmh3==3.0.0 multidict==6.0.2 mypy==0.950 mypy-extensions==0.4.3 -frostfs-testlib==1.2.0 +frostfs-testlib==1.3.0 netaddr==0.8.0 packaging==21.3 paramiko==2.10.3 diff --git a/robot/resources/lib/python_keywords/object_access.py b/robot/resources/lib/python_keywords/object_access.py index a358ecb..dcbd555 100644 --- a/robot/resources/lib/python_keywords/object_access.py +++ b/robot/resources/lib/python_keywords/object_access.py @@ -3,8 +3,9 @@ from typing import Optional import allure from cluster import Cluster from file_helper import get_file_hash +from frostfs_testlib.resources.common import OBJECT_ACCESS_DENIED from frostfs_testlib.shell import Shell -from grpc_responses import OBJECT_ACCESS_DENIED, error_matches_status +from frostfs_testlib.utils.errors import error_matches_status from python_keywords.frostfs_verbs import ( delete_object, get_object_from_random_node, diff --git a/robot/resources/lib/python_keywords/storage_policy.py b/robot/resources/lib/python_keywords/storage_policy.py index ff75e39..267bdd8 100644 --- a/robot/resources/lib/python_keywords/storage_policy.py +++ b/robot/resources/lib/python_keywords/storage_policy.py @@ -6,14 +6,14 @@ """ import logging -from typing import List import allure import complex_object_actions import frostfs_verbs from cluster import StorageNode +from frostfs_testlib.resources.common import OBJECT_NOT_FOUND from frostfs_testlib.shell import Shell -from grpc_responses import OBJECT_NOT_FOUND, error_matches_status +from frostfs_testlib.utils.errors import error_matches_status logger = logging.getLogger("NeoLogger") diff --git a/robot/variables/wellknown_acl.py b/robot/variables/wellknown_acl.py deleted file mode 100644 index 3e610a9..0000000 --- a/robot/variables/wellknown_acl.py +++ /dev/null @@ -1,11 +0,0 @@ -# ACLs with final flag -PUBLIC_ACL_F = "1FBFBFFF" -PRIVATE_ACL_F = "1C8C8CCC" -READONLY_ACL_F = "1FBF8CFF" - -# ACLs without final flag set -PUBLIC_ACL = "0FBFBFFF" -INACCESSIBLE_ACL = "40000000" -STICKYBIT_PUB_ACL = "3FFFFFFF" - -EACL_PUBLIC_READ_WRITE = "eacl-public-read-write" diff --git a/venv/local-pytest/environment.sh b/venv/local-pytest/environment.sh old mode 100644 new mode 100755