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 8A04AA0562; Thu, 2 Apr 2020 16:15:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 50C3F2BCE; Thu, 2 Apr 2020 16:15:00 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 61C9A2BAF for ; Thu, 2 Apr 2020 16:14:57 +0200 (CEST) IronPort-SDR: ZjnSQliP6QU1L5r9FU9lCwx0iQQ19RN1nL4fFVGNUDzz/bykysr0PAOROZATBr7BMOt6MgLUtQ 9ylPlzgDCiTg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2020 07:14:56 -0700 IronPort-SDR: IZYQvuAh7Jzpg59nVIPu/xGAZIR4/KdV5KIQmLqfSAlb/3kTNPFboylsBV1ysFxQuOnTLvS1Zw 9kMgfe02/x5A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,335,1580803200"; d="scan'208";a="273573048" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 02 Apr 2020 07:14:56 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Apr 2020 07:14:56 -0700 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 2 Apr 2020 22:14:53 +0800 Received: from shsmsx603.ccr.corp.intel.com ([10.109.6.143]) by SHSMSX603.ccr.corp.intel.com ([10.109.6.143]) with mapi id 15.01.1713.004; Thu, 2 Apr 2020 22:14:53 +0800 From: "Wang, Yinan" To: "Xiao, QimaiX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1]tests/TestSuite_hotplug: add virtio case for hotplug Thread-Index: AQHWCN+k9wRunUwdg0yW9qqWBSDqg6hlKS8AgAC3MnA= Date: Thu, 2 Apr 2020 14:14:53 +0000 Message-ID: <5c15f88944034a2fa9ef59e7419719d8@intel.com> References: <1585825584-433414-1-git-send-email-qimaix.xiao@intel.com> <8800ae6b3bf3490dba394ba07a1ec3f7@intel.com> In-Reply-To: <8800ae6b3bf3490dba394ba07a1ec3f7@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="iso-2022-jp" 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" Acked-by: Wang, Yinan > -----Original Message----- > From: dts On Behalf Of Xiao, QimaiX > Sent: 2020=1B$BG/=1B(B4=1B$B7n=1B(B2=1B$BF|=1B(B 19:19 > To: dts@dpdk.org > Subject: Re: [dts] [PATCH V1]tests/TestSuite_hotplug: add virtio case for > hotplug >=20 > Tested-by: Xiao, QimaiX >=20 > Regards, > Xiao Qimai >=20 >=20 > > -----Original Message----- > > From: Xiao, QimaiX > > 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 ho= tplug > > > > *. add virtio case for hotplug > > > > Signed-off-by: Xiao Qimai > > --- > > tests/TestSuite_hotplug.py | 47 > > ++++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 47 insertions(+) > > > > diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py in= dex > > 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) =3D=3D 1, "Insufficient the receiv= ed package") > > self.dut.send_expect("quit","#",60) > > > > + 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=3D= 3, > > + 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=3D= 60) > > + self.session2.send_expect("port attach > > > net_virtio_user1,mac=3D00:01:02:03:04:05,path=3D%s,queues=3D1,packed_vq= =3D1,m > > rg_rxbuf=3D1,in_order=3D0" % path, "testpmd") > > + self.session2.send_expect("port start 0", "testpmd>", timeout= =3D60) > > + 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", "testpm= d") > > + 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 p= ackets or > > transport packets") > > + self.session2.send_expect("show port stats 0", "testpmd", time= out=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() > > > > def tear_down(self): > > """ > > -- > > 1.8.3.1