test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V1 3/6] tests/vswitch_sample_cbdma: fix pcap header issue
@ 2022-04-22  5:48 Wei Ling
  0 siblings, 0 replies; only message in thread
From: Wei Ling @ 2022-04-22  5:48 UTC (permalink / raw)
  To: dts; +Cc: Wei Ling

Fix pcap header issue.

Signed-off-by: Wei Ling <weix.ling@intel.com>
---
 tests/TestSuite_vswitch_sample_cbdma.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tests/TestSuite_vswitch_sample_cbdma.py b/tests/TestSuite_vswitch_sample_cbdma.py
index 503c8ba0..b455790a 100644
--- a/tests/TestSuite_vswitch_sample_cbdma.py
+++ b/tests/TestSuite_vswitch_sample_cbdma.py
@@ -43,7 +43,6 @@ import framework.utils as utils
 from framework.packet import Packet
 from framework.pktgen import PacketGeneratorHelper
 from framework.pmd_output import PmdOutput
-from framework.settings import HEADER_SIZE
 from framework.test_case import TestCase
 from framework.virt_common import VM
 
@@ -96,7 +95,6 @@ class TestVswitchSampleCBDMA(TestCase):
         self.random_string = string.ascii_letters + string.digits
         self.virtio_ip0 = "1.1.1.2"
         self.virtio_ip1 = "1.1.1.3"
-        self.headers_size = HEADER_SIZE["eth"] + HEADER_SIZE["ip"]
 
     def set_up(self):
         """
@@ -350,8 +348,7 @@ class TestVswitchSampleCBDMA(TestCase):
         rx_port = self.tester.get_local_port(self.dut_ports[0])
         tx_port = self.tester.get_local_port(self.dut_ports[0])
         for dst_mac in dst_mac_list:
-            payload_size = frame_size - self.headers_size
-            pkt = Packet(pkt_type="VLAN_UDP", pkt_len=payload_size)
+            pkt = Packet(pkt_type="VLAN_UDP", pkt_len=frame_size)
             pkt.config_layer("ether", {"dst": dst_mac})
             pkt.config_layer("vlan", {"vlan": 1000})
             pcap = os.path.join(
@@ -504,14 +501,13 @@ class TestVswitchSampleCBDMA(TestCase):
         tx_port = self.tester.get_local_port(self.dut_ports[0])
         for dst_mac in dst_mac_list:
             for frame_size in frame_sizes:
-                payload_size = frame_size - self.headers_size
                 pkt = Packet()
                 pkt.assign_layers(["ether", "ipv4", "raw"])
                 pkt.config_layers(
                     [
                         ("ether", {"dst": "%s" % dst_mac}),
                         ("ipv4", {"src": "1.1.1.1"}),
-                        ("raw", {"payload": ["01"] * int("%d" % payload_size)}),
+                        ("raw", {"payload": ["01"] * int("%d" % frame_size)}),
                     ]
                 )
                 pcap = os.path.join(
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-22  5:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-22  5:48 [dts][PATCH V1 3/6] tests/vswitch_sample_cbdma: fix pcap header issue Wei Ling

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).