Skip to content

Commit

Permalink
Enable network failover tests
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeniy Zayats <[email protected]>
  • Loading branch information
Evgeniy Zayats committed Jun 21, 2024
1 parent 670a985 commit c35c203
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions pytest_tests/tests/failovers/test_failover_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

@pytest.mark.failover
@pytest.mark.failover_network
@pytest.mark.skip(reason="These tests require multiple hosts/inner rings to run")
class TestFailoverNetwork(NeofsEnvTestBase):
@pytest.fixture(autouse=True)
@allure.step("Restore network")
Expand Down Expand Up @@ -56,7 +55,9 @@ def test_block_storage_node_traffic(self, default_wallet, simple_object_size):
)
oid = put_object_to_random_node(wallet.path, source_file_path, cid, shell=self.shell, neofs_env=self.neofs_env)

nodes = wait_object_replication(cid, oid, 2, shell=self.shell, nodes=self.neofs_env.storage_nodes)
nodes = wait_object_replication(
cid, oid, 2, shell=self.shell, nodes=self.neofs_env.storage_nodes, neofs_env=self.neofs_env
)

logger.info(f"Nodes are {nodes}")
nodes_to_block = nodes
Expand All @@ -79,11 +80,12 @@ def test_block_storage_node_traffic(self, default_wallet, simple_object_size):
2,
shell=self.shell,
nodes=list(set(self.neofs_env.storage_nodes) - set(excluded_nodes)),
neofs_env=self.neofs_env,
)
assert node not in new_nodes

with allure.step("Check object data is not corrupted"):
got_file_path = get_object(wallet, cid, oid, endpoint=new_nodes[0].endpoint, shell=self.shell)
got_file_path = get_object(wallet.path, cid, oid, endpoint=new_nodes[0].endpoint, shell=self.shell)
assert get_file_hash(source_file_path) == get_file_hash(got_file_path)

for node in nodes_to_block:
Expand All @@ -93,9 +95,11 @@ def test_block_storage_node_traffic(self, default_wallet, simple_object_size):
sleep(wakeup_node_timeout)

with allure.step("Check object data is not corrupted"):
new_nodes = wait_object_replication(cid, oid, 2, shell=self.shell, nodes=self.neofs_env.storage_nodes)
new_nodes = wait_object_replication(
cid, oid, 2, shell=self.shell, nodes=self.neofs_env.storage_nodes, neofs_env=self.neofs_env
)

got_file_path = get_object(wallet, cid, oid, shell=self.shell, endpoint=new_nodes[0].endpoint)
got_file_path = get_object(wallet.path, cid, oid, shell=self.shell, endpoint=new_nodes[0].endpoint)
assert get_file_hash(source_file_path) == get_file_hash(got_file_path)

@pytest.mark.sanity
Expand All @@ -118,7 +122,6 @@ def test_rpc_reconnection(self, default_wallet):
"inner_ring_candidate_fee",
"maximum_object_size",
"withdrawal_fee",
"systemdns",
"homomorphic_hashing_disabled",
"maintenance_mode_allowed",
]
Expand All @@ -130,7 +133,7 @@ def test_rpc_reconnection(self, default_wallet):
morph_chain_port = self.neofs_env.inner_ring_nodes[0].rpc_address.split(":")[1]

with allure.step(
f"Disconnecting storage node {storage_node.name} " f"from {morph_chain_addr} {dport_repeat} times"
f"Disconnecting storage node {storage_node} " f"from {morph_chain_addr} {dport_repeat} times"
):
for repeat in range(dport_repeat):
with allure.step(f"Disconnect number {repeat}"):
Expand All @@ -156,8 +159,7 @@ def test_rpc_reconnection(self, default_wallet):
# Delay between shutdown attempts, emulates a real disconnection
sleep(1)
logger.info(
f"Disconnected storage node {storage_node.name} "
f"from {morph_chain_addr} {dport_repeat} times"
f"Disconnected storage node {storage_node} " f"from {morph_chain_addr} {dport_repeat} times"
)

for node in self.neofs_env.storage_nodes:
Expand Down

0 comments on commit c35c203

Please sign in to comment.