MCPcopy Create free account
hub / github.com/F-Stack/f-stack / from_dict

Method from_dict

dpdk/dts/framework/config/__init__.py:244–278  ·  view source on GitHub ↗
(
        d: dict, node_map: dict[str, Union[SutNodeConfiguration | TGNodeConfiguration]]
    )

Source from the content-addressed store, hash-verified

242
243 @staticmethod
244 def from_dict(
245 d: dict, node_map: dict[str, Union[SutNodeConfiguration | TGNodeConfiguration]]
246 ) -> "ExecutionConfiguration":
247 build_targets: list[BuildTargetConfiguration] = list(
248 map(BuildTargetConfiguration.from_dict, d["build_targets"])
249 )
250 test_suites: list[TestSuiteConfig] = list(map(TestSuiteConfig.from_dict, d["test_suites"]))
251 sut_name = d["system_under_test_node"]["node_name"]
252 skip_smoke_tests = d.get("skip_smoke_tests", False)
253 assert sut_name in node_map, f"Unknown SUT {sut_name} in execution {d}"
254 system_under_test_node = node_map[sut_name]
255 assert isinstance(
256 system_under_test_node, SutNodeConfiguration
257 ), f"Invalid SUT configuration {system_under_test_node}"
258
259 tg_name = d["traffic_generator_node"]
260 assert tg_name in node_map, f"Unknown TG {tg_name} in execution {d}"
261 traffic_generator_node = node_map[tg_name]
262 assert isinstance(
263 traffic_generator_node, TGNodeConfiguration
264 ), f"Invalid TG configuration {traffic_generator_node}"
265
266 vdevs = (
267 d["system_under_test_node"]["vdevs"] if "vdevs" in d["system_under_test_node"] else []
268 )
269 return ExecutionConfiguration(
270 build_targets=build_targets,
271 perf=d["perf"],
272 func=d["func"],
273 skip_smoke_tests=skip_smoke_tests,
274 test_suites=test_suites,
275 system_under_test_node=system_under_test_node,
276 traffic_generator_node=traffic_generator_node,
277 vdevs=vdevs,
278 )
279
280
281@dataclass(slots=True, frozen=True)

Callers

nothing calls this directly

Calls 2

listClass · 0.50

Tested by

no test coverage detected