test suite reviews and discussions
 help / color / mirror / Atom feed
From: Lingli Chen <linglix.chen@intel.com>
To: dts@dpdk.org
Cc: Lingli Chen <linglix.chen@intel.com>
Subject: [dts] [PATCH V1 3/3] tests/generic_flow_api: add two test cases
Date: Wed, 25 Aug 2021 18:30:34 +0000	[thread overview]
Message-ID: <20210825183034.63754-4-linglix.chen@intel.com> (raw)
In-Reply-To: <20210825183034.63754-1-linglix.chen@intel.com>

add two test cases

Signed-off-by: Lingli Chen <linglix.chen@intel.com>
---
 tests/TestSuite_generic_flow_api.py | 48 +++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py
index e8171589..f64a5be5 100644
--- a/tests/TestSuite_generic_flow_api.py
+++ b/tests/TestSuite_generic_flow_api.py
@@ -2351,6 +2351,54 @@ class TestGeneric_flow_api(TestCase):
         rule_num = extrapkt_rulenum['rulenum']
         self.verify_rulenum(rule_num)
 
+    def test_create_same_rule_after_destroy(self):
+
+        self.pmdout.start_testpmd("%s" % self.cores, "--disable-rss --rxq=%d --txq=%d" % (MAX_QUEUE+1, MAX_QUEUE+1))
+        self.dut.send_expect("set fwd rxonly", "testpmd> ", 20)
+        self.dut.send_expect("set verbose 1", "testpmd> ", 20)
+        self.dut.send_expect("start", "testpmd> ", 20)
+        time.sleep(2)
+
+        self.dut.send_expect(
+            "flow create 0 ingress pattern eth / ipv4 / udp src is 32 / end actions queue index 2 / end", "created")
+
+        out = self.dut.send_expect("flow destroy 0 rule 0", "testpmd> ")
+        p = re.compile(r"Flow rule #(\d+) destroyed")
+        m = p.search(out)
+        self.verify(m, "flow rule 0 delete failed" )
+
+        self.dut.send_expect(
+            "flow create 0 ingress pattern eth / ipv4 / udp src is 32 / end actions queue index 2 / end", "created")
+
+        self.sendpkt(pktstr='Ether(dst="%s")/IP()/UDP(sport=32)/Raw("x" * 20)' % self.pf_mac)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="2", verify_mac=self.pf_mac)
+        self.sendpkt(pktstr='Ether(dst="%s")/IP()/UDP(dport=32)/Raw("x" * 20)' % self.pf_mac)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac)
+
+    def test_create_different_rule_after_destroy(self):
+
+        self.pmdout.start_testpmd("%s" % self.cores, "--disable-rss --rxq=%d --txq=%d" % (MAX_QUEUE+1, MAX_QUEUE+1))
+        self.dut.send_expect("set fwd rxonly", "testpmd> ", 20)
+        self.dut.send_expect("set verbose 1", "testpmd> ", 20)
+        self.dut.send_expect("start", "testpmd> ", 20)
+        time.sleep(2)
+
+        self.dut.send_expect(
+            "flow create 0 ingress pattern eth / ipv4 / udp src is 32 / end actions queue index 2 / end", "created")
+
+        out = self.dut.send_expect("flow destroy 0 rule 0", "testpmd> ")
+        p = re.compile(r"Flow rule #(\d+) destroyed")
+        m = p.search(out)
+        self.verify(m, "flow rule 0 delete failed" )
+
+        self.dut.send_expect(
+            "flow create 0 ingress pattern eth / ipv4 / udp dst is 32 / end actions queue index 2 / end", "created")
+
+        self.sendpkt(pktstr='Ether(dst="%s")/IP()/UDP(sport=32)/Raw("x" * 20)' % self.pf_mac)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="0", verify_mac=self.pf_mac)
+        self.sendpkt(pktstr='Ether(dst="%s")/IP()/UDP(dport=32)/Raw("x" * 20)' % self.pf_mac)
+        self.verify_result("pf", expect_rxpkts="1", expect_queue="2", verify_mac=self.pf_mac)
+
     def tear_down(self):
         """
         Run after each test case.
-- 
2.32.0


  parent reply	other threads:[~2021-08-25 10:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 18:30 [dts] [PATCH V1 0/3] generic_flow_api: " Lingli Chen
2021-08-25 18:30 ` [dts] [PATCH V1 1/3] conf/test_case_checklist: add two cases about nic not support Lingli Chen
2021-08-25 18:30 ` [dts] [PATCH V1 2/3] test_plans/generic_flow_api: add two test cases Lingli Chen
2021-08-30  6:06   ` Lin, Xueqin
2021-08-25 18:30 ` Lingli Chen [this message]
2021-08-30  6:06   ` [dts] [PATCH V1 3/3] tests/generic_flow_api: " Lin, Xueqin
2021-08-26  2:14 ` [dts] [PATCH V1 0/3] generic_flow_api: " Chen, LingliX
2021-09-03  4:51   ` 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=20210825183034.63754-4-linglix.chen@intel.com \
    --to=linglix.chen@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).