diff --git a/tobiko/openstack/topology/_topology.py b/tobiko/openstack/topology/_topology.py index 71aaa6ee6..19348a7cc 100644 --- a/tobiko/openstack/topology/_topology.py +++ b/tobiko/openstack/topology/_topology.py @@ -333,6 +333,8 @@ class OpenStackTopology(tobiko.SharedFixture): neutron.SERVER: 'devstack@q-svc', } + background_tests_supported = False + def __init__(self): super(OpenStackTopology, self).__init__() self._names: typing.Dict[str, OpenStackTopologyNode] = ( diff --git a/tobiko/rhosp/_topology.py b/tobiko/rhosp/_topology.py index af4a21c5f..498c21cc1 100644 --- a/tobiko/rhosp/_topology.py +++ b/tobiko/rhosp/_topology.py @@ -59,6 +59,8 @@ class RhospTopology(topology.OpenStackTopology): has_containers = True container_runtime_cmd = 'podman' + background_tests_supported = True + @property def ignore_containers_list(self): return None diff --git a/tobiko/tests/scenario/neutron/test_network.py b/tobiko/tests/scenario/neutron/test_network.py index 5123804d8..d482908a5 100644 --- a/tobiko/tests/scenario/neutron/test_network.py +++ b/tobiko/tests/scenario/neutron/test_network.py @@ -68,6 +68,14 @@ class BackgroundProcessTest(BaseNetworkTest): stack = tobiko.required_fixture(stacks.AdvancedPeerServerStackFixture) + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.topology = topology.get_openstack_topology() + if not cls.topology.background_tests_supported: + tobiko.skip_test( + 'Background tests not supported by this topology class.') + def test_check_background_vm_ping(self): """ Tests that are designed to run in the background , then collect results. @@ -75,7 +83,8 @@ class BackgroundProcessTest(BaseNetworkTest): then execute some check logic i.e. a check function. if the process by name isn't running, start a separate process i.e a background function""" - topology.get_openstack_topology().check_or_start_background_vm_ping( + + self.topology.check_or_start_background_vm_ping( self.stack.peer_stack.floating_ip_address) def test_east_west_tcp_traffic_background_iperf(self): @@ -86,8 +95,7 @@ class BackgroundProcessTest(BaseNetworkTest): Traffic is send in the single flow using "iperf" tool. """ - topology.get_openstack_topology().\ - check_or_start_background_iperf_connection( + self.topology.check_or_start_background_iperf_connection( self.stack.fixed_ipv4, port=5203, protocol='tcp', @@ -102,8 +110,7 @@ class BackgroundProcessTest(BaseNetworkTest): Traffic is send in the single flow using "iperf" tool. """ - topology.get_openstack_topology().\ - check_or_start_background_iperf_connection( + self.topology.check_or_start_background_iperf_connection( self.stack.peer_stack.floating_ip_address, port=5204, protocol='tcp',