test suite reviews and discussions
 help / color / mirror / Atom feed
From: LihongX Ma <lihongx.ma@intel.com>
To: dts@dpdk.org
Cc: LihongX Ma <lihongx.ma@intel.com>
Subject: [dts] [PATCH V1] tests/dpdk_hugetlbfs_mount_size: get the app path from config instead of hard code
Date: Thu, 22 Oct 2020 01:36:19 +0800	[thread overview]
Message-ID: <1603301779-28431-1-git-send-email-lihongx.ma@intel.com> (raw)

modify suite to get the path of testpmd from conf file

Signed-off-by: LihongX Ma <lihongx.ma@intel.com>
---
 tests/TestSuite_dpdk_hugetlbfs_mount_size.py | 37 ++++++++++++++--------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/tests/TestSuite_dpdk_hugetlbfs_mount_size.py b/tests/TestSuite_dpdk_hugetlbfs_mount_size.py
index de52323..25c4ed2 100644
--- a/tests/TestSuite_dpdk_hugetlbfs_mount_size.py
+++ b/tests/TestSuite_dpdk_hugetlbfs_mount_size.py
@@ -70,6 +70,7 @@ class DpdkHugetlbfsMountSize(TestCase):
             self.socket_mem = "0,1024"
             self.socket_mem2 = "0,2048"
         self.umount_huge([DEFAULT_MNT])
+        self.app_path = self.dut.apps_name['test-pmd']
 
 
     def set_up(self):
@@ -115,8 +116,8 @@ class DpdkHugetlbfsMountSize(TestCase):
         # Bind one nic port to igb_uio driver, launch testpmd
         self.dut.send_expect("mount -t hugetlbfs hugetlbfs %s" % MNT_PATH[0], "#", 15)
         self.logger.info("test default hugepage size start testpmd without numa")
-        ttd = './%s/app/testpmd -l %s -n %d --huge-dir %s --file-prefix=%s -w %s -- -i'
-        launch_ttd = ttd % (self.target, self.core_list1, self.mem_channels, MNT_PATH[0], vhost_name[0], self.pci_info_0)
+        ttd = '%s -l %s -n %d --huge-dir %s --file-prefix=%s -w %s -- -i'
+        launch_ttd = ttd % (self.app_path, self.core_list1, self.mem_channels, MNT_PATH[0], vhost_name[0], self.pci_info_0)
         self.dut.send_expect(launch_ttd, "testpmd> ", 120)
         self.dut.send_expect("set promisc all off", "testpmd> ", 120)
         self.dut.send_expect("start", "testpmd> ", 120)
@@ -127,8 +128,8 @@ class DpdkHugetlbfsMountSize(TestCase):
 
         # resart testpmd with numa support
         self.logger.info("test default hugepage size start testpmd with numa")
-        ttd_secondary = './%s/app/testpmd -l %s -n %d --huge-dir %s --file-prefix=%s -w %s -- -i --numa'
-        launch_ttd_secondary = ttd_secondary % (self.target, self.core_list1, self.mem_channels, MNT_PATH[0], vhost_name[0], self.pci_info_0)
+        ttd_secondary = '%s -l %s -n %d --huge-dir %s --file-prefix=%s -w %s -- -i --numa'
+        launch_ttd_secondary = ttd_secondary % (self.app_path, self.core_list1, self.mem_channels, MNT_PATH[0], vhost_name[0], self.pci_info_0)
         self.dut.send_expect(launch_ttd_secondary, "testpmd> ", 120)
         self.dut.send_expect("set promisc all off", "testpmd> ", 120)
         self.dut.send_expect("start", "testpmd> ", 120)
@@ -146,18 +147,18 @@ class DpdkHugetlbfsMountSize(TestCase):
         self.dut.send_expect("mount -t hugetlbfs -o size=4G hugetlbfs %s" % MNT_PATH[1], "#", 15)
 
         self.logger.info("start first testpmd")
-        ttd = 'numactl --membind=%d ./%s/app/testpmd -l %s -n %d --legacy-mem --socket-mem %s' \
+        ttd = 'numactl --membind=%d %s -l %s -n %d --legacy-mem --socket-mem %s' \
                   ' --huge-dir %s --file-prefix=%s -w %s -- -i --socket-num=%d --no-numa'
