test suite reviews and discussions
 help / color / mirror / Atom feed
From: lihong <lihongx.ma@intel.com>
To: dts@dpdk.org
Cc: zhaoyan.chen@intel.com, lihong <lihongx.ma@intel.com>
Subject: [dts] [PATCH V1 7/7] tests: replace the hard code app path with the configured app path
Date: Tue,  7 Jul 2020 10:45:03 +0800	[thread overview]
Message-ID: <1594089903-26285-8-git-send-email-lihongx.ma@intel.com> (raw)
In-Reply-To: <1594089903-26285-1-git-send-email-lihongx.ma@intel.com>

Signed-off-by: lihong <lihongx.ma@intel.com>
---
 tests/TestSuite_multiprocess.py           | 53 +++++++++++++++++++------------
 tests/TestSuite_vhost_multi_queue_qemu.py | 14 ++++----
 2 files changed, 40 insertions(+), 27 deletions(-)

diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
index 0ede8bf..5a99ee3 100644
--- a/tests/TestSuite_multiprocess.py
+++ b/tests/TestSuite_multiprocess.py
@@ -61,8 +61,20 @@ class TestMultiprocess(TestCase):
         self.tester.extend_external_packet_generator(TestMultiprocess, self)
         self.dut_ports = self.dut.get_ports()
         self.socket = self.dut.get_numa_id(self.dut_ports[0])
-        out = self.dut.build_dpdk_apps("./examples/multi_process/")
-        self.verify('Error' not in out, "Compilation failed")
+
+        out = self.dut.build_dpdk_apps("./examples/multi_process/client_server_mp/mp_client")
+        self.verify('Error' not in out, "Compilation mp_client failed")
+        out = self.dut.build_dpdk_apps("./examples/multi_process/client_server_mp/mp_server")
+        self.verify('Error' not in out, "Compilation mp_server failed")
+        out = self.dut.build_dpdk_apps("./examples/multi_process/simple_mp")
+        self.verify('Error' not in out, "Compilation simple_mp failed")
+        out = self.dut.build_dpdk_apps("./examples/multi_process/symmetric_mp")
+        self.verify('Error' not in out, "Compilation symmetric_mp failed")
+
+        self.app_mp_client = self.dut.apps_name['mp_client']
+        self.app_mp_server = self.dut.apps_name['mp_server']
+        self.app_simple_mp = self.dut.apps_name['simple_mp']
+        self.app_symmetric_mp = self.dut.apps_name['symmetric_mp']
 
         executions.append({'nprocs': 1, 'cores': '1S/1C/1T', 'pps': 0})
         executions.append({'nprocs': 2, 'cores': '1S/1C/2T', 'pps': 0})
@@ -74,6 +86,7 @@ class TestMultiprocess(TestCase):
         self.eal_param = ""
         for i in self.dut_ports:
             self.eal_param += " -w %s" % self.dut.ports_info[i]['pci']
+
         # start new session to run secondary
         self.session_secondary = self.dut.new_session()
 
@@ -100,12 +113,12 @@ class TestMultiprocess(TestCase):
         # Send message from secondary to primary
         cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
         coremask = utils.create_mask(cores)
-        self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=primary" % (self.target, coremask, self.eal_param),
+        self.dut.send_expect(self.app_simple_mp + " -n 1 -c %s --proc-type=primary" % (coremask),
                              "Finished Process Init", 100)
         time.sleep(20)
         coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
         self.session_secondary.send_expect(
-            "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=secondary" % (self.target, coremask, self.eal_param), "Finished Process Init",
+            self.app_simple_mp + " -n 1 -c %s --proc-type=secondary" % (coremask), "Finished Process Init",
             100)
 
         self.session_secondary.send_expect("send hello_primary", ">")
@@ -117,10 +130,10 @@ class TestMultiprocess(TestCase):
         cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
         coremask = utils.create_mask(cores)
         self.session_secondary.send_expect(
-            "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=primary " % (self.target, coremask, self.eal_param), "Finished Process Init", 100)
+            self.app_simple_mp + " -n 1 -c %s --proc-type=primary " % (coremask), "Finished Process Init", 100)
         time.sleep(20)
         coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
-        self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=secondary" % (self.target, coremask, self.eal_param),
+        self.dut.send_expect(self.app_simple_mp + " -n 1 -c %s --proc-type=secondary" % (coremask),
                              "Finished Process Init", 100)
         self.session_secondary.send_expect("send hello_secondary", ">")
         out = self.dut.get_session_output()
@@ -137,11 +150,11 @@ class TestMultiprocess(TestCase):
 
         cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
         coremask = utils.create_mask(cores)
-        self.session_secondary.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=primary" % (self.target, coremask, self.eal_param),
+        self.session_secondary.send_expect(self.app_simple_mp + " -n 1 -c %s --proc-type=primary" % (coremask),
                                            "Finished Process Init", 100)
         time.sleep(20)
         coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
-        self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=secondary" % (self.target, coremask, self.eal_param),
+        self.dut.send_expect(self.app_simple_mp + " -n 1 -c %s --proc-type=secondary" % (coremask),
                              "Finished Process Init", 100)
         stringsSent = 0
         for line in open('/usr/share/dict/words', 'r').readlines():
