diff mbox series

[V1] tests/vf_interrupt_pmd: optimize script and increase delay

Message ID 1630653371-221222-1-git-send-email-songx.jiale@intel.com (mailing list archive)
State Superseded
Headers show
Series [V1] tests/vf_interrupt_pmd: optimize script and increase delay | expand

Checks

Context Check Description
ci/Intel-dts-test fail Testing issues

Commit Message

Jiale, SongX Sept. 3, 2021, 7:16 a.m. UTC
Signed-off-by: Jiale Song <songx.jiale@intel.com>
---
 tests/TestSuite_vf_interrupt_pmd.py | 40 ++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
diff mbox series

Patch

diff --git a/tests/TestSuite_vf_interrupt_pmd.py b/tests/TestSuite_vf_interrupt_pmd.py
index 8d68b02..549c262 100644
--- a/tests/TestSuite_vf_interrupt_pmd.py
+++ b/tests/TestSuite_vf_interrupt_pmd.py
@@ -37,8 +37,6 @@  Test vf_interrupt_pmd.
 
 import utils
 import time
-import re
-import pdb
 from virt_common import VM
 from test_case import TestCase
 from packet import Packet
@@ -101,8 +99,9 @@  class TestVfInterruptPmd(TestCase):
         """
         pkt = Packet(pkt_type='UDP')
         pkt.config_layer('ether', {'dst': mac, 'src': self.tester_mac})
+        time.sleep(2)
         pkt.send_pkt(self.tester, tx_port=testinterface)
-        self.out2 = use_dut.get_session_output(timeout=2)
+        return use_dut.get_session_output(timeout=2)
 
     def send_packet_loop(self, mac, testinterface, use_dut, ip_addr):
         """
@@ -111,8 +110,9 @@  class TestVfInterruptPmd(TestCase):
         pkt = Packet(pkt_type='UDP')
         pkt.config_layer('ether', {'dst': mac, 'src': self.tester_mac})
         pkt.config_layer('ipv4', {'dst': '2.1.1.5', 'src': '2.1.1.%s' % ip_addr})
+        time.sleep(2)
         pkt.send_pkt(self.tester, tx_port=testinterface)
-        self.out2 = use_dut.get_session_output(timeout=2)
+        return use_dut.get_session_output(timeout=2)
 
     def set_NIC_link(self):
         """
@@ -237,14 +237,14 @@  class TestVfInterruptPmd(TestCase):
 
         cmd = self.path + "-c %s -n %d -- -P  -p 0x01 --config='(0,0,%s)'" % (core_mask_user, self.vm0_dut.get_memory_channels(), core_user)
         self.vm0_dut.send_expect(cmd, "L3FWD_POWER", 60)
-        self.send_packet(self.vf0_mac, self.rx_intf_0, self.vm0_dut)
+        out = self.send_packet(self.vf0_mac, self.rx_intf_0, self.vm0_dut)
         self.destroy_vm_env()
         self.verify(
             "lcore %s is waked up from rx interrupt on port 0" %
-            core_user in self.out2, "Wake up failed")
+            core_user in out, "Wake up failed")
         self.verify(
             "lcore %s sleeps until interrupt triggers" %
-            core_user in self.out2, "lcore %s not sleeps" % core_user)
+            core_user in out, "lcore %s not sleeps" % core_user)
 
     def test_nic_interrupt_VF_vfio_pci(self, driver='default'):
         """
@@ -262,13 +262,13 @@  class TestVfInterruptPmd(TestCase):
         self.dut.send_expect("ip link set %s vf 0 mac %s" %
                                  (self.host_intf, self.vf_mac), "# ")
         self.begin_l3fwd_power(self.dut)
-        self.send_packet(self.vf_mac, self.rx_intf_0, self.dut)
+        out = self.send_packet(self.vf_mac, self.rx_intf_0, self.dut)
         self.verify(
             "lcore %s is waked up from rx interrupt on port 0" %
-            self.core_user in self.out2,"Wake up failed")
+            self.core_user in out,"Wake up failed")
         self.verify(
             "lcore %s sleeps until interrupt triggers" %
-            self.core_user in self.out2,"lcore %s not sleeps" % self.core_user)
+            self.core_user in out,"lcore %s not sleeps" % self.core_user)
 
     def test_nic_interrupt_PF_vfio_pci(self):
         """
@@ -280,14 +280,14 @@  class TestVfInterruptPmd(TestCase):
 
         self.begin_l3fwd_power(self.dut)
 
-        self.send_packet(self.mac_port_0, self.rx_intf_0, self.dut)
+        out = self.send_packet(self.mac_port_0, self.rx_intf_0, self.dut)
 
         self.verify(
             "lcore %s is waked up from rx interrupt on port 0" %
-            self.core_user in self.out2, "Wake up failed")
+            self.core_user in out, "Wake up failed")
         self.verify(
             "lcore %s sleeps until interrupt triggers" %
-            self.core_user in self.out2, "lcore %s not sleeps" % self.core_user)
+            self.core_user in out, "lcore %s not sleeps" % self.core_user)
 
     def test_nic_interrupt_PF_igb_uio(self):
         """
@@ -299,13 +299,13 @@  class TestVfInterruptPmd(TestCase):
 
         self.begin_l3fwd_power(self.dut)
 
-        self.send_packet(self.mac_port_0, self.rx_intf_0, self.dut)
+        out = self.send_packet(self.mac_port_0, self.rx_intf_0, self.dut)
 
         self.verify(
             "lcore %s is waked up from rx interrupt on port 0" % self.core_user in
-            self.out2, "Wake up failed")
+            out, "Wake up failed")
         self.verify(
-            "lcore %s sleeps until interrupt triggers" % self.core_user in self.out2,
+            "lcore %s sleeps until interrupt triggers" % self.core_user in out,
             "lcore %s not sleeps" % self.core_user)
 
     def test_nic_multi_queues_interrupt_VF_vfio_pci(self, driver='default'):
@@ -328,8 +328,8 @@  class TestVfInterruptPmd(TestCase):
         self.begin_l3fwd_power_multi_queues(self.dut)
         stroutput = ""
         for ip in range(2,10):
-            self.send_packet_loop(self.vf_mac, self.rx_intf_0, self.dut, ip)
-            stroutput = stroutput + self.out2
+            out = self.send_packet_loop(self.vf_mac, self.rx_intf_0, self.dut, ip)
+            stroutput = stroutput + out
         for queue in range(self.queues):
             self.verify(
                 "lcore %d is waked up from rx interrupt on port 0" \
@@ -373,8 +373,8 @@  class TestVfInterruptPmd(TestCase):
                               % str(e))
         stroutput = ""
         for ip in range(2, 10):
-            self.send_packet_loop(self.vf0_mac, self.rx_intf_0, self.vm0_dut, ip)
-            stroutput = stroutput + self.out2
+            out = self.send_packet_loop(self.vf0_mac, self.rx_intf_0, self.vm0_dut, ip)
+            stroutput = stroutput + out
         self.destroy_vm_env()
         for queue in range(self.queues):
             self.verify(