-        launch_ttd = ttd % (self.numa_id, self.target, self.core_list1, self.mem_channels, self.socket_mem2, MNT_PATH[0], vhost_name[0], self.pci_info_0, self.numa_id)
+        launch_ttd = ttd % (self.numa_id, self.app_path, self.core_list1, self.mem_channels, self.socket_mem2, MNT_PATH[0], vhost_name[0], self.pci_info_0, self.numa_id)
         self.session_first.send_expect(launch_ttd, "testpmd> ", 120)
         self.session_first.send_expect("set promisc all off", "testpmd> ", 120)
         self.session_first.send_expect("start", "testpmd> ", 120)
         self.session_first.send_expect("clear port stats all", "testpmd> ", 120)
 
         self.logger.info("start secondary testpmd")
-        ttd_secondary = 'numactl --membind=%d ./%s/app/testpmd -l %s -n %d --legacy-mem --socket-mem %s' \
+        ttd_secondary = 'numactl --membind=%d %s -l %s -n %d --legacy-mem --socket-mem %s' \
                             ' --huge-dir %s --file-prefix=%s -w %s -- -i --socket-num=%d --no-numa'
-        launch_ttd_secondary = ttd_secondary % (self.numa_id, self.target, self.core_list2, self.mem_channels, self.socket_mem2, MNT_PATH[1], vhost_name[1], self.pci_info_1, self.numa_id)
+        launch_ttd_secondary = ttd_secondary % (self.numa_id, self.app_path, self.core_list2, self.mem_channels, self.socket_mem2, MNT_PATH[1], vhost_name[1], self.pci_info_1, self.numa_id)
         self.session_secondary.send_expect(launch_ttd_secondary, "testpmd> ", 120)
         self.session_secondary.send_expect("set promisc all off", "testpmd> ", 120)
         self.session_secondary.send_expect("start", "testpmd> ", 120)
@@ -174,8 +175,8 @@ class DpdkHugetlbfsMountSize(TestCase):
     def test_mount_size_greater_than_hugepage_size_single_mount_point(self):
         # Bind one nic port to igb_uio driver
         self.dut.send_expect("mount -t hugetlbfs -o size=9G hugetlbfs %s" % MNT_PATH[0], "#", 15)
-        ttd = './%s/app/testpmd -l %s -n %d --legacy-mem --huge-dir %s --file-prefix=%s -w %s -- -i'
-        launch_ttd = ttd % (self.target, self.core_list1, self.mem_channels, MNT_PATH[0], vhost_name[0], self.pci_info_0)
+        ttd = '%s -l %s -n %d --legacy-mem --huge-dir %s --file-prefix=%s -w %s -- -i'
+        launch_ttd = ttd % (self.app_path, self.core_list1, self.mem_channels, MNT_PATH[0], vhost_name[0], self.pci_info_0)
         self.dut.send_expect(launch_ttd, "testpmd> ", 120)
         self.dut.send_expect("set promisc all off", "testpmd> ", 120)
         self.dut.send_expect("start", "testpmd> ", 120)
@@ -194,9 +195,9 @@ class DpdkHugetlbfsMountSize(TestCase):
         self.dut.send_expect("mount -t hugetlbfs -o size=1G hugetlbfs %s" % MNT_PATH[2], "#", 15)
         # launch first testpmd
         self.logger.info("launch first testpmd")
-        ttd = 'numactl --membind=%d ./%s/app/testpmd -l %s -n %d  --legacy-mem --socket-mem %s --huge-dir %s' \
+        ttd = 'numactl --membind=%d %s -l %s -n %d  --legacy-mem --socket-mem %s --huge-dir %s' \
               '  --file-prefix=%s -w %s -- -i --socket-num=%d --no-numa'
-        launch_ttd = ttd % (self.numa_id, self.target, self.core_list1, self.mem_channels, self.socket_mem2, MNT_PATH[0], vhost_name[0], self.pci_info_0, self.numa_id)
+        launch_ttd = ttd % (self.numa_id, self.app_path, self.core_list1, self.mem_channels, self.socket_mem2, MNT_PATH[0], vhost_name[0], self.pci_info_0, self.numa_id)
         self.session_first.send_expect(launch_ttd, "testpmd> ", 120)
         self.session_first.send_expect("set promisc all off", "testpmd> ", 120)
         self.session_first.send_expect("start", "testpmd> ", 120)
