From: "xu,huilong" <huilongx.xu@intel.com>
To: dts@dpdk.org
Cc: "xu,huilong" <huilongx.xu@intel.com>
Subject: [dts] [PATCH 4/4] add example for test suite
Date: Sat, 1 Apr 2017 15:42:32 +0800 [thread overview]
Message-ID: <1491032552-118473-5-git-send-email-huilongx.xu@intel.com> (raw)
In-Reply-To: <1491032552-118473-1-git-send-email-huilongx.xu@intel.com>
add two example for how to use compile config for tests.
1. queque start stop: use dpdk patch
2. core mask: use different compile switch
Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
tests/TestSuite_coremask.py | 12 ++----------
tests/TestSuite_queue_start_stop.py | 28 +++-------------------------
2 files changed, 5 insertions(+), 35 deletions(-)
diff --git a/tests/TestSuite_coremask.py b/tests/TestSuite_coremask.py
index a28266a..c33a193 100644
--- a/tests/TestSuite_coremask.py
+++ b/tests/TestSuite_coremask.py
@@ -39,11 +39,7 @@ class TestCoremask(TestCase):
self.mem_channel = self.dut.get_memory_channels()
self.all_cores = self.dut.get_core_list("all")
- self.dut.send_expect("sed -i -e 's/CONFIG_RTE_LOG_LEVEL=.*$/"
- + "CONFIG_RTE_LOG_LEVEL=RTE_LOG_DEBUG/' config/common_base", "# ", 30)
-
- self.dut.skip_setup = False
- self.dut.build_install_dpdk(self.target)
+ self.dut.reset_compile_target(self.target + '_log_level')
def set_up(self):
"""
@@ -178,8 +174,4 @@ class TestCoremask(TestCase):
"""
Run after each test suite.
"""
- self.dut.send_expect("sed -i -e 's/CONFIG_RTE_LOG_LEVEL=.*$/"
- + "CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO/' config/common_base", "# ", 30)
-
- #self.dut.skip_setup = False
- self.dut.build_install_dpdk(self.target)
+ self.dut.reset_compile_target()
diff --git a/tests/TestSuite_queue_start_stop.py b/tests/TestSuite_queue_start_stop.py
index d1df66b..b24f47b 100644
--- a/tests/TestSuite_queue_start_stop.py
+++ b/tests/TestSuite_queue_start_stop.py
@@ -70,22 +70,7 @@ class TestQueueStartStop(TestCase):
"""
Run before each test case.
"""
- try:
- patch_file = FOLDERS["Depends"] + r'/macfwd_log.patch'
- except:
- self.logger.warning(str(FOLDERS))
- patch_file = r'dep/macfwd_log.patch'
- FOLDERS["Depends"] = 'dep'
- patch_dst = "/tmp/"
-
- # dpdk patch and build
- try:
- self.dut.session.copy_file_to(patch_file, patch_dst)
- self.patch_hotfix_dpdk(patch_dst + "macfwd_log.patch", True)
- self.dut.build_dpdk_apps('./app/test-pmd')
- except Exception, e:
- raise IOError("dpdk setup failure: %s" % e)
-
+ self.dut.reset_compile_target(self.target + '_queue_start_stop')
def check_forwarding(self, ports, nic, pktSize=64, received=True):
self.send_packet(ports[0], ports[1], self.nic, pktSize, received)
@@ -130,7 +115,7 @@ class TestQueueStartStop(TestCase):
"""
#dpdk start
try:
- self.dut.send_expect("./app/test-pmd/testpmd -c 0xf -n 4 -- -i --portmask=0x1 --port-topology=loop", "testpmd>", 120)
+ self.dut.send_expect("./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x1 --port-topology=loop" % self.target, "testpmd>", 120)
self.dut.send_expect("set fwd mac", "testpmd>")
self.dut.send_expect("start", "testpmd>")
self.check_forwarding([0, 0], self.nic)
@@ -182,16 +167,9 @@ class TestQueueStartStop(TestCase):
self.dut.kill_all()
- try:
- self.patch_hotfix_dpdk(patch_dst + "macfwd_log.patch", False)
- except Exception, e:
- print "patch_hotfix_dpdk remove failure :%s" %e
-
def tear_down_all(self):
"""
Run after each test suite.
"""
self.dut.kill_all()
- self.dut.send_expect("rm -rf ./app/test-pmd/testpmd", "#")
- self.dut.send_expect("rm -rf ./app/test-pmd/*.o", "#")
- self.dut.send_expect("rm -rf ./app/test-pmd/build", "#")
+ self.dut.reset_compile_target()
--
1.9.3
next prev parent reply other threads:[~2017-04-01 7:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-01 7:42 [dts] [PATCH 0/4] compile dpdk different config with different test suite by dts framework befor run " xu,huilong
2017-04-01 7:42 ` [dts] [PATCH 1/4] add dpdk all compile switch xu,huilong
2017-04-01 8:02 ` Liu, Yong
2017-04-01 7:42 ` [dts] [PATCH 2/4] add compile config file template and parse compile config class xu,huilong
2017-04-01 7:42 ` [dts] [PATCH 3/4] read compile switch config and compile dpdk before test xu,huilong
2017-04-01 7:42 ` xu,huilong [this message]
2017-04-01 8:20 ` [dts] [PATCH 0/4] compile dpdk different config with different test suite by dts framework befor run test suite Liu, Yong
2017-04-01 8:31 ` Xu, HuilongX
2017-04-01 8:54 ` Liu, Yong
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=1491032552-118473-5-git-send-email-huilongx.xu@intel.com \
--to=huilongx.xu@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).