[#298] Add set mode shards in teardown test ec
Some checks reported warnings
DCO check / Commits Check (pull_request) Has been cancelled
Some checks reported warnings
DCO check / Commits Check (pull_request) Has been cancelled
Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
parent
ccdd6ab784
commit
8e5793e545
1 changed files with 21 additions and 4 deletions
|
@ -1,7 +1,9 @@
|
|||
import json
|
||||
from dataclasses import dataclass
|
||||
import time
|
||||
|
||||
import allure
|
||||
from frostfs_testlib.shell.interfaces import Shell
|
||||
import pytest
|
||||
import yaml
|
||||
from frostfs_testlib import plugins, reporter
|
||||
|
@ -67,6 +69,21 @@ def frostfs_remote_adm(cluster: Cluster) -> FrostfsAdm:
|
|||
@pytest.mark.replication
|
||||
@pytest.mark.ec_replication
|
||||
class TestECReplication(ClusterTestBase):
|
||||
def get_node_cli(self, cluster_node: ClusterNode, config: str) -> FrostfsCli:
|
||||
shell = cluster_node.host.get_shell()
|
||||
cli = FrostfsCli(shell, frostfs_cli_exec_path=FROSTFS_CLI_EXEC, config_file=config)
|
||||
self.cli_change_shards_mode: dict[FrostfsCli, str] = {cli: cluster_node.storage_node.get_control_endpoint()}
|
||||
return cli
|
||||
|
||||
@pytest.fixture()
|
||||
def restore_nodes_shards_mode(self):
|
||||
yield
|
||||
|
||||
for cli, endpoint in self.cli_change_shards_mode.items():
|
||||
cli.shards.set_mode(endpoint, mode='read-write', all=True)
|
||||
|
||||
time.sleep(8)
|
||||
|
||||
@pytest.fixture()
|
||||
def rep_count(self, object_size: ObjectSize) -> int:
|
||||
rep_count = 3
|
||||
|
@ -777,6 +794,7 @@ class TestECReplication(ClusterTestBase):
|
|||
@pytest.mark.parametrize("type, get_chunk", [("data", get_data_chunk_object), ("parity", get_parity_chunk_object)])
|
||||
def test_evacuation_data_shard(
|
||||
self,
|
||||
restore_nodes_shards_mode: None,
|
||||
default_user: User,
|
||||
frostfs_cli: FrostfsCli,
|
||||
max_object_size: int,
|
||||
|
@ -793,10 +811,9 @@ class TestECReplication(ClusterTestBase):
|
|||
with reporter.step("Get object chunks."):
|
||||
chunk = get_chunk(self, frostfs_cli, cid, oid, self.cluster.default_rpc_endpoint)
|
||||
chunk_node = self.get_chunk_node(frostfs_cli, chunk)
|
||||
frostfs_node_cli = FrostfsCli(
|
||||
chunk_node[0].host.get_shell(),
|
||||
frostfs_cli_exec_path=FROSTFS_CLI_EXEC,
|
||||
config_file=chunk_node[0].storage_node.get_remote_wallet_config_path(),
|
||||
frostfs_node_cli = self.get_node_cli(
|
||||
chunk_node[0],
|
||||
config=chunk_node[0].storage_node.get_remote_wallet_config_path(),
|
||||
)
|
||||
|
||||
with reporter.step("Search shards chunk"):
|
||||
|
|
Loading…
Reference in a new issue