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 1FBFFA04C1; Fri, 22 Nov 2019 07:10:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CAE462C28; Fri, 22 Nov 2019 07:09:59 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id A1AE12BF9 for ; Fri, 22 Nov 2019 07:09:58 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2019 22:09:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,228,1571727600"; d="scan'208";a="407476567" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 21 Nov 2019 22:09:57 -0800 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 21 Nov 2019 22:09:56 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 21 Nov 2019 22:09:56 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.213]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.63]) with mapi id 14.03.0439.000; Fri, 22 Nov 2019 14:09:55 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "Peng, ZhihongX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit. Thread-Index: AQHVlHicQSlB5q78C0CsCNLcgQaX/ad+xd2AgAAC7YCAAW5ZAIAWlOxA Date: Fri, 22 Nov 2019 06:09:54 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB67836@SHSMSX101.ccr.corp.intel.com> References: <20191106075430.15566-1-zhihongx.peng@intel.com> <218C9AAF1879E445B4BC31BDA3D08502964DE8@CDSMSX102.ccr.corp.intel.com> In-Reply-To: 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-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjA1NWE1ZGItNTYxNC00NDE4LThiMTQtZTU3MzU2NDk5YTE2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVlg0MkpkVHpTQmNpUnF5T3pQN3pTUVwvTlhFM1FcLzkyN2pHTlgyS1BiRGR6RUhDSVhaam43cm43aHlCTmRQVHF4In0= 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_kernelpf_iavf.py:An abnormal exit needs to execute the same command as a normal exit. 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" Tear_down will be executed whatever the case is successful or failure. Ever= y case will start from set_up and end with tear_down. So I don't think it's reasonable to have this patch. Another sighting, it's better to get current "trust setting" before you cha= nge it, and then restore it after your testing. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Ma, LihongX > Sent: Friday, November 8, 2019 1:12 PM > To: Peng, ZhihongX ; dts@dpdk.org > Subject: Re: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnorma= l > exit needs to execute the same command as a normal exit. >=20 > If like that, I think we should put more time to verify it. >=20 > -----Original Message----- > From: Peng, ZhihongX > Sent: Thursday, November 7, 2019 3:21 PM > To: Ma, LihongX ; dts@dpdk.org > Subject: RE: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnorma= l > exit needs to execute the same command as a normal exit. >=20 > This case is executed twice, because the case was executed once when it w= as > successful, so the exception exit is executed once for consistency. >=20 > -----Original Message----- > From: Ma, LihongX > Sent: Thursday, November 7, 2019 3:11 PM > To: Peng, ZhihongX ; dts@dpdk.org > Cc: Peng, ZhihongX > Subject: RE: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnorma= l > exit needs to execute the same command as a normal exit. >=20 > Hi, zhihong > I saw the cmd ' self.dut.send_expect("ip link set dev %s vf 0 trust off" = % > self.host_intf, "# ")' have been execute in tear_down So I think you don'= t > need execute it before every verify. >=20 > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Peng Zhihong > Sent: Wednesday, November 6, 2019 3:55 PM > To: dts@dpdk.org > Cc: Peng, ZhihongX > Subject: [dts] [PATCH V1] tests/TestSuite_kernelpf_iavf.py:An abnormal ex= it > needs to execute the same command as a normal exit. >=20 > An abnormal exit needs to execute the same command as a normal exit. >=20 > Signed-off-by: Peng Zhihong > --- > tests/TestSuite_kernelpf_iavf.py | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) >=20 > diff --git a/tests/TestSuite_kernelpf_iavf.py > b/tests/TestSuite_kernelpf_iavf.py > index 668eb28..89c22d3 100644 > --- a/tests/TestSuite_kernelpf_iavf.py > +++ b/tests/TestSuite_kernelpf_iavf.py > @@ -47,6 +47,7 @@ from pmd_output import PmdOutput from settings > import HEADER_SIZE from packet import Packet from utils import RED > +from exception import VerifyFailure >=20 > VM_CORES_MASK =3D 'all' > MAX_VLAN =3D 4095 > @@ -336,18 +337,27 @@ class TestKernelpfIavf(TestCase): > self.vm_testpmd.execute_cmd("start") > self.send_random_pkt(self.vf_mac, count=3D1) > out =3D self.vm_dut.get_session_output() > - self.verify(self.vf_mac in out, 'vf receive pkt fail with curren= t mac') > + if self.vf_mac not in out: > + self.dut.send_expect("ip link set dev %s vf 0 trust off" % s= elf.host_intf, > "# ") > + raise VerifyFailure('allmulti all off vf receive pkt fail > + with current mac') > self.send_random_pkt(multicast_mac, count=3D1) > out =3D self.vm_dut.get_session_output() > - self.verify(multicast_mac not in out, 'vf receive pkt with multi= cast mac') > + if multicast_mac in out: > + self.dut.send_expect("ip link set dev %s vf 0 trust off" % s= elf.host_intf, > "# ") > + raise VerifyFailure('allmulti all off vf receive pkt with > + multicast mac') >=20 > self.vm_testpmd.execute_cmd("set allmulti all on") > self.send_random_pkt(self.vf_mac, count=3D1) > out =3D self.vm_dut.get_session_output() > - self.verify(self.vf_mac in out, 'vf receive pkt fail with curren= t mac') > + if self.vf_mac not in out: > + self.dut.send_expect("ip link set dev %s vf 0 trust off" % s= elf.host_intf, > "# ") > + raise VerifyFailure('allmulti all on vf receive pkt fail > + with current mac') > self.send_random_pkt(multicast_mac, count=3D1) > out =3D self.vm_dut.get_session_output() > - self.verify(multicast_mac in out, 'vf receive pkt fail with mult= icast mac') > + if multicast_mac not in out: > + self.dut.send_expect("ip link set dev %s vf 0 trust off" % s= elf.host_intf, > "# ") > + raise VerifyFailure('allmulti all on vf receive pkt fail > + with multicast mac') > + > self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.= host_intf, > "# ") >=20 > def test_vf_broadcast(self): > -- > 2.17.1