On Wed, Aug 21, 2024 at 2:43 PM Nicholas Pratte <npra...@iol.unh.edu> wrote: <snip> > diff --git a/dts/framework/config/__init__.py > b/dts/framework/config/__init__.py > index df60a5030e..534821ed22 100644 > --- a/dts/framework/config/__init__.py > +++ b/dts/framework/config/__init__.py > @@ -151,11 +151,10 @@ class PortConfig: > """ > > node: str > + name: str > pci: str > os_driver_for_dpdk: str > os_driver: str > - peer_node: str > - peer_pci: str > > @classmethod > def from_dict(cls, node: str, d: PortConfigDict) -> Self: > @@ -487,12 +486,19 @@ def from_dict( > system_under_test_node, SutNodeConfiguration > ), f"Invalid SUT configuration {system_under_test_node}" > > - tg_name = d["traffic_generator_node"] > + tg_name = d["traffic_generator_node"]["node_name"] > assert tg_name in node_map, f"Unknown TG {tg_name} in test run {d}" > traffic_generator_node = node_map[tg_name] > assert isinstance( > traffic_generator_node, TGNodeConfiguration > ), f"Invalid TG configuration {traffic_generator_node}" > + assert len(traffic_generator_node.ports) == len( > + system_under_test_node.ports > + ), "Insufficient ports defined on nodes."
Do we want to assert that the list of ports on the tester is the same as the number on the SUT, or would it be better here to assert that the same number of SUT and TG ports are present in the test_run? There could be a case where a TG is the generator for multiple SUT hosts and therefore maybe the TG has 4 ports, but each of the SUT nodes only has 2 which would get flagged as invalid in this assertion. Maybe something better to compare here is the length of d["traffic_generator_node"]["test_bed"] and d["system_under_test_node"]["test_bed"]. > + for port_name in d["system_under_test_node"]["test_bed"]: > + assert port_name in {port.name: port for port in > system_under_test_node.ports} A little nit-picky, but you could achieve the same thing here using a list rather than a dictionary here that might be a little easier to read since we don't need the port info anyway: assert port_name in [port.name for port in system_under_test_node.ports] > + for port_name in d["traffic_generator_node"]["test_bed"]: > + assert port_name in {port.name: port for port in > traffic_generator_node.ports} > > vdevs = ( > d["system_under_test_node"]["vdevs"] if "vdevs" in > d["system_under_test_node"] else [] <snip> > 2.44.0 >