From: Nannan Lu <nannan.lu@intel.com>
To: dts@dpdk.org
Cc: Nannan Lu <nannan.lu@intel.com>
Subject: [dts] [PATCH V1] tests/TestSuite_cvl_dcf_switch_filter.py: modify max_rule_number test case
Date: Tue, 28 Jul 2020 13:41:22 +0000 [thread overview]
Message-ID: <1595943682-1510101-1-git-send-email-nannan.lu@intel.com> (raw)
Modify max_rule_number test case, since the max switch filter rule number
which can be created will be changed if firmware or kernel driver changed.
Signed-off-by: Nannan Lu <nannan.lu@intel.com>
---
tests/TestSuite_cvl_dcf_switch_filter.py | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/tests/TestSuite_cvl_dcf_switch_filter.py b/tests/TestSuite_cvl_dcf_switch_filter.py
index afb6a28..c15fd31 100644
--- a/tests/TestSuite_cvl_dcf_switch_filter.py
+++ b/tests/TestSuite_cvl_dcf_switch_filter.py
@@ -855,7 +855,7 @@ tv_add_two_rules_with_different_input_set_different_vf_id = {
"expect_results":{"expect_pkts":[0, 0]}}
}
-class SwitchFilterTest(TestCase):
+class CVLDCFSwitchFilterTest(TestCase):
def bind_nics_driver(self, ports, driver=""):
# modprobe vfio driver
@@ -1677,10 +1677,29 @@ class SwitchFilterTest(TestCase):
rule_list_num = list(range(0, 32563))
rule_list = [str(x) for x in rule_list_num]
self.check_switch_filter_rule_list(0, rule_list)
- #create the 32564th rule
- rule = "flow create 0 ingress pattern eth / ipv4 src is 192.168.127.178 / end actions vf id 1 / end"
- out = self.dut.send_expect(rule, "testpmd> ", timeout=2)
- self.verify("Failed to create flow" in out, "Log not provide a friendly output to indicate that the rule failed to create.")
+ #create other rules to make switch filter table full
+ m = i
+ t = j
+ p = re.compile(r"Flow rule #(\d+) created")
+ switch_table_full_flag = False
+ count = 0
+ for i in range(m,255):
+ for j in range(t,255):
+ rule = 'flow create 0 ingress pattern eth / ipv4 src is 192.168.%d.%d / end actions vf id 1 / end \n' % (i, j)
+ matched_packet = 'Ether(dst="68:05:ca:8d:ed:a8")/IP(src="192.168.%d.%d")/TCP(sport=25,dport=23)/Raw("X"*480)' % (i, j)
+ out = self.dut.send_expect(rule, "testpmd> ", timeout=2) #create a rule
+ m1 = p.search(out)
+ if m1:
+ rule_list.append(m1.group(1))
+ tv_max_rule_number["matched"]["scapy_str"].append(matched_packet)
+ count += 1
+ else:
+ self.verify("Failed to create flow" in out, "Log not provide a friendly output to indicate that the rule failed to create.")
+ switch_table_full_flag = True
+ break
+ if switch_table_full_flag:
+ break
+ tv_max_rule_number["matched"]["expect_results"]["expect_pkts"] += count
#check the rule list
self.check_switch_filter_rule_list(0, rule_list)
#send matched packets and check
--
2.7.4
next reply other threads:[~2020-07-28 4:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-28 13:41 Nannan Lu [this message]
2020-08-12 6:29 ` 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=1595943682-1510101-1-git-send-email-nannan.lu@intel.com \
--to=nannan.lu@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).