2022-11-30 08:26:38 +00:00
|
|
|
import pytest
|
2024-03-11 16:34:54 +00:00
|
|
|
from frostfs_testlib import reporter
|
|
|
|
from frostfs_testlib.credentials.interfaces import CredentialsProvider, User
|
|
|
|
from frostfs_testlib.storage.cluster import Cluster
|
|
|
|
from frostfs_testlib.storage.dataclasses.wallet import WalletInfo
|
2024-10-07 14:34:07 +00:00
|
|
|
from frostfs_testlib.utils import string_utils
|
2022-11-30 08:26:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
2024-07-17 20:56:05 +00:00
|
|
|
def owner_wallet(default_wallet: WalletInfo) -> WalletInfo:
|
|
|
|
return default_wallet
|
2022-11-30 08:26:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
2024-03-11 16:34:54 +00:00
|
|
|
def user_wallet(credentials_provider: CredentialsProvider, cluster: Cluster) -> WalletInfo:
|
|
|
|
with reporter.step("Create user wallet which will use objects from owner via static session"):
|
2024-10-07 14:34:07 +00:00
|
|
|
user = User(string_utils.unique_name("user_"))
|
2024-03-11 16:34:54 +00:00
|
|
|
return credentials_provider.GRPC.provide(user, cluster.cluster_nodes[0])
|
2022-11-30 08:26:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
2024-03-11 16:34:54 +00:00
|
|
|
def stranger_wallet(credentials_provider: CredentialsProvider, cluster: Cluster) -> WalletInfo:
|
|
|
|
with reporter.step("Create stranger user wallet which should fail to obtain data"):
|
2024-10-07 14:34:07 +00:00
|
|
|
user = User(string_utils.unique_name("user_"))
|
2024-03-11 16:34:54 +00:00
|
|
|
return credentials_provider.GRPC.provide(user, cluster.cluster_nodes[0])
|