[V1] TestSuite_vhost_event_idx_interrupt/kernelpf_iavf: get the app name to kill
diff mbox series

Message ID 20200929092613.17645-1-yux.jiang@intel.com
State Accepted
Headers show
Series
  • [V1] TestSuite_vhost_event_idx_interrupt/kernelpf_iavf: get the app name to kill
Related show

Commit Message

Jiang, YuX Sept. 29, 2020, 9:26 a.m. UTC
From: JiangYu <yux.jiang@intel.com>

Get app name to kill or call from conf/app_name.cfg file

Signed-off-by: JiangYu <yux.jiang@intel.com>
---
 tests/TestSuite_kernelpf_iavf.py             |  5 +++--
 tests/TestSuite_vhost_event_idx_interrupt.py | 10 +++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

Comments

Tu, Lijuan Oct. 12, 2020, 8:54 a.m. UTC | #1
> Get app name to kill or call from conf/app_name.cfg file
> 
> Signed-off-by: JiangYu <yux.jiang@intel.com>

Applied

Patch
diff mbox series

diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py
index 66389a2..c47d0b9 100644
--- a/tests/TestSuite_kernelpf_iavf.py
+++ b/tests/TestSuite_kernelpf_iavf.py
@@ -92,6 +92,7 @@  class TestKernelpfIavf(TestCase):
 
         tester_port1 = self.tester.get_local_port(self.dut_ports[1])
         self.tester_intf1 = self.tester.get_interface(tester_port1)
+        self.l3fwdpower_name = self.dut.apps_name['l3fwd-power'].strip().split('/')[-1]
 
     def set_up(self):
 
@@ -887,7 +888,7 @@  class TestKernelpfIavf(TestCase):
         out = self.dut.get_session_output()
         self.verify('L3FWD_POWER: lcore 6 is waked up from rx interrupt' in out, 'lcore 6 is not waked up')
         self.verify('L3FWD_POWER: lcore 7 is waked up from rx interrupt' in out, 'lcore 7 is not waked up')
-        self.dut.send_expect("killall l3fwd-power", "# ", 60, alt_session=True)
+        self.dut.send_expect("killall %s" % self.l3fwdpower_name, "# ", 60, alt_session=True)
 
     def test_vf_unicast(self):
         self.vm_testpmd.start_testpmd("all")
@@ -979,7 +980,7 @@  class TestKernelpfIavf(TestCase):
         Run after each test case.
         """
         if self.running_case == "test_vf_rx_interrupt":
-            self.dut.send_expect("killall %s" % self.dut.apps_name['l3fwd-power'].strip().split('/')[-1], "# ", 60, alt_session=True)
+            self.dut.send_expect("killall %s" % self.l3fwdpower_name, "# ", 60, alt_session=True)
             self.destroy_2vf_in_2pf()
         else:
             self.vm_testpmd.execute_cmd("quit", "#")
diff --git a/tests/TestSuite_vhost_event_idx_interrupt.py b/tests/TestSuite_vhost_event_idx_interrupt.py
index 9baa626..af3528d 100644
--- a/tests/TestSuite_vhost_event_idx_interrupt.py
+++ b/tests/TestSuite_vhost_event_idx_interrupt.py
@@ -55,7 +55,7 @@  class TestVhostEventIdxInterrupt(TestCase):
         self.pci_info = self.dut.ports_info[0]['pci']
         self.base_dir = self.dut.base_dir.replace('~', '/root')
         self.app_l3fwd_power_path = self.dut.apps_name['l3fwd-power']
-        self.app_name=self.app_l3fwd_power_path.split('/')[-1]
+        self.l3fwdpower_name=self.app_l3fwd_power_path.split('/')[-1]
         self.dut_ports = self.dut.get_ports()
         self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
         self.cbdma_dev_infos=[]
@@ -67,7 +67,7 @@  class TestVhostEventIdxInterrupt(TestCase):
         """
         # Clean the execution ENV
         self.verify_info = []
-        self.dut.send_expect(f"killall {self.app_name}", "#")
+        self.dut.send_expect(f"killall {self.l3fwdpower_name}", "#")
         self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
         self.dut.send_expect("rm -rf %s/vhost-net*" % self.base_dir, "#")
         self.vhost = self.dut.new_session(suite="vhost-l3fwd")
@@ -158,7 +158,7 @@  class TestVhostEventIdxInterrupt(TestCase):
         """
         relauch l3fwd-power sample for port up
         """
-        self.dut.send_expect("killall -s INT l3fwd-power", "#")
+        self.dut.send_expect("killall -s INT %s" % self.l3fwdpower_name, "#")
         # make sure l3fwd-power be killed
         pid = self.dut.send_expect("ps -ef |grep l3|grep -v grep |awk '{print $2}'", "#")
         if pid:
@@ -285,7 +285,7 @@  class TestVhostEventIdxInterrupt(TestCase):
         """
         for i in range(len(self.vm)):
             self.vm[i].stop()
-        self.dut.send_expect("killall l3fwd-power", "#", timeout=2)
+        self.dut.send_expect("killall %s" % self.l3fwdpower_name, "#", timeout=2)
 
     def test_wake_up_split_ring_vhost_user_core_with_event_idx_interrupt(self):
         """
@@ -442,7 +442,7 @@  class TestVhostEventIdxInterrupt(TestCase):
         Run after each test case.
         """
         self.dut.close_session(self.vhost)
-        self.dut.send_expect(f"killall {self.app_name}", "#")
+        self.dut.send_expect(f"killall {self.l3fwdpower_name}", "#")
         self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
         self.bind_cbdma_device_to_kernel()
         self.bind_nic_driver(self.dut_ports, self.drivername)