Change file_pith fixture and change title test acl
Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
parent
3455c5360d
commit
e6916142af
6 changed files with 27 additions and 16 deletions
|
@ -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.storage.dataclasses.object_size import ObjectSize
|
||||||
from frostfs_testlib.utils import wallet_utils
|
from frostfs_testlib.utils import wallet_utils
|
||||||
from frostfs_testlib.utils.file_utils import generate_file
|
from frostfs_testlib.utils.file_utils import generate_file
|
||||||
|
from pytest_lazyfixture import lazy_fixture
|
||||||
|
|
||||||
OBJECT_COUNT = 5
|
OBJECT_COUNT = 5
|
||||||
|
|
||||||
|
@ -69,9 +70,15 @@ def wallets(default_wallet: str, temp_directory: str, cluster: Cluster) -> Walle
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(params=[lazy_fixture("simple_object_size"), lazy_fixture("complex_object_size")])
|
||||||
def file_path(simple_object_size: ObjectSize) -> str:
|
def file_size(request: pytest.FixtureRequest) -> int:
|
||||||
yield generate_file(simple_object_size.value)
|
size = request.param
|
||||||
|
return size
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture()
|
||||||
|
def file_path(file_size: ObjectSize) -> str:
|
||||||
|
yield generate_file(file_size.value)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="function")
|
@pytest.fixture(scope="function")
|
||||||
|
|
|
@ -68,7 +68,7 @@ class TestACLBasic(ClusterTestBase):
|
||||||
# with allure.step('Delete public readonly container'):
|
# with allure.step('Delete public readonly container'):
|
||||||
# delete_container(user_wallet.wallet_path, cid_read_only)
|
# 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):
|
def test_basic_acl_public(self, wallets: Wallets, public_container: str, file_path: str):
|
||||||
"""
|
"""
|
||||||
Test basic ACL set during public container creation.
|
Test basic ACL set during public container creation.
|
||||||
|
@ -114,7 +114,7 @@ class TestACLBasic(ClusterTestBase):
|
||||||
cluster=self.cluster,
|
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):
|
def test_basic_acl_private(self, wallets: Wallets, private_container: str, file_path: str):
|
||||||
"""
|
"""
|
||||||
Test basic ACL set during private container creation.
|
Test basic ACL set during private container creation.
|
||||||
|
@ -148,7 +148,7 @@ class TestACLBasic(ClusterTestBase):
|
||||||
cluster=self.cluster,
|
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(
|
def test_basic_acl_readonly(
|
||||||
self, wallets: Wallets, client_shell: Shell, read_only_container: str, file_path: str
|
self, wallets: Wallets, client_shell: Shell, read_only_container: str, file_path: str
|
||||||
):
|
):
|
||||||
|
|
|
@ -21,7 +21,7 @@ from pytest_tests.testsuites.acl.conftest import Wallets
|
||||||
@pytest.mark.acl
|
@pytest.mark.acl
|
||||||
@pytest.mark.acl_bearer
|
@pytest.mark.acl_bearer
|
||||||
class TestACLBearer(ClusterTestBase):
|
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])
|
@pytest.mark.parametrize("role", [EACLRole.USER, EACLRole.OTHERS])
|
||||||
def test_bearer_token_operations(
|
def test_bearer_token_operations(
|
||||||
self,
|
self,
|
||||||
|
@ -113,7 +113,7 @@ class TestACLBearer(ClusterTestBase):
|
||||||
cluster=self.cluster,
|
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):
|
def test_bearer_token_compound_operations(self, wallets, eacl_container_with_objects):
|
||||||
endpoint = self.cluster.default_rpc_endpoint
|
endpoint = self.cluster.default_rpc_endpoint
|
||||||
cid, objects_oids, file_path = eacl_container_with_objects
|
cid, objects_oids, file_path = eacl_container_with_objects
|
||||||
|
|
|
@ -58,7 +58,7 @@ class TestEACLContainer(ClusterTestBase):
|
||||||
|
|
||||||
yield cid, oid, file_path
|
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])
|
@pytest.mark.parametrize("deny_role", [EACLRole.USER, EACLRole.OTHERS])
|
||||||
def test_extended_acl_deny_all_operations(
|
def test_extended_acl_deny_all_operations(
|
||||||
self,
|
self,
|
||||||
|
@ -145,7 +145,7 @@ class TestEACLContainer(ClusterTestBase):
|
||||||
cluster=self.cluster,
|
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(
|
def test_extended_acl_deny_all_operations_exclude_pubkey(
|
||||||
self, wallets: Wallets, eacl_container_with_objects: tuple[str, list[str], str]
|
self, wallets: Wallets, eacl_container_with_objects: tuple[str, list[str], str]
|
||||||
):
|
):
|
||||||
|
@ -206,7 +206,7 @@ class TestEACLContainer(ClusterTestBase):
|
||||||
cluster=self.cluster,
|
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(
|
def test_extended_acl_deny_replication(
|
||||||
self,
|
self,
|
||||||
wallets: Wallets,
|
wallets: Wallets,
|
||||||
|
@ -248,7 +248,7 @@ class TestEACLContainer(ClusterTestBase):
|
||||||
storage_nodes,
|
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(
|
def test_extended_actions_system(
|
||||||
self, wallets: Wallets, eacl_container_with_objects: tuple[str, list[str], str]
|
self, wallets: Wallets, eacl_container_with_objects: tuple[str, list[str], str]
|
||||||
):
|
):
|
||||||
|
|
|
@ -128,7 +128,7 @@ class TestEACLFilters(ClusterTestBase):
|
||||||
endpoint=self.cluster.default_rpc_endpoint,
|
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(
|
@pytest.mark.parametrize(
|
||||||
"match_type", [EACLMatchType.STRING_EQUAL, EACLMatchType.STRING_NOT_EQUAL]
|
"match_type", [EACLMatchType.STRING_EQUAL, EACLMatchType.STRING_NOT_EQUAL]
|
||||||
)
|
)
|
||||||
|
@ -245,7 +245,9 @@ class TestEACLFilters(ClusterTestBase):
|
||||||
bearer=bearer_other,
|
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(
|
@pytest.mark.parametrize(
|
||||||
"match_type", [EACLMatchType.STRING_EQUAL, EACLMatchType.STRING_NOT_EQUAL]
|
"match_type", [EACLMatchType.STRING_EQUAL, EACLMatchType.STRING_NOT_EQUAL]
|
||||||
)
|
)
|
||||||
|
@ -428,7 +430,9 @@ class TestEACLFilters(ClusterTestBase):
|
||||||
bearer=bearer_other_for_put,
|
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(
|
@pytest.mark.parametrize(
|
||||||
"match_type", [EACLMatchType.STRING_EQUAL, EACLMatchType.STRING_NOT_EQUAL]
|
"match_type", [EACLMatchType.STRING_EQUAL, EACLMatchType.STRING_NOT_EQUAL]
|
||||||
)
|
)
|
||||||
|
|
|
@ -135,7 +135,7 @@ class TestFailoverStorage(ClusterTestBase):
|
||||||
oid,
|
oid,
|
||||||
2,
|
2,
|
||||||
shell=self.shell,
|
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)
|
assert all(old_node not in new_nodes for old_node in nodes)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue