test suite reviews and discussions
 help / color / mirror / Atom feed
From: Lingli Chen <linglix.chen@intel.com>
To: dts@dpdk.org
Cc: zhiminx.huang@intel.com, Lingli Chen <linglix.chen@intel.com>
Subject: [dts][PATCH V1 3/5] tests/ddp_gtp: skip igb_uio cases
Date: Thu, 20 Apr 2023 03:05:04 -0400	[thread overview]
Message-ID: <20230420070506.10015-4-linglix.chen@intel.com> (raw)
In-Reply-To: <20230420070506.10015-1-linglix.chen@intel.com>

skip DPDK PF + DPDK VF case, modify dts code to run pf case

Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
 tests/TestSuite_ddp_gtp.py | 63 ++++++++++++++++++++------------------
 1 file changed, 34 insertions(+), 29 deletions(-)

diff --git a/tests/TestSuite_ddp_gtp.py b/tests/TestSuite_ddp_gtp.py
index 22e73318..ba1e4566 100644
--- a/tests/TestSuite_ddp_gtp.py
+++ b/tests/TestSuite_ddp_gtp.py
@@ -11,7 +11,7 @@ import framework.utils as utils
 from framework.pmd_output import PmdOutput
 from framework.qemu_kvm import QEMUKvm
 from framework.settings import get_nic_name
-from framework.test_case import TestCase
+from framework.test_case import TestCase, skip_unsupported_host_driver
 
 VM_CORES_MASK = "all"
 
@@ -48,9 +48,11 @@ class TestDdpGtp(TestCase):
             self.vf_assign_method = "vfio-pci"
             self.dut.send_expect("modprobe vfio-pci", "#")
 
-    def insmod_modprobe(self, modename=""):
+    def setup_vf_env(self, modename=""):
         """
         Insmod modProbe before run test case
+        bind VF0 device to igb_uio driver
+        Start testpmd on host and vm0
         """
         if modename == "igb_uio":
             self.dut.send_expect("modprobe uio", "#", 10)
@@ -63,26 +65,24 @@ class TestDdpGtp(TestCase):
 
             out = self.dut.send_expect("lsmod | grep igb_uio", "#")
             assert "igb_uio" in out, "Failed to insmod igb_uio"
+        self.bind_nic_driver(self.dut_ports, "igb_uio")
+        self.setup_vm_env()
+        self.load_profile()
+        self.vm0_testpmd.start_testpmd(
+            VM_CORES_MASK,
+            "--port-topology=chained --txq=%s --rxq=%s"
+            % (self.VF_QUEUE, self.VF_QUEUE),
+        )
+        self.vm0_testpmd.execute_cmd("set fwd rxonly")
+        self.vm0_testpmd.execute_cmd("set verbose 1")
+        self.vm0_testpmd.execute_cmd("start")
 
     def set_up(self):
         self.dut_testpmd = PmdOutput(self.dut)
         self.used_dut_port = self.dut_ports[0]
         tester_port = self.tester.get_local_port(self.used_dut_port)
         self.tester_intf = self.tester.get_interface(tester_port)
-        if "vf" in self._suite_result.test_case:
-            self.insmod_modprobe("igb_uio")
-            self.bind_nic_driver(self.dut_ports, "igb_uio")
-            self.setup_vm_env()
-            self.load_profile()
-            self.vm0_testpmd.start_testpmd(
-                VM_CORES_MASK,
-                "--port-topology=chained --txq=%s --rxq=%s"
-                % (self.VF_QUEUE, self.VF_QUEUE),
-            )
-            self.vm0_testpmd.execute_cmd("set fwd rxonly")
-            self.vm0_testpmd.execute_cmd("set verbose 1")
-            self.vm0_testpmd.execute_cmd("start")
-        else:
+        if "pf" in self._suite_result.test_case:
             self.load_profile()
 
     def search_queue_number(self, Q_strip):
