From: <usurekha@marvell.com>
To: <dts@dpdk.org>
Cc: <pvukkisala@marvell.com>, <zzhou@marvell.com>,
usurekha <usurekha@marvell.com>
Subject: [dts] [PATCH] tests/TestSuite_multiple_pthread.py: Updated test_positive() and teardown() functions.
Date: Fri, 25 Sep 2020 15:16:54 +0530 [thread overview]
Message-ID: <1601027214-29537-1-git-send-email-usurekha@marvell.com> (raw)
From: usurekha <usurekha@marvell.com>
Added script to get the available max cpu depends on DUT config.
Did modifications in teardown() to close the tester scapy
sessions properly.
Signed-off-by: usurekha <usurekha@marvell.com>
---
tests/TestSuite_multiple_pthread.py | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/tests/TestSuite_multiple_pthread.py b/tests/TestSuite_multiple_pthread.py
index 5d4a1f6..2af8196 100644
--- a/tests/TestSuite_multiple_pthread.py
+++ b/tests/TestSuite_multiple_pthread.py
@@ -62,7 +62,7 @@ class TestMultiplePthread(TestCase):
"""
Run before each test case.
"""
- self.send_sessions = []
+ self.send_sessions = None
def send_packet(self):
"""
@@ -73,8 +73,7 @@ class TestMultiplePthread(TestCase):
iface = self.tester.get_interface(localPort)
pcap_str = 'Ether()/IP(src="1.2.3.4", dst="192.168.0.%d")' % (index)
self.pkt = Packet(pcap_str)
- intf = self.pkt.send_pkt_bg(crb=self.tester, tx_port=iface)
- self.send_sessions.append(intf)
+ self.send_sessions = self.pkt.send_pkt_bg(crb=self.tester, tx_port=iface)
def get_cores_statistic(self, cmdline):
"""
@@ -176,7 +175,14 @@ class TestMultiplePthread(TestCase):
Test an random parameter from an defined table which has a couple of valid lcore parameters.
"""
n = self.cores
- CONFIG_RTE_MAX_LCORE = 128
+ # Get max available core depends on DUT configuration
+ cores = self.dut.get_core_list('all')
+ config_max_lcore = self.dut.get_def_rte_config('CONFIG_RTE_MAX_LCORE')
+ if config_max_lcore:
+ CONFIG_RTE_MAX_LCORE = min(int(config_max_lcore), len(cores) + 1)
+ else:
+ CONFIG_RTE_MAX_LCORE = len(cores) + 1
+
test_list = [
{"lcores": "(%s,%s)@(%s,%s)" % (n[0], CONFIG_RTE_MAX_LCORE-1, n[1], n[2]),
"cpu_list":[CONFIG_RTE_MAX_LCORE-1],
@@ -230,8 +236,8 @@ class TestMultiplePthread(TestCase):
"""
Run after each test case.
"""
- if len(self.send_sessions) != 0:
- self.pkt.stop_send_pkt_bg(self.send_sessions)
+ if self.send_sessions:
+ self.pkt.stop_send_pkt_bg(self.send_sessions)
self.dut.kill_all()
def tear_down_all(self):
--
2.7.4
next reply other threads:[~2020-09-25 9:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 9:46 usurekha [this message]
2020-09-29 5:07 ` Ma, LihongX
-- strict thread matches above, loose matches on Subject: below --
2020-09-25 9:28 usurekha
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=1601027214-29537-1-git-send-email-usurekha@marvell.com \
--to=usurekha@marvell.com \
--cc=dts@dpdk.org \
--cc=pvukkisala@marvell.com \
--cc=zzhou@marvell.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).