forked from TrueCloudLab/frostfs-testcases
Compare commits
2 Commits
fe4341893b
...
e5058d38ca
Author | SHA1 | Date |
---|---|---|
|
e5058d38ca | |
|
e453614381 |
|
@ -54,7 +54,7 @@ class TestContainer(ClusterTestBase):
|
|||
info_to_check = {
|
||||
f"basic ACL: {PRIVATE_ACL_F} (private)",
|
||||
f"owner ID: {json_wallet.get('accounts')[0].get('address')}",
|
||||
f"container ID: {cid}",
|
||||
f"CID: {cid}",
|
||||
}
|
||||
if name:
|
||||
info_to_check.add(f"Name={name}")
|
||||
|
@ -115,6 +115,10 @@ class TestContainer(ClusterTestBase):
|
|||
|
||||
with reporter.step("Delete containers and check they were deleted"):
|
||||
for cid in cids:
|
||||
delete_container(wallet, cid, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint, await_mode=True)
|
||||
containers_list = list_containers(wallet, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint)
|
||||
assert cid not in containers_list, "Container not deleted"
|
||||
delete_container(
|
||||
wallet, cid, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint, await_mode=True
|
||||
)
|
||||
containers_list = list_containers(
|
||||
wallet, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint
|
||||
)
|
||||
assert cid not in containers_list, "Container not deleted"
|
||||
|
|
|
@ -7,6 +7,7 @@ from typing import Optional, Tuple
|
|||
import allure
|
||||
import pytest
|
||||
from frostfs_testlib import reporter
|
||||
from frostfs_testlib.hosting import Host
|
||||
from frostfs_testlib.cli import FrostfsCli
|
||||
from frostfs_testlib.cli.netmap_parser import NetmapParser
|
||||
from frostfs_testlib.resources.cli import FROSTFS_CLI_EXEC
|
||||
|
@ -49,6 +50,7 @@ from pytest_tests.helpers.utility import wait_for_gc_pass_on_storage_nodes
|
|||
|
||||
logger = logging.getLogger("NeoLogger")
|
||||
check_nodes: list[StorageNode] = []
|
||||
check_nodes_cluster_node_hosts: list[Host] = []
|
||||
|
||||
|
||||
@allure.title("Add one node to cluster")
|
||||
|
@ -122,8 +124,10 @@ class TestNodeManagement(ClusterTestBase):
|
|||
sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME))
|
||||
|
||||
with reporter.step(f"Move node {node} to online state"):
|
||||
storage_node_set_status(node, status="online", retries=2)
|
||||
node_cluster_node_host = check_nodes_cluster_node_hosts[check_nodes.index(node)]
|
||||
storage_node_set_status(node, node_cluster_node_host, status="online", retries=2)
|
||||
|
||||
check_nodes_cluster_node_hosts.pop(check_nodes.index(node))
|
||||
check_nodes.remove(node)
|
||||
sleep(datetime_utils.parse_time(MORPH_BLOCK_TIME))
|
||||
self.tick_epoch_with_retries(3, wait_block=2)
|
||||
|
@ -145,16 +149,25 @@ class TestNodeManagement(ClusterTestBase):
|
|||
placement_rule_4 = "REP 4 IN X CBF 1 SELECT 4 FROM * AS X"
|
||||
source_file_path = generate_file(simple_object_size.value)
|
||||
|
||||
storage_nodes = self.cluster.storage_nodes
|
||||
random_node = random.choice(storage_nodes[1:])
|
||||
storage_nodes = []
|
||||
corresponding_cluster_node_hosts = []
|
||||
for cluster_node in self.cluster.cluster_nodes:
|
||||
storage_nodes.append(cluster_node.storage_node)
|
||||
corresponding_cluster_node_hosts.append(cluster_node.host)
|
||||
|
||||
random_node_index = random.randint(1, len(storage_nodes) - 1)
|
||||
random_node = storage_nodes[random_node_index]
|
||||
random_node_host = corresponding_cluster_node_hosts[random_node_index]
|
||||
|
||||
alive_node = random.choice(
|
||||
[storage_node for storage_node in storage_nodes if storage_node.id != random_node.id]
|
||||
)
|
||||
|
||||
|
||||
check_node_in_map(random_node, shell=self.shell, alive_node=alive_node)
|
||||
|
||||
# Add node to recovery list before messing with it
|
||||
check_nodes.append(random_node)
|
||||
check_nodes_cluster_node_hosts.append(random_node_host)
|
||||
exclude_node_from_network_map(random_node, alive_node, shell=self.shell, cluster=self.cluster)
|
||||
delete_node_data(random_node)
|
||||
|
||||
|
@ -180,6 +193,7 @@ class TestNodeManagement(ClusterTestBase):
|
|||
random_node = random.choice(list(set(storage_nodes) - {random_node, alive_node}))
|
||||
# Add node to recovery list before messing with it
|
||||
check_nodes.append(random_node)
|
||||
check_nodes_cluster_node_hosts.append(random_node_host)
|
||||
exclude_node_from_network_map(random_node, alive_node, shell=self.shell, cluster=self.cluster)
|
||||
|
||||
wait_object_replication(
|
||||
|
@ -290,8 +304,22 @@ class TestNodeManagement(ClusterTestBase):
|
|||
wallet = default_wallet
|
||||
placement_rule = "REP 3 IN X SELECT 4 FROM * AS X"
|
||||
source_file_path = generate_file(simple_object_size.value)
|
||||
storage_nodes = self.cluster.storage_nodes
|
||||
random_node = random.choice(storage_nodes[1:])
|
||||
# storage_nodes = self.cluster.storage_nodes
|
||||
# random_node = random.choice(storage_nodes[1:])
|
||||
# alive_node = random.choice(
|
||||
# [storage_node for storage_node in storage_nodes if storage_node.id != random_node.id]
|
||||
# )
|
||||
|
||||
storage_nodes = []
|
||||
corresponding_cluster_node_hosts = []
|
||||
for cluster_node in self.cluster.cluster_nodes:
|
||||
storage_nodes.append(cluster_node.storage_node)
|
||||
corresponding_cluster_node_hosts.append(cluster_node.host)
|
||||
|
||||
random_node_index = random.randint(1, len(storage_nodes) - 1)
|
||||
random_node = storage_nodes[random_node_index]
|
||||
random_node_host = corresponding_cluster_node_hosts[random_node_index]
|
||||
|
||||
alive_node = random.choice(
|
||||
[storage_node for storage_node in storage_nodes if storage_node.id != random_node.id]
|
||||
)
|
||||
|
@ -305,6 +333,7 @@ class TestNodeManagement(ClusterTestBase):
|
|||
)
|
||||
with reporter.step("Stop the random node"):
|
||||
check_nodes.append(random_node)
|
||||
check_nodes_cluster_node_hosts.append(random_node_host)
|
||||
random_node.stop_service()
|
||||
with reporter.step("Try to put an object and expect success"):
|
||||
put_object(
|
||||
|
|
Loading…
Reference in New Issue