forked from TrueCloudLab/frostfs-testcases
[#175] Update maintenance steps
Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
parent
e14579f026
commit
6ee9b70d50
1 changed files with 24 additions and 29 deletions
|
@ -471,7 +471,7 @@ class TestMaintenanceMode(ClusterTestBase):
|
||||||
netmap = NetmapParser.snapshot_all_nodes(netmap)
|
netmap = NetmapParser.snapshot_all_nodes(netmap)
|
||||||
assert node_under_test.host_ip not in [
|
assert node_under_test.host_ip not in [
|
||||||
netmap_node.node for netmap_node in netmap
|
netmap_node.node for netmap_node in netmap
|
||||||
], f"Node {node_under_test.host_ip} not in state offline"
|
], f"Node {node_under_test.host_ip} not in state offline. netmap - {netmap}"
|
||||||
|
|
||||||
with reporter.step("Restart storage service"):
|
with reporter.step("Restart storage service"):
|
||||||
cluster_state_controller.stop_storage_service(node_under_test)
|
cluster_state_controller.stop_storage_service(node_under_test)
|
||||||
|
@ -484,10 +484,10 @@ class TestMaintenanceMode(ClusterTestBase):
|
||||||
netmap = frostfs_cli.netmap.snapshot(
|
netmap = frostfs_cli.netmap.snapshot(
|
||||||
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
||||||
).stdout
|
).stdout
|
||||||
node_state = NetmapParser.snapshot_one_node(netmap, node_under_test).node_status
|
node = NetmapParser.snapshot_one_node(netmap, node_under_test)
|
||||||
assert node_state == ModeNode.ONLINE.value.upper(), (
|
assert (
|
||||||
f"Node actual state - {node_state}, " f"expect - {ModeNode.ONLINE.value}"
|
node.node_status == ModeNode.ONLINE.value.upper()
|
||||||
)
|
), f"{node_under_test} actual state in netmap - {netmap}"
|
||||||
|
|
||||||
with reporter.step("Tick epoch"):
|
with reporter.step("Tick epoch"):
|
||||||
self.tick_epochs(epochs_to_tick=2, alive_node=cluster_nodes[0].storage_node, wait_block=2)
|
self.tick_epochs(epochs_to_tick=2, alive_node=cluster_nodes[0].storage_node, wait_block=2)
|
||||||
|
@ -507,10 +507,8 @@ class TestMaintenanceMode(ClusterTestBase):
|
||||||
netmap = frostfs_cli.netmap.snapshot(
|
netmap = frostfs_cli.netmap.snapshot(
|
||||||
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
||||||
).stdout
|
).stdout
|
||||||
node_state = NetmapParser.snapshot_one_node(netmap, node_under_test).node_status
|
node = NetmapParser.snapshot_one_node(netmap, node_under_test)
|
||||||
assert node_state == ModeNode.MAINTENANCE.value.upper(), (
|
assert node == ModeNode.MAINTENANCE.value.upper(), f"{node_under_test} actual state in netmap - {netmap}"
|
||||||
f"Node actual state - {node_state}, " f"expect - {ModeNode.MAINTENANCE.value}"
|
|
||||||
)
|
|
||||||
|
|
||||||
with reporter.step("Tick epoch"):
|
with reporter.step("Tick epoch"):
|
||||||
self.tick_epochs(epochs_to_tick=2, alive_node=cluster_nodes[0].storage_node, wait_block=2)
|
self.tick_epochs(epochs_to_tick=2, alive_node=cluster_nodes[0].storage_node, wait_block=2)
|
||||||
|
@ -519,10 +517,10 @@ class TestMaintenanceMode(ClusterTestBase):
|
||||||
netmap = frostfs_cli.netmap.snapshot(
|
netmap = frostfs_cli.netmap.snapshot(
|
||||||
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
||||||
).stdout
|
).stdout
|
||||||
node_state = NetmapParser.snapshot_one_node(netmap, node_under_test).node_status
|
node = NetmapParser.snapshot_one_node(netmap, node_under_test)
|
||||||
assert node_state == ModeNode.OFFLINE.value.upper(), (
|
assert (
|
||||||
f"Node actual state - {node_state}, " f"expect - {ModeNode.OFFLINE.value}"
|
node.node_status == ModeNode.OFFLINE.value.upper()
|
||||||
)
|
), f"{node_under_test} actual state in netmap - {netmap}"
|
||||||
|
|
||||||
with reporter.step("Stop storage service"):
|
with reporter.step("Stop storage service"):
|
||||||
cluster_state_controller.stop_storage_service(node_under_test)
|
cluster_state_controller.stop_storage_service(node_under_test)
|
||||||
|
@ -537,10 +535,8 @@ class TestMaintenanceMode(ClusterTestBase):
|
||||||
netmap = frostfs_cli.netmap.snapshot(
|
netmap = frostfs_cli.netmap.snapshot(
|
||||||
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
||||||
).stdout
|
).stdout
|
||||||
node_state = NetmapParser.snapshot_one_node(netmap, node_under_test).node_status
|
node = NetmapParser.snapshot_one_node(netmap, node_under_test)
|
||||||
assert node_state == ModeNode.OFFLINE.value.upper(), (
|
assert node == ModeNode.OFFLINE.value.upper(), f"{node_under_test} actual state in netmap - {netmap}"
|
||||||
f"Node actual state - {node_state}, " f"expect - {ModeNode.OFFLINE.value}"
|
|
||||||
)
|
|
||||||
|
|
||||||
with reporter.step("Tick epoch"):
|
with reporter.step("Tick epoch"):
|
||||||
self.tick_epochs(epochs_to_tick=2, alive_node=cluster_nodes[0].storage_node, wait_block=2)
|
self.tick_epochs(epochs_to_tick=2, alive_node=cluster_nodes[0].storage_node, wait_block=2)
|
||||||
|
@ -549,10 +545,10 @@ class TestMaintenanceMode(ClusterTestBase):
|
||||||
netmap = frostfs_cli.netmap.snapshot(
|
netmap = frostfs_cli.netmap.snapshot(
|
||||||
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
||||||
).stdout
|
).stdout
|
||||||
node_state = NetmapParser.snapshot_one_node(netmap, node_under_test).node_status
|
node = NetmapParser.snapshot_one_node(netmap, node_under_test)
|
||||||
assert node_state == ModeNode.ONLINE.value.upper(), (
|
assert (
|
||||||
f"Node actual state - {node_state}, " f"expect - {ModeNode.ONLINE.value}"
|
node.node_status == ModeNode.ONLINE.value.upper()
|
||||||
)
|
), f"{node_under_test} actual state in netmap - {netmap}"
|
||||||
|
|
||||||
with reporter.step("Tick epoch"):
|
with reporter.step("Tick epoch"):
|
||||||
self.tick_epochs(epochs_to_tick=2, alive_node=cluster_nodes[0].storage_node, wait_block=2)
|
self.tick_epochs(epochs_to_tick=2, alive_node=cluster_nodes[0].storage_node, wait_block=2)
|
||||||
|
@ -575,11 +571,10 @@ class TestMaintenanceMode(ClusterTestBase):
|
||||||
netmap = frostfs_cli.netmap.snapshot(
|
netmap = frostfs_cli.netmap.snapshot(
|
||||||
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
||||||
).stdout
|
).stdout
|
||||||
node_state = NetmapParser.snapshot_one_node(netmap, node_under_test).node_status
|
node = NetmapParser.snapshot_one_node(netmap, node_under_test)
|
||||||
|
|
||||||
assert (
|
assert (
|
||||||
node_state == ModeNode.MAINTENANCE.value.upper()
|
node.node_status == ModeNode.MAINTENANCE.value.upper()
|
||||||
), f"Node actual state - {node_state}, expect - {ModeNode.MAINTENANCE.value}"
|
), f"{node_under_test} actual state in netmap - {netmap}"
|
||||||
|
|
||||||
with reporter.step("Tick epoch"):
|
with reporter.step("Tick epoch"):
|
||||||
self.tick_epochs(epochs_to_tick=2, alive_node=cluster_nodes[0].storage_node, wait_block=2)
|
self.tick_epochs(epochs_to_tick=2, alive_node=cluster_nodes[0].storage_node, wait_block=2)
|
||||||
|
@ -588,10 +583,10 @@ class TestMaintenanceMode(ClusterTestBase):
|
||||||
netmap = frostfs_cli.netmap.snapshot(
|
netmap = frostfs_cli.netmap.snapshot(
|
||||||
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
rpc_endpoint=cluster_nodes[0].storage_node.get_rpc_endpoint(), wallet=default_wallet
|
||||||
).stdout
|
).stdout
|
||||||
node_state = NetmapParser.snapshot_one_node(netmap, node_under_test).node_status
|
node = NetmapParser.snapshot_one_node(netmap, node_under_test)
|
||||||
assert node_state == ModeNode.MAINTENANCE.value.upper(), (
|
assert (
|
||||||
f"Node actual state - {node_state}, " f"expect - {ModeNode.MAINTENANCE.value}"
|
node.node_status == ModeNode.MAINTENANCE.value.upper()
|
||||||
)
|
), f"{node_under_test} actual state in netmap - {netmap}"
|
||||||
|
|
||||||
@allure.title("A node cannot go into maintenance if maintenance is prohibited globally in the network")
|
@allure.title("A node cannot go into maintenance if maintenance is prohibited globally in the network")
|
||||||
def test_maintenance_globally_forbidden(
|
def test_maintenance_globally_forbidden(
|
||||||
|
|
Loading…
Reference in a new issue