test suite reviews and discussions
 help / color / Atom feed
* [dts] [PATCH v1]tests: add some check parameters to TestSuite_ipgre.py
@ 2019-09-23  9:29 Peng Yuan
  2019-09-24  9:21 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Yuan @ 2019-09-23  9:29 UTC (permalink / raw)
  To: dts; +Cc: Peng Yuan

Add some check parameters to TestSuite_ipgre.py

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

diff --git a/tests/TestSuite_ipgre.py b/tests/TestSuite_ipgre.py
index d74ac05..d08a933 100644
--- a/tests/TestSuite_ipgre.py
+++ b/tests/TestSuite_ipgre.py
@@ -63,7 +63,9 @@ class TestIpgre(TestCase):
         """
         self.printFlag = self._enable_debug
         ports = self.dut.get_ports()
-        self.verify(self.nic in ["columbiaville_25g", "columbiaville_100g", "fortville_eagle", "fortville_spirit", "fortville_spirit_single", "fortville_25g", "carlsville"],
+        self.verify(self.nic in ["fortville_eagle", "fortville_spirit",
+                                 "fortville_spirit_single", "fortville_25g", "carlsville",
+                                 "columbiaville_25g", "columbiaville_100g"],
                     "GRE tunnel packet type only support by fortville and carlsville")
         self.verify(len(ports) >= 1, "Insufficient ports for testing")
         valports = [_ for _ in ports if self.tester.get_local_port(_) != -1]
@@ -90,7 +92,7 @@ class TestIpgre(TestCase):
         """
         pass
 
-    def check_packet_transmission(self, pkt_types, layer_configs=None):
+    def check_packet_transmission(self, pkt_types, layer_configs=None, queue=None, add_filter=0):
         time.sleep(1)
         for pkt_type in pkt_types.keys():
             pkt_names = pkt_types[pkt_type]
@@ -115,6 +117,14 @@ class TestIpgre(TestCase):
             else:
                 print utils.GREEN("Detected %s successfully" % pkt_type)
 	        time.sleep(1)
+            if queue == None: # no filter
+                pass
+            else:
+                if add_filter: # remove filter
+                    self.verify(("Receive queue=0x%s" % queue) in out, "Failed to enter the right queue.")
+                else:
+                    self.verify(("Receive queue=0x%s" % queue) not in out, "Failed to enter the right queue.")
+
 
     def save_ref_packet(self, pkt_types, layer_configs=None):
         for pkt_type in pkt_types.keys():
@@ -186,7 +196,7 @@ class TestIpgre(TestCase):
         config_layers =  {'ether': {'src': self.outer_mac_src},
                           'ipv4': {'proto': 'gre'}}
         # Start testpmd and enable rxonly forwarding mode
-        testpmd_cmd = "./%s/app/testpmd -c ffff -n 4 -- -i --enable-rx-cksum --enable-rx-cksum" % self.target
+        testpmd_cmd = "./%s/app/testpmd -c ffff -n 4 -- -i --enable-rx-cksum" % self.target
         self.dut.send_expect( testpmd_cmd, 
                               "testpmd>", 
                               20)
@@ -278,12 +288,16 @@ class TestIpgre(TestCase):
         # Send packet inner ip address matched and check packet received by queue 3
         pkt_types = {"MAC_IP_GRE_IPv4-TUNNEL_UDP_PKT":  ["TUNNEL_GRENAT",  "INNER_L4_UDP"]}
         config_layers = {'ether': {'src': self.outer_mac_src},
-                         'ipv4': {'dst': "0.0.0.0", 'proto': 'gre'}}
-        self.check_packet_transmission(pkt_types, config_layers)
+                         'ipv4': {'proto': 'gre',
+                                  'src': self.outer_ip_src,
+                                  'dst': self.outer_ip_dst},
+                         'inner_ipv4':{'dst': "0.0.0.0"}}
+        self.check_packet_transmission(pkt_types, config_layers, "3", 1)
 
         # Remove tunnel filter and check same packet received by queue 0
         cmd = "tunnel_filter rm 0 %s %s 0.0.0.0 1 ipingre iip 0 3"%(outer_mac, inner_mac)
         self.dut.send_expect( cmd, "testpmd>")
+        self.check_packet_transmission(pkt_types, config_layers, "3")
         
         # Add GRE filter that forward outer ip address 0.0.0.0 to queue 3
         cmd = "tunnel_filter add 0 %s %s 0.0.0.0 1 ipingre oip 0 3"%(outer_mac, inner_mac)
@@ -293,11 +307,13 @@ class TestIpgre(TestCase):
         pkt_types = {"MAC_IP_GRE_IPv4-TUNNEL_UDP_PKT": ["TUNNEL_GRENAT", "INNER_L4_UDP"]}
         config_layers = {'ether': {'src': self.outer_mac_src},
                          'ipv4': {'dst': "0.0.0.0", 'proto': 'gre'}}
-        self.check_packet_transmission(pkt_types, config_layers)
+        self.check_packet_transmission(pkt_types, config_layers, "3", 1)
 
         # Add GRE filter that forward outer ip address 0.0.0.0 to queue 3
-        cmd = "tunnel_filter rm 0 %s %s 0.0.0.0 1 ipingre iip 0 3"%(outer_mac, inner_mac)
+        cmd = "tunnel_filter rm 0 %s %s 0.0.0.0 1 ipingre oip 0 3"%(outer_mac, inner_mac)
         self.dut.send_expect( cmd, "testpmd>")
+        self.check_packet_transmission(pkt_types, config_layers, "3")
+
         time.sleep(2)
         self.dut.send_expect("quit", "#")
 
@@ -437,14 +453,12 @@ class TestIpgre(TestCase):
     def tear_down(self):
         """
         Run after each test case.
-        Nothing to do.
         """
-        pass
+        self.dut.kill_all()
 
     def tear_down_all(self):
         """
         Run after each test suite.
         Nothing to do.
         """
-        self.dut.kill_all()
         pass
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH v1]tests: add some check parameters to TestSuite_ipgre.py
  2019-09-23  9:29 [dts] [PATCH v1]tests: add some check parameters to TestSuite_ipgre.py Peng Yuan
@ 2019-09-24  9:21 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2019-09-24  9:21 UTC (permalink / raw)
  To: Peng, Yuan, dts; +Cc: Peng, Yuan

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Peng Yuan
> Sent: Monday, September 23, 2019 5:29 PM
> To: dts@dpdk.org
> Cc: Peng, Yuan <yuan.peng@intel.com>
> Subject: [dts] [PATCH v1]tests: add some check parameters to
> TestSuite_ipgre.py
> 
> Add some check parameters to TestSuite_ipgre.py
> 
> Signed-off-by: Peng Yuan <yuan.peng@intel.com>
> 
> diff --git a/tests/TestSuite_ipgre.py b/tests/TestSuite_ipgre.py index
> d74ac05..d08a933 100644
> --- a/tests/TestSuite_ipgre.py
> +++ b/tests/TestSuite_ipgre.py
> @@ -63,7 +63,9 @@ class TestIpgre(TestCase):
>          """
>          self.printFlag = self._enable_debug
>          ports = self.dut.get_ports()
> -        self.verify(self.nic in ["columbiaville_25g", "columbiaville_100g",
> "fortville_eagle", "fortville_spirit", "fortville_spirit_single", "fortville_25g",
> "carlsville"],
> +        self.verify(self.nic in ["fortville_eagle", "fortville_spirit",
> +                                 "fortville_spirit_single", "fortville_25g", "carlsville",
> +                                 "columbiaville_25g",
> + "columbiaville_100g"],
>                      "GRE tunnel packet type only support by fortville and carlsville")
>          self.verify(len(ports) >= 1, "Insufficient ports for testing")
>          valports = [_ for _ in ports if self.tester.get_local_port(_) != -1] @@ -90,7
> +92,7 @@ class TestIpgre(TestCase):
>          """
>          pass
> 
> -    def check_packet_transmission(self, pkt_types, layer_configs=None):
> +    def check_packet_transmission(self, pkt_types, layer_configs=None,
> queue=None, add_filter=0):
>          time.sleep(1)
>          for pkt_type in pkt_types.keys():
>              pkt_names = pkt_types[pkt_type] @@ -115,6 +117,14 @@ class
> TestIpgre(TestCase):
>              else:
>                  print utils.GREEN("Detected %s successfully" % pkt_type)
>  	        time.sleep(1)
> +            if queue == None: # no filter
> +                pass
> +            else:
> +                if add_filter: # remove filter
> +                    self.verify(("Receive queue=0x%s" % queue) in out, "Failed to
> enter the right queue.")
> +                else:
> +                    self.verify(("Receive queue=0x%s" % queue) not in
> + out, "Failed to enter the right queue.")
> +
> 
>      def save_ref_packet(self, pkt_types, layer_configs=None):
>          for pkt_type in pkt_types.keys():
> @@ -186,7 +196,7 @@ class TestIpgre(TestCase):
>          config_layers =  {'ether': {'src': self.outer_mac_src},
>                            'ipv4': {'proto': 'gre'}}
>          # Start testpmd and enable rxonly forwarding mode
> -        testpmd_cmd = "./%s/app/testpmd -c ffff -n 4 -- -i --enable-rx-cksum --
> enable-rx-cksum" % self.target
> +        testpmd_cmd = "./%s/app/testpmd -c ffff -n 4 -- -i
> + --enable-rx-cksum" % self.target
>          self.dut.send_expect( testpmd_cmd,
>                                "testpmd>",
>                                20)
> @@ -278,12 +288,16 @@ class TestIpgre(TestCase):
>          # Send packet inner ip address matched and check packet received by
> queue 3
>          pkt_types = {"MAC_IP_GRE_IPv4-TUNNEL_UDP_PKT":
> ["TUNNEL_GRENAT",  "INNER_L4_UDP"]}
>          config_layers = {'ether': {'src': self.outer_mac_src},
> -                         'ipv4': {'dst': "0.0.0.0", 'proto': 'gre'}}
> -        self.check_packet_transmission(pkt_types, config_layers)
> +                         'ipv4': {'proto': 'gre',
> +                                  'src': self.outer_ip_src,
> +                                  'dst': self.outer_ip_dst},
> +                         'inner_ipv4':{'dst': "0.0.0.0"}}
> +        self.check_packet_transmission(pkt_types, config_layers, "3",
> + 1)
> 
>          # Remove tunnel filter and check same packet received by queue 0
>          cmd = "tunnel_filter rm 0 %s %s 0.0.0.0 1 ipingre iip 0 3"%(outer_mac,
> inner_mac)
>          self.dut.send_expect( cmd, "testpmd>")
> +        self.check_packet_transmission(pkt_types, config_layers, "3")
> 
>          # Add GRE filter that forward outer ip address 0.0.0.0 to queue 3
>          cmd = "tunnel_filter add 0 %s %s 0.0.0.0 1 ipingre oip 0 3"%(outer_mac,
> inner_mac) @@ -293,11 +307,13 @@ class TestIpgre(TestCase):
>          pkt_types = {"MAC_IP_GRE_IPv4-TUNNEL_UDP_PKT":
> ["TUNNEL_GRENAT", "INNER_L4_UDP"]}
>          config_layers = {'ether': {'src': self.outer_mac_src},
>                           'ipv4': {'dst': "0.0.0.0", 'proto': 'gre'}}
> -        self.check_packet_transmission(pkt_types, config_layers)
> +        self.check_packet_transmission(pkt_types, config_layers, "3",
> + 1)
> 
>          # Add GRE filter that forward outer ip address 0.0.0.0 to queue 3
> -        cmd = "tunnel_filter rm 0 %s %s 0.0.0.0 1 ipingre iip 0 3"%(outer_mac,
> inner_mac)
> +        cmd = "tunnel_filter rm 0 %s %s 0.0.0.0 1 ipingre oip 0
> + 3"%(outer_mac, inner_mac)
>          self.dut.send_expect( cmd, "testpmd>")
> +        self.check_packet_transmission(pkt_types, config_layers, "3")
> +
>          time.sleep(2)
>          self.dut.send_expect("quit", "#")
> 
> @@ -437,14 +453,12 @@ class TestIpgre(TestCase):
>      def tear_down(self):
>          """
>          Run after each test case.
> -        Nothing to do.
>          """
> -        pass
> +        self.dut.kill_all()
> 
>      def tear_down_all(self):
>          """
>          Run after each test suite.
>          Nothing to do.
>          """
> -        self.dut.kill_all()
>          pass
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-23  9:29 [dts] [PATCH v1]tests: add some check parameters to TestSuite_ipgre.py Peng Yuan
2019-09-24  9:21 ` Tu, Lijuan

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox