test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/TestSuite_mtu_update: add test case to test set mtu 100
@ 2021-02-01  5:50 Zhou Jun
  2021-02-01  5:55 ` Zhou, JunX W
  2021-02-03  6:00 ` Tu, Lijuan
  0 siblings, 2 replies; 3+ messages in thread
From: Zhou Jun @ 2021-02-01  5:50 UTC (permalink / raw)
  To: dts; +Cc: Zhou Jun

tests/TestSuite_mtu_update: add test case to test set mtu 100

Signed-off-by: Zhou Jun <junx.w.zhou@intel.com>
---
 tests/TestSuite_mtu_update.py | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/tests/TestSuite_mtu_update.py b/tests/TestSuite_mtu_update.py
index 4fe697b..239272f 100644
--- a/tests/TestSuite_mtu_update.py
+++ b/tests/TestSuite_mtu_update.py
@@ -55,6 +55,7 @@ from packet import Packet
 from settings import HEADER_SIZE
 
 ETHER_HEADER_LEN = 18
+VLAN=4
 IP_HEADER_LEN = 20
 ETHER_STANDARD_MTU = 1518
 ETHER_JUMBO_FRAME_MTU = 9000
@@ -107,7 +108,8 @@ class TestMtuUpdate(TestCase):
         # The packet total size include ethernet header, ip header, and payload.
         # ethernet header length is 18 bytes, ip standard header length is 20 bytes.
         # pktlen = pktsize - ETHER_HEADER_LEN
-        padding = pktsize - IP_HEADER_LEN
+        max_pktlen = pktsize + ETHER_HEADER_LEN + VLAN * 2
+        padding = max_pktlen - IP_HEADER_LEN - ETHER_HEADER_LEN
         out = self.send_scapy_packet(port_id,
                                      f'Ether(dst=dutmac, src="52:00:00:00:00:00")/IP()/Raw(load="\x50"*{padding})')
         return out
@@ -117,15 +119,15 @@ class TestMtuUpdate(TestCase):
         """
         Send 1 packet to portid
         """
-        tx_pkts_ori, tx_err_ori, _ = [int(_) for _ in self.get_port_status_rx(self.rx_port)]
-        rx_pkts_ori, rx_err_ori, _ = [int(_) for _ in self.get_port_status_tx(self.tx_port)]
+        tx_pkts_ori, tx_err_ori, _ = [int(_) for _ in self.get_port_status_tx(self.tx_port)]
+        rx_pkts_ori, rx_err_ori, _ = [int(_) for _ in self.get_port_status_rx(self.rx_port)]
 
         out = self.send_packet_of_size_to_port(self.rx_port, pktsize)
 
         sleep(5)
 
-        tx_pkts, tx_err, _ = [int(_) for _ in self.get_port_status_rx(self.rx_port)]
-        rx_pkts, rx_err, _ = [int(_) for _ in self.get_port_status_tx(self.tx_port)]
+        tx_pkts, tx_err, _ = [int(_) for _ in self.get_port_status_tx(self.tx_port)]
+        rx_pkts, rx_err, _ = [int(_) for _ in self.get_port_status_rx(self.rx_port)]
 
         tx_pkts_difference = tx_pkts - tx_pkts_ori
         tx_err_difference = tx_err - tx_err_ori
@@ -166,6 +168,7 @@ class TestMtuUpdate(TestCase):
         self.port_mask = utils.create_mask([self.rx_port, self.tx_port])
 
         self.pmdout = PmdOutput(self.dut)
+        self.set_mtu(ETHER_JUMBO_FRAME_MTU + 600)
 
     def set_up(self):
         """
@@ -219,8 +222,6 @@ class TestMtuUpdate(TestCase):
         """
         Sends a packet of the given size into the testing machine.
         """
-        self.set_mtu(packet_size + 1)
-
         if self.kdriver == "mlx5_core" or self.kdriver == "mlx4_core":
         # Mellanox will need extra options to start testpmd
             self.pmdout.start_testpmd("Default", "--max-pkt-len=9500 --tx-offloads=0x8000 --enable-scatter -a")
@@ -237,12 +238,20 @@ class TestMtuUpdate(TestCase):
         self.exec("set fwd mac")
         self.exec("start")
 
+        self.send_packet_of_size_to_tx_port(packet_size - 1, received=True)
         self.send_packet_of_size_to_tx_port(packet_size, received=True)
-        self.send_packet_of_size_to_tx_port(packet_size + 100, received=False)
+        self.send_packet_of_size_to_tx_port(packet_size + 1, received=False)
 
         self.exec("stop")
         self.pmdout.quit()
 
+    def test_mtu_checks_100(self):
+        """
+        Checks that the port responds properly to having it's MTU set to 100 and
+         then being sent packets of size 100 and 101.
+        """
+        self.helper_test_mut_checks(100)
+
     def test_mtu_checks_1500(self):
         """
         Checks that the port responds properly to having it's MTU set to 1500 and
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dts] [PATCH V1] tests/TestSuite_mtu_update: add test case to test set mtu 100
  2021-02-01  5:50 [dts] [PATCH V1] tests/TestSuite_mtu_update: add test case to test set mtu 100 Zhou Jun
@ 2021-02-01  5:55 ` Zhou, JunX W
  2021-02-03  6:00 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Zhou, JunX W @ 2021-02-01  5:55 UTC (permalink / raw)
  To: Zhou, JunX W, dts

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

Tested-by: Zhou, Jun <junx.w.zhou@intel.com>

-----Original Message-----
From: Zhou Jun [mailto:junx.w.zhou@intel.com] 
Sent: Monday, February 1, 2021 1:50 PM
To: dts@dpdk.org
Cc: Zhou, JunX W <junx.w.zhou@intel.com>
Subject: [dts][PATCH V1] tests/TestSuite_mtu_update: add test case to test set mtu 100


[-- Attachment #2: TestMtuUpdate.log --]
[-- Type: application/octet-stream, Size: 126412 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dts] [PATCH V1] tests/TestSuite_mtu_update: add test case to test set mtu 100
  2021-02-01  5:50 [dts] [PATCH V1] tests/TestSuite_mtu_update: add test case to test set mtu 100 Zhou Jun
  2021-02-01  5:55 ` Zhou, JunX W
@ 2021-02-03  6:00 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2021-02-03  6:00 UTC (permalink / raw)
  To: Zhou, JunX W, dts; +Cc: Zhou, JunX W

> tests/TestSuite_mtu_update: add test case to test set mtu 100
> 
> Signed-off-by: Zhou Jun <junx.w.zhou@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-03  6:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01  5:50 [dts] [PATCH V1] tests/TestSuite_mtu_update: add test case to test set mtu 100 Zhou Jun
2021-02-01  5:55 ` Zhou, JunX W
2021-02-03  6:00 ` Tu, Lijuan

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