test suite reviews and discussions
 help / color / mirror / Atom feed
From: Peng Yuan <yuan.peng@intel.com>
To: dts@dpdk.org
Cc: Peng Yuan <yuan.peng@intel.com>
Subject: [dts] [PATCH] tests: change checking method for queue-region rule.
Date: Fri, 28 Dec 2018 18:10:31 +0800	[thread overview]
Message-ID: <1545991831-10569-1-git-send-email-yuan.peng@intel.com> (raw)

change the checking method of result when flushed the queue-region rules.

Signed-off-by: Peng Yuan <yuan.peng@intel.com>

diff --git a/tests/TestSuite_queue_region.py b/tests/TestSuite_queue_region.py
index e971c46..5f4dbf4 100644
--- a/tests/TestSuite_queue_region.py
+++ b/tests/TestSuite_queue_region.py
@@ -109,6 +109,7 @@ class TestQueue_region(TestCase):
             self.send_packet_up(mac, pkt_type, prio)
         queue = self.get_queue_number()
         self.verify(queue in queue_region, "the packet doesn't enter the expected queue region.")
+        return queue
 
     def send_packet_pctype(self, mac, pkt_type="udp", frag=0, flags=None, tag=None, ethertype=None):
         """
@@ -230,7 +231,7 @@ class TestQueue_region(TestCase):
         #   7     |  10          |  46        |  Frag_IPv6
         # send the packets and verify the results
         queue_region = ["1"]
-        self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="udp")
+        queue_udp = self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="udp")
 
         # fortville can't parse the TCP SYN type packet, fortpark can parse it.
         if(self.nic in ["fortpark_TLV"]):
@@ -245,10 +246,10 @@ class TestQueue_region(TestCase):
 
         # not assign ipv4-sctp packet to any queue region, the packet to queue region 0.
         queue_region = ["1"]
-        self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="sctp", tag=1)
+        queue_sctp = self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="sctp", tag=1)
 
         queue_region = ["11", "12", "13", "14"]
-        self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv4")
+        queue_ipv4 = self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv4")
 
         queue_region = ["5"]
         self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv4", frag=1)
@@ -258,10 +259,10 @@ class TestQueue_region(TestCase):
         # not assign ipv4-tcp SYN packet to any queue region, the packet to queue region 0.
         if(self.nic in ["fortpark_TLV"]):
             queue_region = ["1"]
-            self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv6_tcp")
+            queue_ipv6tcp = self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv6_tcp")
         else:
             queue_region = ["8", "9"]
-            self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv6_tcp")
+            queue_ipv6tcp = self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv6_tcp")
 
         queue_region = ["11", "12", "13", "14"]
         self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv6_sctp", tag=2)
@@ -287,19 +288,19 @@ class TestQueue_region(TestCase):
         out = self.dut.send_expect("show port 0 queue-region", "testpmd> ")
         self.get_and_compare_rules(out, 0, 0, 0)
 
-        # confirm packet not to the same queue after flush all the queue region rull.
+        # confirm packet not to the same queue after flush all the queue regions rull.
         self.send_packet_pctype(mac=self.pf_mac, pkt_type="udp")
         queue = self.get_queue_number()
-        self.verify(queue not in ["1"], "the queue regions have not been flushed clearly.")
+        self.verify(queue != queue_udp, "the queue regions have not been flushed clearly.")
         self.send_packet_pctype(mac=self.pf_mac, pkt_type="sctp")
         queue = self.get_queue_number()
-        self.verify(queue not in ["1"], "the queue regions have not been flushed clearly.")
+        self.verify(queue != queue_sctp, "the queue regions have not been flushed clearly.")
         self.send_packet_pctype(mac=self.pf_mac, pkt_type="ipv4")
         queue = self.get_queue_number()
-        self.verify(queue not in ["10", "11", "12", "13"], "the queue regions have not been flushed clearly.")
+        self.verify(queue != queue_ipv4, "the queue regions have not been flushed clearly.")
         self.send_packet_pctype(mac=self.pf_mac, pkt_type="ipv6_tcp")
         queue = self.get_queue_number()
-        self.verify(queue not in ["8", "9"], "the queue regions have not been flushed clearly.")
+        self.verify(queue != queue_ipv6tcp, "the queue regions have not been flushed clearly.")
 
     def test_up_map_queue_region(self):
         # set queue region on a port
@@ -330,13 +331,13 @@ class TestQueue_region(TestCase):
         self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="ipv6_udp", prio=1)
 
         queue_region = ["10", "11", "12", "13"]
-        self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="tcp", prio=2)
+        queue_tcp = self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="tcp", prio=2)
 
         queue_region = ["10", "11", "12", "13"]
         self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="tcp", prio=7)
 
         queue_region = ["10", "11", "12", "13"]
-        self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="udp", prio=7)
+        queue_udp = self.send_and_check(queue_region, mac=self.pf_mac, pkt_type="udp", prio=7)
 
         self.send_packet_pctype(mac=self.pf_mac, pkt_type="udp")
         queue = self.get_queue_number()
@@ -352,10 +353,10 @@ class TestQueue_region(TestCase):
         # confirm packet not to the same queue after flush all the queue region rull.
         self.send_packet_up(mac=self.pf_mac, pkt_type="udp", prio=7)
         queue = self.get_queue_number()
-        self.verify(queue not in ["10", "11", "12", "13"], "the queue regions have not been flushed clearly.")
+        self.verify(queue != queue_udp, "the queue regions have not been flushed clearly.")
         self.send_packet_up(mac=self.pf_mac, pkt_type="tcp", prio=2)
         queue = self.get_queue_number()
-        self.verify(queue not in ["10", "11", "12", "13"], "the queue regions have not been flushed clearly.")
+        self.verify(queue != queue_tcp, "the queue regions have not been flushed clearly.")
 
     def test_boundary_values(self):
         # boundary value testing of "Set a queue region on a port"
-- 
2.5.0

             reply	other threads:[~2018-12-28 10:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-28 10:10 Peng Yuan [this message]
2018-12-29 16:24 ` Lijuan Tu
2018-12-28 11:28 Peng Yuan
2018-12-29  1:35 ` Zhu, ShuaiX

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=1545991831-10569-1-git-send-email-yuan.peng@intel.com \
    --to=yuan.peng@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).