From: Luca Vizzarro <luca.vizzarro@arm.com>
To: dev@dpdk.org
Cc: Luca Vizzarro <luca.vizzarro@arm.com>,
Paul Szczepanek <paul.szczepanek@arm.com>,
Patrick Robb <probb@iol.unh.edu>
Subject: [PATCH] dts: add TG setup and teardown
Date: Tue, 25 Feb 2025 10:22:22 +0000 [thread overview]
Message-ID: <20250225102222.345716-1-luca.vizzarro@arm.com> (raw)
Add traffic generator setup and teardown respectively in
TestRunSetup and TestRunTeardown.
Signed-off-by: Luca Vizzarro <luca.vizzarro@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
dts/framework/test_run.py | 2 ++
.../testbed_model/traffic_generator/traffic_generator.py | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dts/framework/test_run.py b/dts/framework/test_run.py
index 9f37c4bb6c..2808d013f6 100644
--- a/dts/framework/test_run.py
+++ b/dts/framework/test_run.py
@@ -334,6 +334,7 @@ def next(self) -> State | None:
test_run.remaining_tests = deque(test_run.selected_tests)
test_run.ctx.dpdk.setup(test_run.ctx.topology.sut_ports)
+ test_run.ctx.tg.setup(test_run.ctx.topology.tg_ports)
self.result.ports = test_run.ctx.topology.sut_ports + test_run.ctx.topology.tg_ports
self.result.sut_info = test_run.ctx.sut_node.node_info
@@ -416,6 +417,7 @@ def description(self) -> str:
def next(self) -> State | None:
"""Next state."""
+ self.test_run.ctx.tg.teardown(self.test_run.ctx.topology.tg_ports)
self.test_run.ctx.dpdk.teardown(self.test_run.ctx.topology.sut_ports)
self.result.update_teardown(Result.PASS)
return None
diff --git a/dts/framework/testbed_model/traffic_generator/traffic_generator.py b/dts/framework/testbed_model/traffic_generator/traffic_generator.py
index 4469273e36..804662e114 100644
--- a/dts/framework/testbed_model/traffic_generator/traffic_generator.py
+++ b/dts/framework/testbed_model/traffic_generator/traffic_generator.py
@@ -53,7 +53,7 @@ def __init__(self, tg_node: Node, config: TrafficGeneratorConfig, **kwargs):
def setup(self, ports: Iterable[Port]):
"""Setup the traffic generator."""
- def teardown(self):
+ def teardown(self, ports: Iterable[Port]):
"""Teardown the traffic generator."""
def send_packet(self, packet: Packet, port: Port) -> None:
--
2.43.0
reply other threads:[~2025-02-25 10:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250225102222.345716-1-luca.vizzarro@arm.com \
--to=luca.vizzarro@arm.com \
--cc=dev@dpdk.org \
--cc=paul.szczepanek@arm.com \
--cc=probb@iol.unh.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).