forked from TrueCloudLab/frostfs-testcases
Updates for local dev env runs
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
parent
d357241a61
commit
146aaa371f
3 changed files with 43 additions and 2 deletions
|
@ -4,6 +4,7 @@ from dataclasses import dataclass
|
|||
from typing import Any
|
||||
|
||||
import data_formatters
|
||||
import yaml
|
||||
from neofs_testlib.blockchain import RPCClient
|
||||
from neofs_testlib.hosting import Host, Hosting
|
||||
from neofs_testlib.hosting.config import ServiceConfig
|
||||
|
@ -237,6 +238,25 @@ class Cluster:
|
|||
def hosting(self) -> Hosting:
|
||||
return self._hosting
|
||||
|
||||
def _create_wallet_config(self, service: ServiceConfig) -> None:
|
||||
wallet_path = service.attributes[_ConfigAttributes.LOCAL_WALLET_CONFIG]
|
||||
wallet_password = service.attributes[_ConfigAttributes.WALLET_PASSWORD]
|
||||
with open(wallet_path, "w") as file:
|
||||
yaml.dump({"password": wallet_password}, file)
|
||||
|
||||
def create_wallet_configs(self, hosting: Hosting) -> None:
|
||||
configs = hosting.find_service_configs(".*")
|
||||
for config in configs:
|
||||
if _ConfigAttributes.LOCAL_WALLET_CONFIG in config.attributes:
|
||||
self._create_wallet_config(config)
|
||||
|
||||
def is_local_devevn(self) -> bool:
|
||||
if len(self.hosting.hosts) == 1:
|
||||
host = self.hosting.hosts[0]
|
||||
if host.config.address == "localhost" and host.config.plugin_name == "docker":
|
||||
return True
|
||||
return False
|
||||
|
||||
@property
|
||||
def storage_nodes(self) -> list[StorageNode]:
|
||||
"""
|
||||
|
|
|
@ -115,8 +115,11 @@ def wallet_factory(temp_directory: str, client_shell: Shell, cluster: Cluster) -
|
|||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def cluster(hosting: Hosting) -> Cluster:
|
||||
yield Cluster(hosting)
|
||||
def cluster(temp_directory: str, hosting: Hosting) -> Cluster:
|
||||
cluster = Cluster(hosting)
|
||||
if cluster.is_local_devevn():
|
||||
cluster.create_wallet_configs(hosting)
|
||||
yield cluster
|
||||
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue