Move errors templates to testlib
Signed-off-by: Aleksei Chetaev <alex.chetaev@gmail.com>
This commit is contained in:
parent
19809c5641
commit
7a742d57fc
31 changed files with 42 additions and 95 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
venv_macos
|
||||||
|
|
||||||
|
|
||||||
# ignore test results
|
# ignore test results
|
||||||
**/log.html
|
**/log.html
|
||||||
|
|
|
@ -8,7 +8,6 @@ import yaml
|
||||||
from frostfs_testlib.blockchain import RPCClient
|
from frostfs_testlib.blockchain import RPCClient
|
||||||
from frostfs_testlib.hosting import Host, Hosting
|
from frostfs_testlib.hosting import Host, Hosting
|
||||||
from frostfs_testlib.hosting.config import ServiceConfig
|
from frostfs_testlib.hosting.config import ServiceConfig
|
||||||
from test_control import wait_for_success
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
|
@ -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
|
|
|
@ -5,8 +5,8 @@ import allure
|
||||||
import pytest
|
import pytest
|
||||||
from cluster import Cluster
|
from cluster import Cluster
|
||||||
from epoch import tick_epoch
|
from epoch import tick_epoch
|
||||||
|
from frostfs_testlib.resources.common import OBJECT_ALREADY_REMOVED
|
||||||
from frostfs_testlib.shell import Shell
|
from frostfs_testlib.shell import Shell
|
||||||
from grpc_responses import OBJECT_ALREADY_REMOVED
|
|
||||||
from python_keywords.frostfs_verbs import delete_object, get_object
|
from python_keywords.frostfs_verbs import delete_object, get_object
|
||||||
from storage_object_info import StorageObjectInfo
|
from storage_object_info import StorageObjectInfo
|
||||||
from tombstone import verify_head_tombstone
|
from tombstone import verify_head_tombstone
|
||||||
|
|
|
@ -8,12 +8,12 @@ import pytest
|
||||||
from cluster import Cluster
|
from cluster import Cluster
|
||||||
from common import WALLET_CONFIG, WALLET_PASS
|
from common import WALLET_CONFIG, WALLET_PASS
|
||||||
from file_helper import generate_file
|
from file_helper import generate_file
|
||||||
|
from frostfs_testlib.resources.common import PUBLIC_ACL
|
||||||
from frostfs_testlib.shell import Shell
|
from frostfs_testlib.shell import Shell
|
||||||
from frostfs_testlib.utils.wallet import init_wallet
|
from frostfs_testlib.utils.wallet import init_wallet
|
||||||
from python_keywords.acl import EACLRole
|
from python_keywords.acl import EACLRole
|
||||||
from python_keywords.container import create_container
|
from python_keywords.container import create_container
|
||||||
from python_keywords.frostfs_verbs import put_object_to_random_node
|
from python_keywords.frostfs_verbs import put_object_to_random_node
|
||||||
from wellknown_acl import PUBLIC_ACL
|
|
||||||
|
|
||||||
OBJECT_COUNT = 5
|
OBJECT_COUNT = 5
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ import pytest
|
||||||
from cluster_test_base import ClusterTestBase
|
from cluster_test_base import ClusterTestBase
|
||||||
from common import ASSETS_DIR, FREE_STORAGE, WALLET_PASS
|
from common import ASSETS_DIR, FREE_STORAGE, WALLET_PASS
|
||||||
from file_helper import generate_file
|
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 frostfs_testlib.utils.wallet import init_wallet
|
||||||
from grpc_responses import OBJECT_ACCESS_DENIED, OBJECT_NOT_FOUND
|
|
||||||
from python_keywords.acl import (
|
from python_keywords.acl import (
|
||||||
EACLAccess,
|
EACLAccess,
|
||||||
EACLOperation,
|
EACLOperation,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import allure
|
import allure
|
||||||
import pytest
|
import pytest
|
||||||
from cluster_test_base import ClusterTestBase
|
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.acl import EACLRole
|
||||||
from python_keywords.container import create_container
|
from python_keywords.container import create_container
|
||||||
from python_keywords.container_access import (
|
from python_keywords.container_access import (
|
||||||
|
@ -9,7 +10,6 @@ from python_keywords.container_access import (
|
||||||
check_read_only_container,
|
check_read_only_container,
|
||||||
)
|
)
|
||||||
from python_keywords.frostfs_verbs import put_object_to_random_node
|
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
|
@pytest.mark.sanity
|
||||||
|
|
|
@ -2,7 +2,7 @@ import allure
|
||||||
import pytest
|
import pytest
|
||||||
from cluster_test_base import ClusterTestBase
|
from cluster_test_base import ClusterTestBase
|
||||||
from failover_utils import wait_object_replication
|
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 (
|
from python_keywords.acl import (
|
||||||
EACLAccess,
|
EACLAccess,
|
||||||
EACLOperation,
|
EACLOperation,
|
||||||
|
@ -28,7 +28,6 @@ from python_keywords.object_access import (
|
||||||
can_put_object,
|
can_put_object,
|
||||||
can_search_object,
|
can_search_object,
|
||||||
)
|
)
|
||||||
from wellknown_acl import PUBLIC_ACL
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sanity
|
@pytest.mark.sanity
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import allure
|
import allure
|
||||||
import pytest
|
import pytest
|
||||||
from cluster_test_base import ClusterTestBase
|
from cluster_test_base import ClusterTestBase
|
||||||
|
from frostfs_testlib.resources.common import PUBLIC_ACL
|
||||||
from python_keywords.acl import (
|
from python_keywords.acl import (
|
||||||
EACLAccess,
|
EACLAccess,
|
||||||
EACLFilter,
|
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.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 python_keywords.object_access import can_get_head_object, can_get_object, can_put_object
|
||||||
from wellknown_acl import PUBLIC_ACL
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sanity
|
@pytest.mark.sanity
|
||||||
|
|
|
@ -2,7 +2,7 @@ import json
|
||||||
|
|
||||||
import allure
|
import allure
|
||||||
import pytest
|
import pytest
|
||||||
from epoch import tick_epoch
|
from frostfs_testlib.resources.common import PRIVATE_ACL_F
|
||||||
from python_keywords.container import (
|
from python_keywords.container import (
|
||||||
create_container,
|
create_container,
|
||||||
delete_container,
|
delete_container,
|
||||||
|
@ -12,7 +12,6 @@ from python_keywords.container import (
|
||||||
wait_for_container_deletion,
|
wait_for_container_deletion,
|
||||||
)
|
)
|
||||||
from utility import placement_policy_from_container
|
from utility import placement_policy_from_container
|
||||||
from wellknown_acl import PRIVATE_ACL_F
|
|
||||||
|
|
||||||
from steps.cluster_test_base import ClusterTestBase
|
from steps.cluster_test_base import ClusterTestBase
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,10 @@ import pytest
|
||||||
from cluster import StorageNode
|
from cluster import StorageNode
|
||||||
from failover_utils import wait_all_storage_nodes_returned, wait_object_replication
|
from failover_utils import wait_all_storage_nodes_returned, wait_object_replication
|
||||||
from file_helper import generate_file, get_file_hash
|
from file_helper import generate_file, get_file_hash
|
||||||
|
from frostfs_testlib.resources.common import PUBLIC_ACL
|
||||||
from iptables_helper import IpTablesHelper
|
from iptables_helper import IpTablesHelper
|
||||||
from python_keywords.container import create_container
|
from python_keywords.container import create_container
|
||||||
from python_keywords.frostfs_verbs import get_object, put_object_to_random_node
|
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
|
from steps.cluster_test_base import ClusterTestBase
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,10 @@ from cluster import Cluster, StorageNode
|
||||||
from failover_utils import wait_all_storage_nodes_returned, wait_object_replication
|
from failover_utils import wait_all_storage_nodes_returned, wait_object_replication
|
||||||
from file_helper import generate_file, get_file_hash
|
from file_helper import generate_file, get_file_hash
|
||||||
from frostfs_testlib.hosting import Host
|
from frostfs_testlib.hosting import Host
|
||||||
|
from frostfs_testlib.resources.common import PUBLIC_ACL
|
||||||
from frostfs_testlib.shell import CommandOptions
|
from frostfs_testlib.shell import CommandOptions
|
||||||
from python_keywords.container import create_container
|
from python_keywords.container import create_container
|
||||||
from python_keywords.frostfs_verbs import get_object, put_object_to_random_node
|
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
|
from steps.cluster_test_base import ClusterTestBase
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,8 @@ from cluster_test_base import ClusterTestBase
|
||||||
from common import FROSTFS_CONTRACT_CACHE_TIMEOUT, MORPH_BLOCK_TIME
|
from common import FROSTFS_CONTRACT_CACHE_TIMEOUT, MORPH_BLOCK_TIME
|
||||||
from epoch import tick_epoch
|
from epoch import tick_epoch
|
||||||
from file_helper import generate_file
|
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.container import create_container, get_container
|
||||||
from python_keywords.failover_utils import wait_object_replication
|
from python_keywords.failover_utils import wait_object_replication
|
||||||
from python_keywords.frostfs_verbs import (
|
from python_keywords.frostfs_verbs import (
|
||||||
|
@ -27,17 +28,14 @@ from python_keywords.node_management import (
|
||||||
drop_object,
|
drop_object,
|
||||||
exclude_node_from_network_map,
|
exclude_node_from_network_map,
|
||||||
get_locode_from_random_node,
|
get_locode_from_random_node,
|
||||||
get_netmap_snapshot,
|
|
||||||
include_node_to_network_map,
|
include_node_to_network_map,
|
||||||
node_shard_list,
|
node_shard_list,
|
||||||
node_shard_set_mode,
|
node_shard_set_mode,
|
||||||
start_storage_nodes,
|
|
||||||
storage_node_healthcheck,
|
storage_node_healthcheck,
|
||||||
storage_node_set_status,
|
storage_node_set_status,
|
||||||
)
|
)
|
||||||
from storage_policy import get_nodes_with_object, get_simple_object_copies
|
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 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")
|
logger = logging.getLogger("NeoLogger")
|
||||||
check_nodes: list[StorageNode] = []
|
check_nodes: list[StorageNode] = []
|
||||||
|
|
|
@ -7,14 +7,14 @@ import pytest
|
||||||
from cluster import Cluster
|
from cluster import Cluster
|
||||||
from complex_object_actions import get_complex_object_split_ranges
|
from complex_object_actions import get_complex_object_split_ranges
|
||||||
from file_helper import generate_file, get_file_content, get_file_hash
|
from file_helper import generate_file, get_file_content, get_file_hash
|
||||||
from frostfs_testlib.shell import Shell
|
from frostfs_testlib.resources.common import (
|
||||||
from grpc_responses import (
|
|
||||||
INVALID_LENGTH_SPECIFIER,
|
INVALID_LENGTH_SPECIFIER,
|
||||||
INVALID_OFFSET_SPECIFIER,
|
INVALID_OFFSET_SPECIFIER,
|
||||||
INVALID_RANGE_OVERFLOW,
|
INVALID_RANGE_OVERFLOW,
|
||||||
INVALID_RANGE_ZERO_LENGTH,
|
INVALID_RANGE_ZERO_LENGTH,
|
||||||
OUT_OF_RANGE,
|
OUT_OF_RANGE,
|
||||||
)
|
)
|
||||||
|
from frostfs_testlib.shell import Shell
|
||||||
from pytest import FixtureRequest
|
from pytest import FixtureRequest
|
||||||
from python_keywords.container import create_container
|
from python_keywords.container import create_container
|
||||||
from python_keywords.frostfs_verbs import (
|
from python_keywords.frostfs_verbs import (
|
||||||
|
|
|
@ -3,11 +3,11 @@ import pytest
|
||||||
from cluster import Cluster
|
from cluster import Cluster
|
||||||
from container import REP_2_FOR_3_NODES_PLACEMENT_RULE, SINGLE_PLACEMENT_RULE, create_container
|
from container import REP_2_FOR_3_NODES_PLACEMENT_RULE, SINGLE_PLACEMENT_RULE, create_container
|
||||||
from epoch import get_epoch
|
from epoch import get_epoch
|
||||||
|
from frostfs_testlib.resources.common import EACL_PUBLIC_READ_WRITE
|
||||||
from frostfs_testlib.shell import Shell
|
from frostfs_testlib.shell import Shell
|
||||||
from frostfs_verbs import delete_object, get_object
|
from frostfs_verbs import delete_object, get_object
|
||||||
from pytest import FixtureRequest
|
from pytest import FixtureRequest
|
||||||
from python_keywords.acl import EACLAccess, EACLOperation, EACLRole, EACLRule, form_bearertoken_file
|
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.container import StorageContainer, StorageContainerInfo
|
||||||
from helpers.test_control import expect_not_raises
|
from helpers.test_control import expect_not_raises
|
||||||
|
|
|
@ -2,9 +2,9 @@ import logging
|
||||||
|
|
||||||
import allure
|
import allure
|
||||||
import pytest
|
import pytest
|
||||||
from epoch import get_epoch, tick_epoch
|
from epoch import get_epoch
|
||||||
from file_helper import generate_file, get_file_hash
|
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 pytest import FixtureRequest
|
||||||
from python_keywords.container import create_container
|
from python_keywords.container import create_container
|
||||||
from python_keywords.frostfs_verbs import get_object_from_random_node, put_object_to_random_node
|
from python_keywords.frostfs_verbs import get_object_from_random_node, put_object_to_random_node
|
||||||
|
|
|
@ -8,8 +8,7 @@ from cluster_test_base import ClusterTestBase
|
||||||
from common import STORAGE_GC_TIME
|
from common import STORAGE_GC_TIME
|
||||||
from complex_object_actions import get_link_object, get_storage_object_chunks
|
from complex_object_actions import get_link_object, get_storage_object_chunks
|
||||||
from epoch import ensure_fresh_epoch, get_epoch, tick_epoch
|
from epoch import ensure_fresh_epoch, get_epoch, tick_epoch
|
||||||
from frostfs_testlib.shell import Shell
|
from frostfs_testlib.resources.common import (
|
||||||
from grpc_responses import (
|
|
||||||
LIFETIME_REQUIRED,
|
LIFETIME_REQUIRED,
|
||||||
LOCK_NON_REGULAR_OBJECT,
|
LOCK_NON_REGULAR_OBJECT,
|
||||||
LOCK_OBJECT_EXPIRATION,
|
LOCK_OBJECT_EXPIRATION,
|
||||||
|
@ -18,6 +17,7 @@ from grpc_responses import (
|
||||||
OBJECT_IS_LOCKED,
|
OBJECT_IS_LOCKED,
|
||||||
OBJECT_NOT_FOUND,
|
OBJECT_NOT_FOUND,
|
||||||
)
|
)
|
||||||
|
from frostfs_testlib.shell import Shell
|
||||||
from node_management import drop_object
|
from node_management import drop_object
|
||||||
from pytest import FixtureRequest
|
from pytest import FixtureRequest
|
||||||
from python_keywords.container import create_container
|
from python_keywords.container import create_container
|
||||||
|
|
|
@ -4,6 +4,7 @@ import allure
|
||||||
import pytest
|
import pytest
|
||||||
from container import create_container
|
from container import create_container
|
||||||
from file_helper import generate_file
|
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 http_gate import get_object_and_verify_hashes, upload_via_http_gate_curl
|
||||||
from python_keywords.acl import (
|
from python_keywords.acl import (
|
||||||
EACLAccess,
|
EACLAccess,
|
||||||
|
@ -17,7 +18,6 @@ from python_keywords.acl import (
|
||||||
sign_bearer,
|
sign_bearer,
|
||||||
wait_for_cache_expired,
|
wait_for_cache_expired,
|
||||||
)
|
)
|
||||||
from wellknown_acl import PUBLIC_ACL
|
|
||||||
|
|
||||||
from steps.cluster_test_base import ClusterTestBase
|
from steps.cluster_test_base import ClusterTestBase
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,9 @@ import os
|
||||||
|
|
||||||
import allure
|
import allure
|
||||||
import pytest
|
import pytest
|
||||||
from epoch import get_epoch, tick_epoch
|
from epoch import get_epoch
|
||||||
from file_helper import generate_file, get_file_hash
|
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.container import create_container
|
||||||
from python_keywords.frostfs_verbs import put_object_to_random_node
|
from python_keywords.frostfs_verbs import put_object_to_random_node
|
||||||
from python_keywords.http_gate import (
|
from python_keywords.http_gate import (
|
||||||
|
@ -19,7 +20,6 @@ from python_keywords.http_gate import (
|
||||||
upload_via_http_gate_curl,
|
upload_via_http_gate_curl,
|
||||||
)
|
)
|
||||||
from utility import wait_for_gc_pass_on_storage_nodes
|
from utility import wait_for_gc_pass_on_storage_nodes
|
||||||
from wellknown_acl import PUBLIC_ACL
|
|
||||||
|
|
||||||
from steps.cluster_test_base import ClusterTestBase
|
from steps.cluster_test_base import ClusterTestBase
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ from container import (
|
||||||
list_containers,
|
list_containers,
|
||||||
wait_for_container_deletion,
|
wait_for_container_deletion,
|
||||||
)
|
)
|
||||||
from epoch import tick_epoch
|
|
||||||
from file_helper import generate_file
|
from file_helper import generate_file
|
||||||
|
from frostfs_testlib.resources.common import PUBLIC_ACL
|
||||||
from http_gate import (
|
from http_gate import (
|
||||||
attr_into_str_header_curl,
|
attr_into_str_header_curl,
|
||||||
get_object_by_attr_and_verify_hashes,
|
get_object_by_attr_and_verify_hashes,
|
||||||
|
@ -20,7 +20,6 @@ from http_gate import (
|
||||||
)
|
)
|
||||||
from pytest import FixtureRequest
|
from pytest import FixtureRequest
|
||||||
from python_keywords.frostfs_verbs import delete_object
|
from python_keywords.frostfs_verbs import delete_object
|
||||||
from wellknown_acl import PUBLIC_ACL
|
|
||||||
|
|
||||||
from helpers.storage_object_info import StorageObjectInfo
|
from helpers.storage_object_info import StorageObjectInfo
|
||||||
from steps.cluster_test_base import ClusterTestBase
|
from steps.cluster_test_base import ClusterTestBase
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
import logging
|
import logging
|
||||||
import os
|
|
||||||
|
|
||||||
import allure
|
import allure
|
||||||
import pytest
|
import pytest
|
||||||
from container import create_container
|
from container import create_container
|
||||||
from file_helper import generate_file
|
from file_helper import generate_file
|
||||||
|
from frostfs_testlib.resources.common import PUBLIC_ACL
|
||||||
from http_gate import (
|
from http_gate import (
|
||||||
get_object_and_verify_hashes,
|
get_object_and_verify_hashes,
|
||||||
get_object_by_attr_and_verify_hashes,
|
get_object_by_attr_and_verify_hashes,
|
||||||
try_to_get_object_via_passed_request_and_expect_error,
|
try_to_get_object_via_passed_request_and_expect_error,
|
||||||
)
|
)
|
||||||
from python_keywords.frostfs_verbs import put_object_to_random_node
|
from python_keywords.frostfs_verbs import put_object_to_random_node
|
||||||
from wellknown_acl import PUBLIC_ACL
|
|
||||||
|
|
||||||
from steps.cluster_test_base import ClusterTestBase
|
from steps.cluster_test_base import ClusterTestBase
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ import allure
|
||||||
import pytest
|
import pytest
|
||||||
from container import create_container
|
from container import create_container
|
||||||
from file_helper import generate_file
|
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 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
|
from steps.cluster_test_base import ClusterTestBase
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import pytest
|
||||||
from container import create_container
|
from container import create_container
|
||||||
from epoch import get_epoch, wait_for_epochs_align
|
from epoch import get_epoch, wait_for_epochs_align
|
||||||
from file_helper import generate_file
|
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 (
|
from http_gate import (
|
||||||
attr_into_str_header_curl,
|
attr_into_str_header_curl,
|
||||||
get_object_and_verify_hashes,
|
get_object_and_verify_hashes,
|
||||||
|
@ -20,7 +20,6 @@ from python_keywords.frostfs_verbs import (
|
||||||
get_object_from_random_node,
|
get_object_from_random_node,
|
||||||
head_object,
|
head_object,
|
||||||
)
|
)
|
||||||
from wellknown_acl import PUBLIC_ACL
|
|
||||||
|
|
||||||
from steps.cluster_test_base import ClusterTestBase
|
from steps.cluster_test_base import ClusterTestBase
|
||||||
|
|
||||||
|
@ -29,10 +28,10 @@ EXPIRATION_TIMESTAMP_HEADER = "__FROSRFS__EXPIRATION_TIMESTAMP"
|
||||||
EXPIRATION_EPOCH_HEADER = "__FROSRFS__EXPIRATION_EPOCH"
|
EXPIRATION_EPOCH_HEADER = "__FROSRFS__EXPIRATION_EPOCH"
|
||||||
EXPIRATION_DURATION_HEADER = "__FROSRFS__EXPIRATION_DURATION"
|
EXPIRATION_DURATION_HEADER = "__FROSRFS__EXPIRATION_DURATION"
|
||||||
EXPIRATION_EXPIRATION_RFC = "__FROSRFS__EXPIRATION_RFC3339"
|
EXPIRATION_EXPIRATION_RFC = "__FROSRFS__EXPIRATION_RFC3339"
|
||||||
FROSRFS_EXPIRATION_EPOCH = "Frostfs-Expiration-Epoch"
|
FROSTFS_EXPIRATION_EPOCH = "Frostfs-Expiration-Epoch"
|
||||||
FROSRFS_EXPIRATION_DURATION = "Frostfs-Expiration-Duration"
|
FROSTFS_EXPIRATION_DURATION = "Frostfs-Expiration-Duration"
|
||||||
FROSRFS_EXPIRATION_TIMESTAMP = "Frostfs-Expiration-Timestamp"
|
FROSTFS_EXPIRATION_TIMESTAMP = "Frostfs-Expiration-Timestamp"
|
||||||
FROSRFS_EXIPRATION_RFC3339 = "Frostfs-Expiration-RFC3339"
|
FROSTFS_EXPIRATION_RFC3339 = "Frostfs-Expiration-RFC3339"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sanity
|
@pytest.mark.sanity
|
||||||
|
@ -324,7 +323,7 @@ class Test_http_system_header(ClusterTestBase):
|
||||||
FROSTFS_EXPIRATION_TIMESTAMP: self.epoch_count_into_timestamp(
|
FROSTFS_EXPIRATION_TIMESTAMP: self.epoch_count_into_timestamp(
|
||||||
epoch_duration=epoch_duration, epoch=2
|
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
|
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}"
|
f"epoch duration={epoch_duration}, current_epoch= {get_epoch(self.shell, self.cluster)} expected_epoch {expected_epoch}"
|
||||||
)
|
)
|
||||||
attributes = {
|
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
|
epoch_duration=epoch_duration, epoch=2, rfc3339=True
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,8 @@ import pytest
|
||||||
from cluster_test_base import ClusterTestBase
|
from cluster_test_base import ClusterTestBase
|
||||||
from common import WALLET_PASS
|
from common import WALLET_PASS
|
||||||
from file_helper import generate_file
|
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 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.container import create_container
|
||||||
from python_keywords.frostfs_verbs import delete_object, put_object, put_object_to_random_node
|
from python_keywords.frostfs_verbs import delete_object, put_object, put_object_to_random_node
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,13 @@ from cluster import Cluster
|
||||||
from cluster_test_base import ClusterTestBase
|
from cluster_test_base import ClusterTestBase
|
||||||
from epoch import ensure_fresh_epoch
|
from epoch import ensure_fresh_epoch
|
||||||
from file_helper import generate_file
|
from file_helper import generate_file
|
||||||
from frostfs_testlib.shell import Shell
|
from frostfs_testlib.resources.common import (
|
||||||
from grpc_responses import (
|
|
||||||
EXPIRED_SESSION_TOKEN,
|
EXPIRED_SESSION_TOKEN,
|
||||||
MALFORMED_REQUEST,
|
MALFORMED_REQUEST,
|
||||||
OBJECT_ACCESS_DENIED,
|
OBJECT_ACCESS_DENIED,
|
||||||
OBJECT_NOT_FOUND,
|
OBJECT_NOT_FOUND,
|
||||||
)
|
)
|
||||||
|
from frostfs_testlib.shell import Shell
|
||||||
from pytest import FixtureRequest
|
from pytest import FixtureRequest
|
||||||
from python_keywords.container import create_container
|
from python_keywords.container import create_container
|
||||||
from python_keywords.frostfs_verbs import (
|
from python_keywords.frostfs_verbs import (
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import allure
|
import allure
|
||||||
import pytest
|
import pytest
|
||||||
from file_helper import generate_file
|
from file_helper import generate_file
|
||||||
|
from frostfs_testlib.resources.common import PUBLIC_ACL
|
||||||
from frostfs_testlib.shell import Shell
|
from frostfs_testlib.shell import Shell
|
||||||
from python_keywords.acl import (
|
from python_keywords.acl import (
|
||||||
EACLAccess,
|
EACLAccess,
|
||||||
|
@ -19,7 +20,6 @@ from python_keywords.container import (
|
||||||
)
|
)
|
||||||
from python_keywords.object_access import can_put_object
|
from python_keywords.object_access import can_put_object
|
||||||
from wallet import WalletFile
|
from wallet import WalletFile
|
||||||
from wellknown_acl import PUBLIC_ACL
|
|
||||||
|
|
||||||
from steps.cluster_test_base import ClusterTestBase
|
from steps.cluster_test_base import ClusterTestBase
|
||||||
from steps.session_token import ContainerVerb, get_container_signed_token
|
from steps.session_token import ContainerVerb, get_container_signed_token
|
||||||
|
|
|
@ -30,7 +30,7 @@ mmh3==3.0.0
|
||||||
multidict==6.0.2
|
multidict==6.0.2
|
||||||
mypy==0.950
|
mypy==0.950
|
||||||
mypy-extensions==0.4.3
|
mypy-extensions==0.4.3
|
||||||
frostfs-testlib==1.2.0
|
frostfs-testlib==1.3.0
|
||||||
netaddr==0.8.0
|
netaddr==0.8.0
|
||||||
packaging==21.3
|
packaging==21.3
|
||||||
paramiko==2.10.3
|
paramiko==2.10.3
|
||||||
|
|
|
@ -3,8 +3,9 @@ from typing import Optional
|
||||||
import allure
|
import allure
|
||||||
from cluster import Cluster
|
from cluster import Cluster
|
||||||
from file_helper import get_file_hash
|
from file_helper import get_file_hash
|
||||||
|
from frostfs_testlib.resources.common import OBJECT_ACCESS_DENIED
|
||||||
from frostfs_testlib.shell import Shell
|
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 (
|
from python_keywords.frostfs_verbs import (
|
||||||
delete_object,
|
delete_object,
|
||||||
get_object_from_random_node,
|
get_object_from_random_node,
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import List
|
|
||||||
|
|
||||||
import allure
|
import allure
|
||||||
import complex_object_actions
|
import complex_object_actions
|
||||||
import frostfs_verbs
|
import frostfs_verbs
|
||||||
from cluster import StorageNode
|
from cluster import StorageNode
|
||||||
|
from frostfs_testlib.resources.common import OBJECT_NOT_FOUND
|
||||||
from frostfs_testlib.shell import Shell
|
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")
|
logger = logging.getLogger("NeoLogger")
|
||||||
|
|
||||||
|
|
|
@ -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"
|
|
0
venv/local-pytest/environment.sh
Normal file → Executable file
0
venv/local-pytest/environment.sh
Normal file → Executable file
Loading…
Reference in a new issue