@@ -163,13 +176,13 @@ class TestMultiprocess(TestCase):
         # Send message from secondary to primary (auto process type)
         cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
         coremask = utils.create_mask(cores)
-        out = self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=auto " % (self.target, coremask, self.eal_param),
+        out = self.dut.send_expect(self.app_simple_mp + " -n 1 -c %s --proc-type=auto " % (coremask),
                                    "Finished Process Init", 100)
         self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly")
         time.sleep(20)
         coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
         out = self.session_secondary.send_expect(
-            "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=auto" % (self.target, coremask, self.eal_param), "Finished Process Init", 100)
+            self.app_simple_mp + " -n 1 -c %s --proc-type=auto" % (coremask), "Finished Process Init", 100)
         self.verify("EAL: Auto-detected process type: SECONDARY" in out,
                     "The type of process (SECONDARY) was not detected properly")
 
@@ -183,11 +196,11 @@ class TestMultiprocess(TestCase):
         cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
         coremask = utils.create_mask(cores)
         out = self.session_secondary.send_expect(
-            "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=auto" % (self.target, coremask, self.eal_param), "Finished Process Init", 100)
+            self.app_simple_mp + " -n 1 -c %s --proc-type=auto" % (coremask), "Finished Process Init", 100)
         self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly")
         time.sleep(20)
         coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
-        out = self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=auto" % (self.target, coremask, self.eal_param),
+        out = self.dut.send_expect(self.app_simple_mp + " -n 1 -c %s --proc-type=auto" % (coremask),
                                    "Finished Process Init", 100)
         self.verify("EAL: Auto-detected process type: SECONDARY" in out, "The type of process (SECONDARY) was not detected properly")
         self.session_secondary.send_expect("send hello_secondary", ">", 100)
@@ -205,10 +218,10 @@ class TestMultiprocess(TestCase):
 
         cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
         coremask = utils.create_mask(cores)
-        self.session_secondary.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s -m 64" % (self.target, coremask, self.eal_param),
+        self.session_secondary.send_expect(self.app_simple_mp + " -n 1 -c %s -m 64" % (coremask),
                                            "Finished Process Init", 100)
         coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
-        out = self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s" % (self.target, coremask, self.eal_param), "# ", 100)
+        out = self.dut.send_expect(self.app_simple_mp + " -n 1 -c %s" % (coremask), "# ", 100)
 
         self.verify("Is another primary process running" in out,
                     "No other primary process detected")
@@ -248,8 +261,8 @@ class TestMultiprocess(TestCase):
             execution = validExecutions[n]
             coreMask = utils.create_mask(self.dut.get_core_list(execution['cores'], socket=self.socket))
             self.session_secondary.send_expect(
-                "./examples/multi_process/symmetric_mp/%s/symmetric_mp -c %s %s --proc-type=auto -- -p %s --num-procs=%d --proc-id=%d" % (
-                    self.target, coreMask, self.eal_param, portMask, execution['nprocs'], n), "Finished Process Init")
+                self.app_symmetric_mp + " -c %s --proc-type=auto -- -p %s --num-procs=%d --proc-id=%d" % (
+                    coreMask, portMask, execution['nprocs'], n), "Finished Process Init")
 
             # clear streams before add new streams
             self.tester.pktgen.clear_streams()
@@ -301,16 +314,16 @@ class TestMultiprocess(TestCase):
 
             coreMask = utils.create_mask(self.dut.get_core_list('1S/1C/1T'))
             portMask = utils.create_mask(self.dut_ports)
-            self.dut.send_expect("./examples/multi_process/client_server_mp/mp_server/%s/mp_server -n %d -c %s %s -- -p %s -n %d" % (
-                self.target, self.dut.get_memory_channels(), "0xA0", self.eal_param, portMask, execution['nprocs']), "Finished Process Init", 20)
+            self.dut.send_expect(self.app_mp_server + " -n %d -c %s -- -p %s -n %d" % (
+                self.dut.get_memory_channels(), "0xA0", portMask, execution['nprocs']), "Finished Process Init", 20)
             self.dut.send_expect("^Z", "\r\n")
             self.dut.send_expect("bg", "# ")
 
             for n in range(execution['nprocs']):
                 time.sleep(5)
                 coreMask = utils.create_mask([coreList[n]])
-                self.dut.send_expect("./examples/multi_process/client_server_mp/mp_client/%s/mp_client -n %d -c %s %s --proc-type=secondary -- -n %d" % (
-                    self.target, self.dut.get_memory_channels(), coreMask, self.eal_param, n), "Finished Process Init")
+                self.dut.send_expect(self.app_mp_client + " -n %d -c %s --proc-type=secondary -- -n %d" % (
+                    self.dut.get_memory_channels(), coreMask, n), "Finished Process Init")
                 self.dut.send_expect("^Z", "\r\n")
                 self.dut.send_expect("bg", "# ")
 
