DPDK patches and discussions
 help / color / mirror / Atom feed
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 v2 7/7] dts: save received packets with artifacts
Date: Thu,  4 Sep 2025 12:45:07 +0100	[thread overview]
Message-ID: <20250904114653.199080-8-luca.vizzarro@arm.com> (raw)
In-Reply-To: <20250904114653.199080-1-luca.vizzarro@arm.com>

The CapturingTrafficGenerator class manually creates pcaps to store the
received packets into. Change the behaviour to rely on Artifacts for
this operation.

Signed-off-by: Luca Vizzarro <luca.vizzarro@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
 .../traffic_generator/capturing_traffic_generator.py     | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py b/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py
index a85858ba07..ec0993e6b7 100644
--- a/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py
+++ b/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py
@@ -16,7 +16,7 @@
 import scapy.utils
 from scapy.packet import Packet
 
-from framework.settings import SETTINGS
+from framework.testbed_model.artifact import Artifact
 from framework.testbed_model.port import Port
 from framework.utils import get_packet_summaries
 
@@ -131,6 +131,7 @@ def _send_packets_and_capture(
         """
 
     def _write_capture_from_packets(self, capture_name: str, packets: list[Packet]) -> None:
-        file_name = f"{SETTINGS.output_dir}/{capture_name}.pcap"
-        self._logger.debug(f"Writing packets to {file_name}.")
-        scapy.utils.wrpcap(file_name, packets)
+        artifact = Artifact("local", f"{capture_name}.pcap")
+        self._logger.debug(f"Writing packets to {artifact.local_path}.")
+        with artifact.open("wb") as file:
+            scapy.utils.wrpcap(file, packets)
-- 
2.43.0


  parent reply	other threads:[~2025-09-04 11:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25 15:11 [PATCH 0/6] dts: add file management Luca Vizzarro
2025-07-25 15:11 ` [PATCH 1/6] dts: merge RemoteSession class Luca Vizzarro
2025-08-08  1:15   ` Patrick Robb
2025-07-25 15:11 ` [PATCH 2/6] dts: add node retriever by identifier Luca Vizzarro
2025-08-08 18:10   ` Patrick Robb
2025-07-25 15:11 ` [PATCH 3/6] dts: add current test suite and cases to context Luca Vizzarro
2025-08-08 18:19   ` Patrick Robb
2025-07-25 15:11 ` [PATCH 4/6] dts: add artifact module Luca Vizzarro
2025-08-12  1:25   ` Patrick Robb
2025-08-12  8:31     ` Luca Vizzarro
2025-08-12 13:50       ` Patrick Robb
2025-08-12  3:26   ` Patrick Robb
2025-08-12  8:21     ` Luca Vizzarro
2025-07-25 15:11 ` [PATCH 5/6] dts: make log files into artifacts Luca Vizzarro
2025-08-12  3:10   ` Patrick Robb
2025-07-25 15:11 ` [PATCH 6/6] dts: use artifacts in packet capture and softnic Luca Vizzarro
2025-08-12  3:29   ` Patrick Robb
2025-09-04 11:45 ` [PATCH v2 0/7] dts: add file manager Luca Vizzarro
2025-09-04 11:45   ` [PATCH v2 1/7] dts: merge RemoteSession class Luca Vizzarro
2025-09-04 11:45   ` [PATCH v2 2/7] dts: add node retriever by identifier Luca Vizzarro
2025-09-04 11:45   ` [PATCH v2 3/7] dts: add current test suite and cases to context Luca Vizzarro
2025-09-04 11:45   ` [PATCH v2 4/7] dts: add artifact module Luca Vizzarro
2025-09-04 11:45   ` [PATCH v2 5/7] dts: make log files into artifacts Luca Vizzarro
2025-09-04 21:14     ` Patrick Robb
2025-09-04 11:45   ` [PATCH v2 6/7] dts: use artifacts in packet capture and softnic Luca Vizzarro
2025-09-04 11:45   ` Luca Vizzarro [this message]
2025-09-04 21:16   ` [PATCH v2 0/7] dts: add file manager Patrick Robb

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=20250904114653.199080-8-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).