test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Tu, Lijuan" <lijuan.tu@intel.com>
To: "Lin, Xueqin" <xueqin.lin@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Lin, Xueqin" <xueqin.lin@intel.com>
Subject: Re: [dts] [PATCH] tests/shutdown_api: add allmulticast and more check	for link, promisc cases
Date: Mon, 27 Apr 2020 07:51:25 +0000	[thread overview]
Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC12AD4@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1587873204-163786-1-git-send-email-xueqin.lin@intel.com>

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Xueqin Lin
> Sent: Sunday, April 26, 2020 11:53 AM
> To: dts@dpdk.org
> Cc: Lin, Xueqin <xueqin.lin@intel.com>
> Subject: [dts] [PATCH] tests/shutdown_api: add allmulticast and more check
> for link, promisc cases
> 
> Signed-off-by: Xueqin Lin <xueqin.lin@intel.com>
> 
> ---
>  tests/TestSuite_shutdown_api.py | 43
> +++++++++++++++++++++++++++++++++++++----
>  1 file changed, 39 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/TestSuite_shutdown_api.py
> b/tests/TestSuite_shutdown_api.py index b5c0d5a..181a385 100644
> --- a/tests/TestSuite_shutdown_api.py
> +++ b/tests/TestSuite_shutdown_api.py
> @@ -89,14 +89,14 @@ class TestShutdownApi(TestCase):
>          stats = output.get_pmd_stats(portid)
>          return stats
> 
> -    def check_forwarding(self, ports=None, pktSize=68, received=True,
> vlan=False, promisc=False, vlan_strip=False):
> +    def check_forwarding(self, ports=None, pktSize=68, received=True,
> vlan=False, promisc=False, allmulti=False, vlan_strip=False):
>          if ports is None:
>              ports = self.ports
>          if len(ports) == 1:
> -            self.send_packet(ports[0], ports[0], pktSize, received, vlan, promisc,
> vlan_strip)
> +            self.send_packet(ports[0], ports[0], pktSize, received,
> + vlan, promisc, allmulti, vlan_strip)
>              return
> 
> -    def send_packet(self, txPort, rxPort, pktSize=68, received=True, vlan=False,
> promisc=False, vlan_strip=False):
> +    def send_packet(self, txPort, rxPort, pktSize=68, received=True,
> vlan=False, promisc=False, allmulti=False, vlan_strip=False):
>          """
>          Send packages according to parameters.
>          """
> @@ -117,7 +117,8 @@ class TestShutdownApi(TestCase):
>          # when promisc is true, destination mac should be fake
>          if promisc:
>              dmac = "00:00:00:00:00:01"
> -
> +        if allmulti:
> +            dmac = "01:00:00:33:00:01"
>          if vlan:
>              padding = pktSize - HEADER_SIZE['eth'] - HEADER_SIZE['ip'] -4
>              pkg = 'Ether(src="%s", dst="%s")/Dot1Q(vlan=1)/IP()/Raw(load="P"
> * %d)' % (smac, dmac, padding) @@ -366,17 +367,44 @@ class
> TestShutdownApi(TestCase):
>              print(("   !!! DEBUG IT: " + e.message))
>              self.verify(False, e.message)
> 
> +        self.check_forwarding(ports, received=False, promisc=True)
>          self.dut.send_expect("port stop all", "testpmd> ", 100)
>          self.dut.send_expect("set promisc all on", "testpmd> ")
>          self.dut.send_expect("port start all", "testpmd> ", 100)
>          self.dut.send_expect("show config rxtx", "testpmd> ")
>          self.dut.send_expect("start", "testpmd> ")
>          self.check_forwarding(ports, promisc=True)
> +        self.check_forwarding(ports)
>          self.dut.send_expect("port stop all", "testpmd> ", 100)
>          self.dut.send_expect("set promisc all off", "testpmd> ")
>          self.dut.send_expect("start", "testpmd> ")
>          self.dut.send_expect("quit", "# ", 30)
> 
> +    def test_set_allmulticast(self):
> +        """
> +        Allmulticast mode.
> +        """
> +        ports = [self.ports[0]]
> +
> +        portmask = utils.create_mask(ports)
> +        self.pmdout.start_testpmd("Default", "--portmask=%s
> + --port-topology=loop" % portmask, socket = self.ports_socket)
> +
> +        self.dut.send_expect("set promisc all off", "testpmd> ")
> +        self.dut.send_expect("set allmulti all off", "testpmd> ")
> +        self.dut.send_expect("start", "testpmd> ")
> +
> +        self.check_forwarding(ports)
> +        self.check_forwarding(ports, received=False, promisc=True)
> +        self.check_forwarding(ports, received=False, allmulti=True)
> +        self.dut.send_expect("set allmulti all on", "testpmd> ")
> +        self.check_forwarding(ports)
> +        self.check_forwarding(ports, allmulti=True)
> +        self.check_forwarding(ports, received=False, promisc=True)
> +        self.dut.send_expect("set promisc all on", "testpmd> ")
> +        self.check_forwarding(ports)
> +        self.check_forwarding(ports, promisc=True)
> +        self.dut.send_expect("quit", "# ", 30)
> +
>      def test_reset_queues(self):
>          """
>          Reset RX/TX Queues.
> @@ -479,6 +507,13 @@ class TestShutdownApi(TestCase):
>              time.sleep(8)  # sleep few seconds for link stable
> 
>              for port in self.ports:
> +                out = self.dut.send_expect("show port info %s" % port, "testpmd>")
> +                self.verify("Link status: up" in out,
> +                            "Wrong link status reported by the dut")
> +                self.verify("Link speed: %s Mbps" % config[0] in out,
> +                            "Wrong speed reported by the dut")
> +                self.verify("Link duplex: %s-duplex" % config[1].lower() in out,
> +                            "Wrong link type reported by the dut")
>                  out = self.tester.send_expect(
>                      "ethtool %s" %
> self.tester.get_interface(self.tester.get_local_port(port)), "# ")
>                  self.verify("Speed: %sMb/s" % config[0] in out,
> --
> 2.7.5


      reply	other threads:[~2020-04-27  7:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-26  3:53 Xueqin Lin
2020-04-27  7:51 ` Tu, Lijuan [this message]

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=8CE3E05A3F976642AAB0F4675D0AD20E0BC12AD4@SHSMSX101.ccr.corp.intel.com \
    --to=lijuan.tu@intel.com \
    --cc=dts@dpdk.org \
    --cc=xueqin.lin@intel.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).