test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V3 1/4] tests/kernelpf_iavf: update dts code for driver change
@ 2022-07-11  7:22 Weiyuan Li
  2022-07-11  7:22 ` [dts][PATCH V3 2/4] tests/vf_vlan: " Weiyuan Li
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Weiyuan Li @ 2022-07-11  7:22 UTC (permalink / raw)
  To: dts, yuan.peng; +Cc: Weiyuan Li

The out-tree driver has vf-vlan-pruning option,but in-tree driver has not.
So we need different action to enable vlan filter when we validate the vlan filter function with in-tree and out-tree kernel drvier.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---

v2:
-fix format issue
v3:
-modify the code to check whether vf-vlan-pruning option exists.
-modify the description of the test plan about vf-vlan-pruning.

 tests/TestSuite_kernelpf_iavf.py | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py
index d7d17ac4..e06e9267 100644
--- a/tests/TestSuite_kernelpf_iavf.py
+++ b/tests/TestSuite_kernelpf_iavf.py
@@ -96,7 +96,17 @@ class TestKernelpfIavf(TestCase):
         # bind to default driver
         self.bind_nic_driver(self.dut_ports, driver="")
         self.used_dut_port = self.dut_ports[0]
-        if self.is_eth_series_nic(800) and self.default_stats:
+        # check driver whether there is flag vf-vlan-pruning.
+        if not self.default_stats:
+            self.logger.warning(
+                utils.RED(
+                    f"{self.kdriver + '_' + self.driver_version} driver does not have vf-vlan-pruning flag."
+                )
+            )
+        if (
+            any([self.is_eth_series_nic(800), self.kdriver == "i40e"])
+            and self.default_stats
+        ):
             self.dut.send_expect(
                 "ethtool --set-priv-flags %s %s on" % (self.host_intf, self.flag), "# "
             )
@@ -119,7 +129,6 @@ class TestKernelpfIavf(TestCase):
             self.dut.send_expect(
                 "ip link set %s vf 0 mac %s" % (self.host_intf, self.vf_mac), "# "
             )
-
         try:
 
             for port in self.sriov_vfs_port:
@@ -453,7 +462,11 @@ class TestKernelpfIavf(TestCase):
         time.sleep(1)
         tcpdump_out = self.get_tcpdump_package()
         receive_pkt = re.findall("vlan %s" % random_vlan, tcpdump_out)
-        if self.kdriver == "i40e" and self.driver_version < "2.13.10":
+        if (
+            (self.kdriver == "i40e" and self.driver_version < "2.13.10")
+            or (self.kdriver == "i40e" and not self.default_stats)
+            or (self.kdriver == "ice" and not self.default_stats)
+        ):
             self.verify(len(receive_pkt) == 2, "Failed to received vlan packet!!!")
         else:
             self.verify(len(receive_pkt) == 1, "Failed to received vlan packet!!!")
@@ -853,7 +866,11 @@ class TestKernelpfIavf(TestCase):
         self.scapy_send_packet(self.vf_mac, self.tester_intf, vlan_flags=True, count=10)
         out = self.vm_dut.get_session_output()
         packets = len(re.findall("received 1 packets", out))
-        if self.kdriver == "i40e" and self.driver_version < "2.13.10":
+        if (
+            (self.kdriver == "i40e" and self.driver_version < "2.13.10")
+            or (self.kdriver == "i40e" and not self.default_stats)
+            or (self.kdriver == "ice" and not self.default_stats)
+        ):
             self.verify(packets == 10, "Not receive expected packet")
         else:
             self.verify(packets == 0, "Receive expected packet")
@@ -935,7 +952,10 @@ class TestKernelpfIavf(TestCase):
         if self.env_done:
             self.destroy_vm_env()
 
-        if self.is_eth_series_nic(800) and self.default_stats:
+        if (
+            any([self.is_eth_series_nic(800), self.kdriver == "i40e"])
+            and self.default_stats
+        ):
             self.dut.send_expect(
                 "ethtool --set-priv-flags %s %s %s"
                 % (self.host_intf, self.flag, self.default_stats),
-- 
2.27.0


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

end of thread, other threads:[~2022-08-24  8:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-11  7:22 [dts][PATCH V3 1/4] tests/kernelpf_iavf: update dts code for driver change Weiyuan Li
2022-07-11  7:22 ` [dts][PATCH V3 2/4] tests/vf_vlan: " Weiyuan Li
2022-07-11  7:22 ` [dts][PATCH V3 3/4] test_plans/kernelpf_iavf: " Weiyuan Li
2022-07-11  7:22 ` [dts][PATCH V3 4/4] test_plans/vf_vlan: " Weiyuan Li
2022-07-18  9:36   ` Chen, LingliX
2022-08-24  8:26   ` lijuan.tu

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