topology - Testbed Topology
Testbed topology representation.
A topology of a testbed captures what links are available between the testbed’s nodes. The link information then implies what type of topology is available.
- class TopologyType
Bases:
int
,Enum
Supported topology types.
- no_link = 0
A topology with no Traffic Generator.
- one_link = 1
A topology with one physical link between the SUT node and the TG node.
- two_links = 2
A topology with two physical links between the Sut node and the TG node.
- classmethod default() TopologyType
The default topology required by test cases if not specified otherwise.
- __new__(value)
- class PortLink
Bases:
NamedTuple
The physical, cabled connection between the ports.
- sut_port: Port
The port on the SUT node connected to tg_port.
- tg_port: Port
The port on the TG node connected to sut_port.
- class Topology
Bases:
object
Testbed topology.
The topology contains ports processed into ingress and egress ports. If there are no ports on a node, accesses to
tg_port_egress
and alike will raise an exception. If there is only one link available, the ports of this link are stored as both ingress and egress ports.It’s up to
TestRun
to ensure no test case or suite requiring actual links is executed when the topology prohibits it and up to the developers to make sure that test cases not requiring any links don’t use any ports. Otherwise, the underlying methods using the ports will fail.- type
The type of the topology.
- sut_ports
The SUT ports.
- Type:
- tg_ports
The TG ports.
- Type:
- classmethod from_port_links(port_links: Iterator[PortLink]) typing_extensions.Self
Create the topology from port_links.
- Parameters:
port_links (Iterator[PortLink]) – The test run’s required port links.
- Raises:
ConfigurationError – If an unsupported link topology is supplied.
- property tg_port_egress: Port
The egress port of the TG node.
- property sut_port_ingress: Port
The ingress port of the SUT node.
- property sut_port_egress: Port
The egress port of the SUT node.
- property tg_port_ingress: Port
The ingress port of the TG node.
- __init__(type: TopologyType, sut_ports: list[framework.testbed_model.port.Port], tg_ports: list[framework.testbed_model.port.Port]) None