@@ -204,9 +205,9 @@ class DpdkHugetlbfsMountSize(TestCase):
 
         # launch secondary testpmd
         self.logger.info("launch secondary testpmd")
-        ttd_secondary = 'numactl --membind=%d ./%s/app/testpmd -l %s -n %d  --legacy-mem --socket-mem %s --huge-dir' \
+        ttd_secondary = 'numactl --membind=%d %s -l %s -n %d  --legacy-mem --socket-mem %s --huge-dir' \
                             ' %s --file-prefix=%s -w %s -- -i --socket-num=%d --no-numa'
-        launch_ttd_secondary = ttd_secondary % (self.numa_id, self.target, self.core_list2, self.mem_channels, self.socket_mem2, MNT_PATH[1], vhost_name[1], self.pci_info_0, self.numa_id)
+        launch_ttd_secondary = ttd_secondary % (self.numa_id, self.app_path, self.core_list2, self.mem_channels, self.socket_mem2, MNT_PATH[1], vhost_name[1], self.pci_info_0, self.numa_id)
         self.session_secondary.send_expect(launch_ttd_secondary, "testpmd> ", 120)
         self.session_secondary.send_expect("set promisc all off", "testpmd> ", 120)
         self.session_secondary.send_expect("start", "testpmd> ", 120)
@@ -214,9 +215,9 @@ class DpdkHugetlbfsMountSize(TestCase):
 
         # launch third testpmd
         self.logger.info("launch third testpmd")
-        ttd_third = 'numactl --membind=%d ./%s/app/testpmd -l %s -n %d  --legacy-mem --socket-mem %s --huge-dir' \
+        ttd_third = 'numactl --membind=%d %s -l %s -n %d  --legacy-mem --socket-mem %s --huge-dir' \
                         ' %s --file-prefix=%s -w %s -- -i --socket-num=%d --no-numa'
-        launch_ttd_third = ttd_third % (self.numa_id, self.target, self.core_list3, self.mem_channels, self.socket_mem, MNT_PATH[2], vhost_name[2], self.pci_info_0, self.numa_id)
+        launch_ttd_third = ttd_third % (self.numa_id, self.app_path, self.core_list3, self.mem_channels, self.socket_mem, MNT_PATH[2], vhost_name[2], self.pci_info_0, self.numa_id)
         expect_str = 'Not enough memory available on socket'
         self.dut.get_session_output(timeout=2)
         try:
@@ -246,8 +247,8 @@ class DpdkHugetlbfsMountSize(TestCase):
         self.dut.send_expect("mount -t hugetlbfs nodev %s" % MNT_PATH[0], "#", 15)
         self.dut.send_expect("cgcreate -g hugetlb:/test-subgroup", "# ", 15)
         self.dut.send_expect("cgset -r hugetlb.1GB.limit_in_bytes=2147483648 test-subgroup", "#", 15)
-        ttd = 'cgexec -g hugetlb:test-subgroup numactl -m %d ./%s/app/testpmd -l %s -n %d -w %s -- -i --socket-num=%d --no-numa'
-        launch_ttd = ttd % (self.numa_id, self.target, self.core_list1, self.mem_channels, self.pci_info_0, self.numa_id)
+        ttd = 'cgexec -g hugetlb:test-subgroup numactl -m %d %s -l %s -n %d -w %s -- -i --socket-num=%d --no-numa'
+        launch_ttd = ttd % (self.numa_id, self.app_path, self.core_list1, self.mem_channels, self.pci_info_0, self.numa_id)
         self.dut.send_expect(launch_ttd, "testpmd> ", 120)
         self.dut.send_expect("set promisc all off", "testpmd> ", 120)
         self.dut.send_expect("start", "testpmd> ", 120)
-- 
2.7.4


             reply	other threads:[~2020-10-22  1:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21 17:36 LihongX Ma [this message]
2020-11-03  1:32 ` 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=1603301779-28431-1-git-send-email-lihongx.ma@intel.com \
    --to=lihongx.ma@intel.com \
    --cc=dts@dpdk.org \
    /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).