-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Problem
Network infrastructure setup/teardown code (create_network, destroy_network) is duplicated across multiple functional test modules:
tests/functional/sdk/dns/init.py
tests/functional/sdk/vlb/init.py
tests/functional/sdk/nat/v2/test_gateway.py
tests/functional/sdk/dcaas/v2/base.py
Each module has its own copy of essentially the same code for creating network, subnet, router and cleaning them up.
Proposal
Create a shared base class NetworkBaseFunctionalTest in tests/functional/base.py:
class NetworkBaseFunctionalTest(BaseFunctionalTest):
"""Base class for tests requiring network infrastructure."""
def create_network(self, prefix='sdk-test'):
"""Create network, subnet, router and return dict with IDs."""
...
def destroy_network(self, params: dict):
"""Cleanup network infrastructure."""
...
def create_port(self, network_id, prefix='sdk-test'):
"""Create a port in the given network."""
...
def destroy_port(self, port):
"""Delete the given port."""anton-sidelnikov
Metadata
Metadata
Assignees
Labels
No labels