From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4FBD8A058A; Fri, 17 Apr 2020 10:58:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4490B1DEBF; Fri, 17 Apr 2020 10:58:33 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 723DE1DB41 for ; Fri, 17 Apr 2020 10:58:31 +0200 (CEST) IronPort-SDR: RnERbnlGWLhwIpqBntsDQT84bLjPmHwbY8Djcn2P3nrmGDqXAGphCmaJuU5cQeKEyhsotLAHET yaAbuXZcY5EQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2020 01:58:30 -0700 IronPort-SDR: 6s0AGxYtGQqbdcpa/L+nNb7N1XScVqluEpCY3GdIBK5e8NRwr/yKTedoP6XAANSFJDjcmbJ/ko 975sYukLPahQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,394,1580803200"; d="scan'208";a="299560588" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 17 Apr 2020 01:58:30 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 17 Apr 2020 01:58:30 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 17 Apr 2020 01:58:29 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.225]) with mapi id 14.03.0439.000; Fri, 17 Apr 2020 16:58:27 +0800 From: "Tu, Lijuan" To: "Xiao, QimaiX" , "dts@dpdk.org" CC: "Xiao, QimaiX" Thread-Topic: [dts] [PATCH V1]tests/TestSuite_hotplug: add virtio case for hotplug Thread-Index: AQHWCN+kY0gzkTHfGUurmg4Hy0MDNqh9GvOg Date: Fri, 17 Apr 2020 08:58:26 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC0BE15@SHSMSX101.ccr.corp.intel.com> References: <1585825584-433414-1-git-send-email-qimaix.xiao@intel.com> In-Reply-To: <1585825584-433414-1-git-send-email-qimaix.xiao@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1]tests/TestSuite_hotplug: add virtio case for hotplug X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Xiao Qimai > Sent: Thursday, April 2, 2020 7:06 PM > To: dts@dpdk.org > Cc: Xiao, QimaiX > Subject: [dts] [PATCH V1]tests/TestSuite_hotplug: add virtio case for hot= plug >=20 > *. add virtio case for hotplug >=20 > Signed-off-by: Xiao Qimai > --- > tests/TestSuite_hotplug.py | 47 > ++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 47 insertions(+) >=20 > diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py inde= x > 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 >=20 > class TestPortHotPlug(TestCase): > """ > @@ -144,6 +145,52 @@ class TestPortHotPlug(TestCase): > self.verify(int(sum_packet) =3D=3D 1, "Insufficient the received= package") > self.dut.send_expect("quit","#",60) >=20 > + def test_port_detach_attach_for_vhost_user_virtio_user(self): > + vdev =3D "eth_vhost0,iface=3Dvhost-net,queues=3D1" > + iface =3D "vhost-net1" > + path =3D self.dut.base_dir + os.path.sep + iface > + path =3D path.replace("~", "/root") > + self.dut.send_expect("rm -rf %s" % iface, "# ") > + cores =3D self.dut.get_core_list("all") > + self.verify(len(cores) > 8, "insufficient cores for this case") > + eal_param =3D self.dut.create_eal_parameters(no_pci=3DTrue, > cores=3Dcores[1:5], vdevs=3D[vdev], prefix=3D"vhost") > + testpmd_cmd =3D "./%s/app/testpmd " % self.target + eal_param + = ' -- -i' > + self.dut.send_expect(testpmd_cmd, "testpmd>", timeout=3D60) > + self.dut.send_expect("port stop 0", "testpmd>") > + self.dut.send_expect("port detach 0", "Device is detached") > + stats =3D self.dut.send_expect("ls %s" % path, "#", timeout=3D3, > + alt_session=3DTrue, verify=3DTrue) > + self.verify(stats=3D=3D2, 'port detach failed') > + time.sleep(1) > + self.dut.send_expect("port attach eth_vhost1,iface=3D%s,queues= =3D1" % > iface, "Port 0 is attached.") > + self.dut.send_expect("port start 0", "testpmd>") > + out =3D self.dut.send_expect("ls %s" % path, "#", timeout=3D3, > + alt_session=3DTrue, verify=3DTrue) > + self.verify(iface in out , 'port attach failed') > + > + self.session2 =3D self.dut.create_session(name=3D"virtio_user") > + eal_param =3D self.dut.create_eal_parameters(no_pci=3DTrue, > fixed_prefix=3D"virtio1", cores=3Dcores[5:9]) > + testpmd_cmd2 =3D "%s/%s/app/testpmd " % (self.dut.base_dir,self.= target) > + eal_param + ' -- -i' > + self.session2.send_expect(testpmd_cmd2, "testpmd>", timeout=3D60= ) > + self.session2.send_expect("port attach > net_virtio_user1,mac=3D00:01:02:03:04:05,path=3D%s,queues=3D1,packed_vq= =3D1,mr > g_rxbuf=3D1,in_order=3D0" % path, "testpmd") > + self.session2.send_expect("port start 0", "testpmd>", timeout=3D= 60) > + out =3D self.dut.send_expect("ls %s" % path, "#", timeout=3D3, > + alt_session=3DTrue, verify=3DTrue) > + self.verify(iface in out, 'port attach failed') > + self.dut.send_expect("start", "testpmd") > + self.session2.send_expect("start tx_first 32", "testpmd") > + out =3D self.session2.send_expect("show port stats 0", "testpmd"= ) > + rx_pkts =3D int(re.search("RX-packets: (\d+)", out).group(1)) > + tx_pkts =3D 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 !=3D 0 and tx_pkts !=3D 0, "not received pac= kets or > transport packets") > + self.session2.send_expect("show port stats 0", "testpmd", timeou= t=3D2) > + self.session2.send_expect("stop", "testpmd", timeout=3D2) > + self.session2.send_expect("quit", "#", timeout=3D2) > + self.dut.send_expect("stop", "testpmd", timeout=3D2) > + self.dut.send_expect("quit", "#", timeout=3D2) > + self.session2.close() >=20 > def tear_down(self): > """ > -- > 1.8.3.1