test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-compatible driver step
@ 2021-03-31  5:13 Ling Wei
  2021-03-31  5:16 ` Ling, WeiX
  2021-04-07  1:22 ` Tu, Lijuan
  0 siblings, 2 replies; 4+ messages in thread
From: Ling Wei @ 2021-03-31  5:13 UTC (permalink / raw)
  To: dts; +Cc: Ling Wei

Add bind dut ports to DPDK-compatible driver method and 
step in tear_down after test_check_threshold_value_with_cbdma
exectue over.

Signed-off-by: Ling Wei <weix.ling@intel.com>
---
 tests/TestSuite_vhost_cbdma.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/TestSuite_vhost_cbdma.py b/tests/TestSuite_vhost_cbdma.py
index 260c534e..5699a7db 100644
--- a/tests/TestSuite_vhost_cbdma.py
+++ b/tests/TestSuite_vhost_cbdma.py
@@ -110,6 +110,22 @@ class TestVirTioVhostCbdma(TestCase):
         self.dut.send_expect("rm -rf /tmp/s0", "#")
         self.mode_list = []
 
+    def bind_nic_driver(self, ports, driver=""):
+        if driver == "igb_uio":
+            for port in ports:
+                netdev = self.dut.ports_info[port]['port']
+                driver = netdev.get_nic_driver()
+                if driver != 'igb_uio':
+                    netdev.bind_driver(driver='igb_uio')
+        else:
+            for port in ports:
+                netdev = self.dut.ports_info[port]['port']
+                driver_now = netdev.get_nic_driver()
+                if driver == "":
+                    driver = netdev.default_driver
+                if driver != driver_now:
+                    netdev.bind_driver(driver=driver)
+
     def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num):
         """
         get all cbdma ports
@@ -533,6 +549,8 @@ class TestVirTioVhostCbdma(TestCase):
         """
         self.dut.send_expect("killall -I %s" % self.testpmd_name, '#', 20)
         self.bind_cbdma_device_to_kernel()
+        if self.running_case == 'test_check_threshold_value_with_cbdma':
+            self.bind_nic_driver(self.dut_ports, self.drivername)
 
     def tear_down_all(self):
         """
-- 
2.25.1


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

end of thread, other threads:[~2021-04-07  1:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31  5:13 [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-compatible driver step Ling Wei
2021-03-31  5:16 ` Ling, WeiX
2021-04-02  7:47   ` Wang, Yinan
2021-04-07  1:22 ` 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).