Change file_pith fixture and change title test acl

Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
support/v0.37
Dmitriy Zayakin 2023-09-07 10:18:18 +03:00 committed by Dmitriy Zayakin
parent 28a7748398
commit 967f4f37d9
6 changed files with 27 additions and 16 deletions

View File

@ -16,6 +16,7 @@ from frostfs_testlib.storage.dataclasses.frostfs_services import InnerRing, Stor
from frostfs_testlib.storage.dataclasses.object_size import ObjectSize
from frostfs_testlib.utils import wallet_utils
from frostfs_testlib.utils.file_utils import generate_file
from pytest_lazyfixture import lazy_fixture
OBJECT_COUNT = 5
@ -69,9 +70,15 @@ def wallets(default_wallet: str, temp_directory: str, cluster: Cluster) -> Walle
)
@pytest.fixture(scope="module")
def file_path(simple_object_size: ObjectSize) -> str:
yield generate_file(simple_object_size.value)
@pytest.fixture(params=[lazy_fixture("simple_object_size"), lazy_fixture("complex_object_size")])
def file_size(request: pytest.FixtureRequest) -> int:
size = request.param
return size
@pytest.fixture()
def file_path(file_size: ObjectSize) -> str:
yield generate_file(file_size.value)
@pytest.fixture(scope="function")

View File

@ -68,7 +68,7 @@ class TestACLBasic(ClusterTestBase):
# with allure.step('Delete public readonly container'):
# delete_container(user_wallet.wallet_path, cid_read_only)
@allure.title("Test basic ACL on public container")
@allure.title("Operations with basic ACL on public container (obj_size={file_size})")
def test_basic_acl_public(self, wallets: Wallets, public_container: str, file_path: str):
"""
Test basic ACL set during public container creation.
@ -114,7 +114,7 @@ class TestACLBasic(ClusterTestBase):
cluster=self.cluster,
)
@allure.title("Test basic ACL on private container")
@allure.title("Operations with basic ACL on PRIVATE container (obj_size={file_size})")
def test_basic_acl_private(self, wallets: Wallets, private_container: str, file_path: str):
"""
Test basic ACL set during private container creation.
@ -148,7 +148,7 @@ class TestACLBasic(ClusterTestBase):
cluster=self.cluster,
)
@allure.title("Test basic ACL on readonly container")
@allure.title("Operations with basic ACL on READONLY container (obj_size={file_size})")
def test_basic_acl_readonly(
self, wallets: Wallets, client_shell: Shell, read_only_container: str, file_path: str
):

View File

@ -21,7 +21,7 @@ from pytest_tests.testsuites.acl.conftest import Wallets
@pytest.mark.acl
@pytest.mark.acl_bearer
class TestACLBearer(ClusterTestBase):
@allure.title("Validate FrostFS operations with {role.value} BearerToken")
@allure.title("Operations with BearerToken (role={role.value}, obj_size={file_size})")
@pytest.mark.parametrize("role", [EACLRole.USER, EACLRole.OTHERS])
def test_bearer_token_operations(
self,
@ -113,7 +113,7 @@ class TestACLBearer(ClusterTestBase):
cluster=self.cluster,
)
@allure.title("BearerToken Operations for compound Operations")
@allure.title("BearerToken for compound operations (obj_size={file_size})")
def test_bearer_token_compound_operations(self, wallets, eacl_container_with_objects):
endpoint = self.cluster.default_rpc_endpoint
cid, objects_oids, file_path = eacl_container_with_objects

View File

@ -58,7 +58,7 @@ class TestEACLContainer(ClusterTestBase):
yield cid, oid, file_path
@allure.title("Deny FrostFS operations for {deny_role.value}")
@allure.title("Deny operations (role={deny_role.value}, obj_size={file_size})")
@pytest.mark.parametrize("deny_role", [EACLRole.USER, EACLRole.OTHERS])
def test_extended_acl_deny_all_operations(
self,
@ -145,7 +145,7 @@ class TestEACLContainer(ClusterTestBase):
cluster=self.cluster,
)
@allure.title("Allow FrostFS operations for only one other pubkey")
@allure.title("Operations for only one other pubkey (obj_size={file_size})")
def test_extended_acl_deny_all_operations_exclude_pubkey(
self, wallets: Wallets, eacl_container_with_objects: tuple[str, list[str], str]
):
@ -206,7 +206,7 @@ class TestEACLContainer(ClusterTestBase):
cluster=self.cluster,
)
@allure.title("Replication with eACL deny rules")
@allure.title("Replication with eACL deny rules (obj_size={file_size})")
def test_extended_acl_deny_replication(
self,
wallets: Wallets,
@ -248,7 +248,7 @@ class TestEACLContainer(ClusterTestBase):
storage_nodes,
)
@allure.title("System operations with extended ACL")
@allure.title("Operations with extended ACL for SYSTEM (obj_size={file_size})")
def test_extended_actions_system(
self, wallets: Wallets, eacl_container_with_objects: tuple[str, list[str], str]
):

View File

@ -128,7 +128,7 @@ class TestEACLFilters(ClusterTestBase):
endpoint=self.cluster.default_rpc_endpoint,
)
@allure.title("Validate FrostFS operations with request filter: {match_type}")
@allure.title("Operations with request filter (match_type={match_type}, obj_size={file_size})")
@pytest.mark.parametrize(
"match_type", [EACLMatchType.STRING_EQUAL, EACLMatchType.STRING_NOT_EQUAL]
)
@ -245,7 +245,9 @@ class TestEACLFilters(ClusterTestBase):
bearer=bearer_other,
)
@allure.title("Validate FrostFS operations with deny user headers filter: {match_type}")
@allure.title(
"Operations with deny user headers filter (match_type={match_type}, obj_size={file_size})"
)
@pytest.mark.parametrize(
"match_type", [EACLMatchType.STRING_EQUAL, EACLMatchType.STRING_NOT_EQUAL]
)
@ -428,7 +430,9 @@ class TestEACLFilters(ClusterTestBase):
bearer=bearer_other_for_put,
)
@allure.title("Validate FrostFS operation with allow eACL user headers filters: {match_type}")
@allure.title(
"Operations with allow eACL user headers filters (match_type={match_type}, obj_size={file_size})"
)
@pytest.mark.parametrize(
"match_type", [EACLMatchType.STRING_EQUAL, EACLMatchType.STRING_NOT_EQUAL]
)

View File

@ -135,7 +135,7 @@ class TestFailoverStorage(ClusterTestBase):
oid,
2,
shell=self.shell,
nodes=list(set(self.cluster.storage_nodes) - {node}),
nodes=list(set(self.cluster.storage_nodes) - {*stopped_nodes}),
)
assert all(old_node not in new_nodes for old_node in nodes)