@@ -443,39 +443,44 @@ class TestDdpGtp(TestCase):
         self.gtp_test(type="clfter", port="pf", tunnel_pkt="gtpu", inner_L3="ipv4")
         self.gtp_test(type="clfter", port="pf", tunnel_pkt="gtpu", inner_L3="ipv6")
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_clfter_gtpc_vf(self):
         """
         GTP is supported by NVM with profile updated. Select cloud filter,
         send gtpc packet to VF, check PF could receive packet using configured
         queue, checksum is good.
         """
+        self.setup_vf_env("igb_uio")
         self.gtp_test(type="clfter", port="vf id 0", tunnel_pkt="gtpc", inner_L3=None)
+        self.destroy_vm_env()
 
+    @skip_unsupported_host_driver(["vfio-pci"])
     def test_clfter_gtpu_vf(self):
         """
         GTP is supported by NVM with profile updated. Select cloud filter,
         send gtpu packet to VF, check PF could receive packet using configured
         queue, checksum is good.
         """
+        self.setup_vf_env("igb_uio")
         self.gtp_test(type="clfter", port="vf id 0", tunnel_pkt="gtpu", inner_L3=None)
         self.gtp_test(type="clfter", port="vf id 0", tunnel_pkt="gtpu", inner_L3="ipv4")
         self.gtp_test(type="clfter", port="vf id 0", tunnel_pkt="gtpu", inner_L3="ipv6")
+        self.destroy_vm_env()
 
     def tear_down(self):
-        if "vf" in self._suite_result.test_case:
-            self.destroy_vm_env()
-        self.dut_testpmd.execute_cmd("stop")
-        out = self.dut_testpmd.execute_cmd("ddp get list 0")
-        if "Profile number is: 0" not in out:
-            self.dut_testpmd.execute_cmd("port stop all")
-            time.sleep(1)
-            self.dut_testpmd.execute_cmd("ddp del 0 /tmp/gtp.bak")
+        if "vf" not in self._suite_result.test_case:
+            self.dut_testpmd.execute_cmd("stop")
             out = self.dut_testpmd.execute_cmd("ddp get list 0")
-            self.verify(
-                "Profile number is: 0" in out, "Failed to delete ddp profile!!!"
-            )
-            self.dut_testpmd.execute_cmd("port start all")
-        self.dut_testpmd.quit()
+            if "Profile number is: 0" not in out:
+                self.dut_testpmd.execute_cmd("port stop all")
+                time.sleep(1)
+                self.dut_testpmd.execute_cmd("ddp del 0 /tmp/gtp.bak")
+                out = self.dut_testpmd.execute_cmd("ddp get list 0")
+                self.verify(
+                    "Profile number is: 0" in out, "Failed to delete ddp profile!!!"
+                )
+                self.dut_testpmd.execute_cmd("port start all")
+            self.dut_testpmd.quit()
 
     def tear_down_all(self):
         if self.env_done:
-- 
2.17.1


  parent reply	other threads:[~2023-04-20  8:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20  7:05 [dts][PATCH V1 0/5] skip DPDK PF as host related cases Lingli Chen
2023-04-20  7:05 ` [dts][PATCH V1 1/5] test_plans/vf_macfilter: change "igb_uio" to "vfio-pci" in kernel pf cases Lingli Chen
2023-04-20  7:05 ` [dts][PATCH V1 2/5] test_plans/ddp_gtp: add note Lingli Chen
2023-04-20  7:05 ` Lingli Chen [this message]
2023-04-20  7:05 ` [dts][PATCH V1 4/5] test_plans/ddp_mpls: " Lingli Chen
2023-04-20  7:05 ` [dts][PATCH V1 5/5] tests/ddp_mpls: skip igb_uio cases Lingli Chen
2023-04-21  2:43   ` Huang, ZhiminX
2023-04-24  1:29   ` Li, WeiyuanX
2023-04-26  3:02   ` lijuan.tu

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=20230420070506.10015-4-linglix.chen@intel.com \
    --to=linglix.chen@intel.com \
    --cc=dts@dpdk.org \
    --cc=zhiminx.huang@intel.com \
    /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).