Add fixture skip test interfaces

Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
Dmitriy Zayakin 2023-10-25 15:56:59 +03:00 committed by Dmitriy Zayakin
parent d986fe2fb6
commit 6749245206
2 changed files with 17 additions and 2 deletions

View file

@ -105,6 +105,19 @@ def require_multiple_hosts(hosting: Hosting):
yield
@pytest.fixture(scope="session")
def require_multiple_interfaces(cluster: Cluster):
"""
We determine that there are the required number of interfaces for tests
If there are no required interfaces, the tests will be skipped.
"""
interfaces = cluster.cluster_nodes[0].host.config.interfaces
if "internal1" not in interfaces or "data1" not in interfaces:
pytest.skip("This test requires multiple internal and data interfaces")
yield
@pytest.fixture(scope="session")
def max_object_size(cluster: Cluster, client_shell: Shell) -> int:
storage_node = cluster.storage_nodes[0]

View file

@ -336,7 +336,7 @@ class TestFailoverNetwork(ClusterTestBase):
self.tick_epochs(1, alive_node=nodes_without_an_object[0].storage_node, wait_block=2)
@pytest.mark.interfaces
@pytest.mark.baremetal
@pytest.mark.failover_baremetal
@pytest.mark.parametrize(
"block_interface, other_interface",
[(Interfaces.DATA_O, Interfaces.DATA_1), (Interfaces.DATA_1, Interfaces.DATA_O)],
@ -344,6 +344,7 @@ class TestFailoverNetwork(ClusterTestBase):
@allure.title("Down data interfaces to all nodes(interface={block_interface})")
def test_down_data_interface(
self,
require_multiple_interfaces,
cluster_state_controller: ClusterStateController,
default_wallet: str,
simple_object_size: ObjectSize,
@ -394,11 +395,12 @@ class TestFailoverNetwork(ClusterTestBase):
self.tick_epochs(1, alive_node=cluster_nodes[0].storage_node, wait_block=2)
@pytest.mark.interfaces
@pytest.mark.baremetal
@pytest.mark.failover_baremetal
@pytest.mark.parametrize("interface", [Interfaces.INTERNAL_0, Interfaces.INTERNAL_1])
@allure.title("Down internal interfaces to all nodes(interface={interface})")
def test_down_internal_interface(
self,
require_multiple_interfaces,
cluster_state_controller: ClusterStateController,
default_wallet: str,
simple_object_size: ObjectSize,