diff --git a/tests/TestSuite_vhost_multi_queue_qemu.py b/tests/TestSuite_vhost_multi_queue_qemu.py
index 88524d0..01d5826 100644
--- a/tests/TestSuite_vhost_multi_queue_qemu.py
+++ b/tests/TestSuite_vhost_multi_queue_qemu.py
@@ -79,6 +79,8 @@ class TestVhostMultiQueueQemu(TestCase):
         # create an instance to set stream field setting
         self.pktgen_helper = PacketGeneratorHelper()
         self.base_dir = self.dut.base_dir.replace('~', '/root')
+        self.app_path = self.dut.apps_name['test-pmd']
+        self.app_name = self.app_path[self.app_path.rfind('/')+1:]
 
     def set_up(self):
         """
@@ -86,8 +88,8 @@ class TestVhostMultiQueueQemu(TestCase):
         """
         self.dut.send_expect("rm -rf ./vhost.out", "#")
         self.dut.send_expect("rm -rf %s/vhost-net*" % self.base_dir, "#")
-        self.dut.send_expect("killall -s INT testpmd", "#")
-        self.vm_testpmd_vector = self.target + "/app/testpmd -c %s -n 3" + \
+        self.dut.send_expect("killall -s INT %s" % self.app_name, "#")
+        self.vm_testpmd_vector = self.app_path + "-c %s -n 3" + \
                                  " -- -i --tx-offloads=0x0 " + \
                                  " --rxq=%d --txq=%d --rss-ip --nb-cores=2" % (self.queue_number, self.queue_number)
 
@@ -95,11 +97,10 @@ class TestVhostMultiQueueQemu(TestCase):
         """
         Launch the vhost sample with different parameters
         """
-        testcmd = self.target + "/app/testpmd "
         vdev = [r"'net_vhost0,iface=%s/vhost-net,queues=%d'" % (self.base_dir, self.queue_number)]
         eal_params = self.dut.create_eal_parameters(cores=self.cores, ports=[self.pci_info], vdevs=vdev)
         para = " -- -i --rxq=%d --txq=%d --nb-cores=2" % (self.queue_number, self.queue_number)
-        testcmd_start = testcmd + eal_params + para
+        testcmd_start = self.app_path + eal_params + para
         self.dut.send_expect(testcmd_start, "testpmd> ", 120)
         self.dut.send_expect("set fwd mac", "testpmd> ", 120)
         self.dut.send_expect("start", "testpmd> ", 120)
@@ -257,7 +258,7 @@ class TestVhostMultiQueueQemu(TestCase):
         """
         self.launch_testpmd()
         self.start_onevm()
-        self.vm_testpmd_queue_1 = self.target + "/app/testpmd -c %s -n 3" + \
+        self.vm_testpmd_queue_1 = self.app_path + "-c %s -n 3" + \
                                   " -- -i --tx-offloads=0x0 " + \
                                   " --rxq=1 --txq=1 --rss-ip --nb-cores=1"
         self.get_vm_coremask()
@@ -294,11 +295,10 @@ class TestVhostMultiQueueQemu(TestCase):
         Test the performance for change vhost queue size
         """
         self.queue_number = 2
-        testcmd = self.target + "/app/testpmd "
         vdev = [r"'net_vhost0,iface=%s/vhost-net,queues=2'" % self.base_dir]
         eal_params = self.dut.create_eal_parameters(cores=self.cores, ports=[self.pci_info], vdevs=vdev)
         para = " -- -i --rxq=1 --txq=1 --nb-cores=1"
-        testcmd_start = testcmd + eal_params + para
+        testcmd_start = self.app_path + eal_params + para
         self.dut.send_expect(testcmd_start, "testpmd> ", 120)
         self.dut.send_expect("set fwd mac", "testpmd> ", 120)
         self.dut.send_expect("start", "testpmd> ", 120)
-- 
2.7.4


  parent reply	other threads:[~2020-07-07 10:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07  2:44 [dts] [PATCH V1 0/7] meson build reference lihong
2020-07-07  2:44 ` [dts] [PATCH V1 1/7] executions: add build_type field in all executions cfg lihong
2020-07-07  2:44 ` [dts] [PATCH V1 2/7] conf: add configuration file of app_name.cfg lihong
2020-07-07  2:44 ` [dts] [PATCH V1 3/7] framework/config: get configuration information from app_name.cfg lihong
2020-07-07  2:45 ` [dts] [PATCH V1 4/7] framework: read and save the build_type from execution.cfg lihong
2020-07-07  2:45 ` [dts] [PATCH V1 5/7] framework: add meson build method and get apps name of current build type lihong
2020-07-07  2:45 ` [dts] [PATCH V1 6/7] framework/pmd_output: replace the hard code app path with the configured app path lihong
2020-07-07  2:45 ` lihong [this message]
2020-07-07 10:20 ` [dts] [PATCH V1 0/7] meson build reference Xiao, QimaiX
2020-07-20  7:08 ` Tu, Lijuan

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=1594089903-26285-8-git-send-email-lihongx.ma@intel.com \
    --to=lihongx.ma@intel.com \
    --cc=dts@dpdk.org \
    --cc=zhaoyan.chen@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).