test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Wang, Yinan" <yinan.wang@intel.com>
To: "Xiao, QimaiX" <qimaix.xiao@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Subject: Re: [dts] [PATCH V1]tests/TestSuite_hotplug: add virtio case for hotplug
Date: Thu, 2 Apr 2020 14:14:53 +0000	[thread overview]
Message-ID: <5c15f88944034a2fa9ef59e7419719d8@intel.com> (raw)
In-Reply-To: <8800ae6b3bf3490dba394ba07a1ec3f7@intel.com>

Acked-by: Wang, Yinan <yinan.wang@intel.com>

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Xiao, QimaiX
> Sent: 2020年4月2日 19:19
> To: dts@dpdk.org
> Subject: Re: [dts] [PATCH V1]tests/TestSuite_hotplug: add virtio case for
> hotplug
> 
> Tested-by: Xiao, QimaiX <qimaix.xiao@intel.com>
> 
> Regards,
> Xiao Qimai
> 
> 
> > -----Original Message-----
> > From: Xiao, QimaiX
> > Sent: Thursday, April 2, 2020 7:06 PM
> > To: dts@dpdk.org
> > Cc: Xiao, QimaiX <qimaix.xiao@intel.com>
> > Subject: [dts][PATCH V1]tests/TestSuite_hotplug: add virtio case for hotplug
> >
> > *. add virtio case for hotplug
> >
> > Signed-off-by: Xiao Qimai <qimaix.xiao@intel.com>
> > ---
> >  tests/TestSuite_hotplug.py | 47
> > ++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 47 insertions(+)
> >
> > diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py index
> > 8a0d743..4af9957 100644
> > --- a/tests/TestSuite_hotplug.py
> > +++ b/tests/TestSuite_hotplug.py
> > @@ -40,6 +40,7 @@ import re
> >  import utils
> >  from test_case import TestCase
> >  from packet import Packet
> > +import os
> >
> >  class TestPortHotPlug(TestCase):
> >      """
> > @@ -144,6 +145,52 @@ class TestPortHotPlug(TestCase):
> >          self.verify(int(sum_packet) == 1, "Insufficient the received package")
> >          self.dut.send_expect("quit","#",60)
> >
> > +    def test_port_detach_attach_for_vhost_user_virtio_user(self):
> > +        vdev = "eth_vhost0,iface=vhost-net,queues=1"
> > +        iface = "vhost-net1"
> > +        path = self.dut.base_dir + os.path.sep + iface
> > +        path = path.replace("~", "/root")
> > +        self.dut.send_expect("rm -rf %s" % iface, "# ")
> > +        cores = self.dut.get_core_list("all")
> > +        self.verify(len(cores) > 8, "insufficient cores for this case")
> > +        eal_param = self.dut.create_eal_parameters(no_pci=True,
> > cores=cores[1:5], vdevs=[vdev], prefix="vhost")
> > +        testpmd_cmd = "./%s/app/testpmd " % self.target + eal_param + ' -- -
> i'
> > +        self.dut.send_expect(testpmd_cmd, "testpmd>", timeout=60)
> > +        self.dut.send_expect("port stop 0", "testpmd>")
> > +        self.dut.send_expect("port detach 0", "Device is detached")
> > +        stats = self.dut.send_expect("ls %s" % path, "#", timeout=3,
> > +                                   alt_session=True, verify=True)
> > +        self.verify(stats==2, 'port detach failed')
> > +        time.sleep(1)
> > +        self.dut.send_expect("port attach eth_vhost1,iface=%s,queues=1" %
> > iface, "Port 0 is attached.")
> > +        self.dut.send_expect("port start 0", "testpmd>")
> > +        out = self.dut.send_expect("ls %s" % path, "#", timeout=3,
> > +                                   alt_session=True, verify=True)
> > +        self.verify(iface in out , 'port attach failed')
> > +
> > +        self.session2 = self.dut.create_session(name="virtio_user")
> > +        eal_param = self.dut.create_eal_parameters(no_pci=True,
> > fixed_prefix="virtio1", cores=cores[5:9])
> > +        testpmd_cmd2 = "%s/%s/app/testpmd " %
> > (self.dut.base_dir,self.target) + eal_param + ' -- -i'
> > +        self.session2.send_expect(testpmd_cmd2, "testpmd>", timeout=60)
> > +        self.session2.send_expect("port attach
> >
> net_virtio_user1,mac=00:01:02:03:04:05,path=%s,queues=1,packed_vq=1,m
> > rg_rxbuf=1,in_order=0" % path, "testpmd")
> > +        self.session2.send_expect("port start 0", "testpmd>", timeout=60)
> > +        out = self.dut.send_expect("ls %s" % path, "#", timeout=3,
> > +                                   alt_session=True, verify=True)
> > +        self.verify(iface in out, 'port attach failed')
> > +        self.dut.send_expect("start", "testpmd")
> > +        self.session2.send_expect("start tx_first 32", "testpmd")
> > +        out = self.session2.send_expect("show port stats 0", "testpmd")
> > +        rx_pkts = int(re.search("RX-packets: (\d+)", out).group(1))
> > +        tx_pkts = int(re.search("TX-packets: (\d+)", out).group(1))
> > +        self.logger.info("rx packets: %d" % rx_pkts)
> > +        self.logger.info("tx packets: %d" % tx_pkts)
> > +        self.verify(rx_pkts != 0 and tx_pkts != 0, "not received packets or
> > transport packets")
> > +        self.session2.send_expect("show port stats 0", "testpmd", timeout=2)
> > +        self.session2.send_expect("stop", "testpmd", timeout=2)
> > +        self.session2.send_expect("quit", "#", timeout=2)
> > +        self.dut.send_expect("stop", "testpmd", timeout=2)
> > +        self.dut.send_expect("quit", "#", timeout=2)
> > +        self.session2.close()
> >
> >      def tear_down(self):
> >          """
> > --
> > 1.8.3.1


  reply	other threads:[~2020-04-02 14:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 11:06 Xiao Qimai
2020-04-02 11:19 ` Xiao, QimaiX
2020-04-02 14:14   ` Wang, Yinan [this message]
2020-04-17  8:58 ` 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=5c15f88944034a2fa9ef59e7419719d8@intel.com \
    --to=yinan.wang@intel.com \
    --cc=dts@dpdk.org \
    --cc=qimaix.xiao@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).