File 0001-dts-generate-random-capture_name-per-call.patch of Package dpdk

From a1601d25a7c05e9b572c5055ffd460f7b902258c Mon Sep 17 00:00:00 2001
From: Clemens Famulla-Conrad <cfamullaconrad@suse.de>
Date: Thu, 5 Jun 2025 16:48:27 +0200
Subject: [PATCH 1/1] dts: generate random capture_name per call
Reference: boo#1244130

Previously, `capture_name` defaulted to a "dynamic" value. This caused
non-deterministic documentation (as reported in
https://bugs.dpdk.org/show_bug.cgi?id=1718) and could lead to
overwriting capture files if the method was called
multiple times within a single Python process.
---
 .../traffic_generator/capturing_traffic_generator.py         | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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 66a77da9c4..c1e4a898d4 100644
--- a/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py
+++ b/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py
@@ -70,7 +70,7 @@ def send_packets_and_capture(
         receive_port: Port,
         filter_config: PacketFilteringConfig,
         duration: float,
-        capture_name: str = _get_default_capture_name(),
+        capture_name: str = None,
     ) -> list[Packet]:
         """Send `packets` and capture received traffic.
 
@@ -104,6 +104,9 @@ def send_packets_and_capture(
             duration,
         )
 
+        if capture_name is None:
+            capture_name = _get_default_capture_name()
+
         self._logger.debug(f"Received packets: {get_packet_summaries(received_packets)}")
         self._write_capture_from_packets(capture_name, received_packets)
         return received_packets
-- 
2.43.0

openSUSE Build Service is sponsored by