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 1C6ACA04A2; Tue, 12 May 2020 09:37:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CC4371BFF6; Tue, 12 May 2020 09:37:26 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A623D1BFB4 for ; Tue, 12 May 2020 09:37:25 +0200 (CEST) IronPort-SDR: Ow3A2fZ7abIE8xrOTlJUTC724Zfu7tSZSq0lbawjqltVOpWuei5WaSlOwvNKoGC3bhzge+4Qzm wY4LIqGhLiGQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2020 00:37:24 -0700 IronPort-SDR: jPMjKfUgPs2JB8DdVQWXOB7Ie+UxbvOa2CnggyY8mAf/EDJNmSfkFpM5qUW6cHMieRFn84jnUX IjDSY/R4JCbA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,383,1583222400"; d="scan'208";a="297939121" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga008.jf.intel.com with ESMTP; 12 May 2020 00:37:24 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 12 May 2020 00:37:23 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 12 May 2020 00:37:23 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.225]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.91]) with mapi id 14.03.0439.000; Tue, 12 May 2020 15:37:20 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" , "Ma, LihongX" , "Zhang, XiX" CC: "Mo, YufengX" Thread-Topic: [dts] [PATCH V1 1/1] tests/kni: resolve ping command compatibility Thread-Index: AQHWJzvTrZIqwfzMcka8E606suofJKikEddg Date: Tue, 12 May 2020 07:37:20 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC2A3B9@SHSMSX101.ccr.corp.intel.com> References: <20200511022959.11225-1-yufengx.mo@intel.com> <20200511022959.11225-2-yufengx.mo@intel.com> In-Reply-To: <20200511022959.11225-2-yufengx.mo@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 1/1] tests/kni: resolve ping command compatibility 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 yufengmx > Sent: Monday, May 11, 2020 10:30 AM > To: dts@dpdk.org; Ma, LihongX ; Zhang, XiX > > Cc: Mo, YufengX > Subject: [dts] [PATCH V1 1/1] tests/kni: resolve ping command compatibili= ty >=20 >=20 > fix previous version missing merged code. > add more redundant processing. >=20 > Signed-off-by: yufengmx > --- > tests/TestSuite_kni.py | 53 ++++++++++++++++++++++++++---------------- > 1 file changed, 33 insertions(+), 20 deletions(-) >=20 > diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index > 41d8fbe..2b2281d 100644 > --- a/tests/TestSuite_kni.py > +++ b/tests/TestSuite_kni.py > @@ -571,9 +571,9 @@ class TestKni(TestCase): > v_intf_ip =3D f"192.168.{port}.1" > tx_intf_ip =3D f"192.168.{port}.2" > self.dut.send_expect( > - "ifconfig %s %s netmask 255.255.255.192" % (v_intf_ip, = port), "# ") > + "ifconfig %s %s netmask 255.255.255.192" % > + (virtual_interface, v_intf_ip), "# ") > self.tester.send_expect( > - "ifconfig %s %s netmask 255.255.255.192" % (tx_intf_ip,= port), "# ") > + "ifconfig %s %s netmask 255.255.255.192" % > + (tx_interface, tx_intf_ip), "# ") > ports_ips[port] =3D [tx_intf_ip, v_intf_ip] > self.tester.enable_ipv6(tx_interface) > time.sleep(5) > @@ -588,35 +588,45 @@ class TestKni(TestCase): >=20 > out =3D self.dut.send_expect( > "ping -w 2 -I %s 192.168.%d.2" % (v_intf_ip, port), "# "= , 10) > - self.verify("64 bytes from 192.168.%d.2:" % > - port in out, "ping not supported") > - > + out1 =3D self.dut.send_expect( > + "ping -w 2 -I %s 192.168.%d.2" % (virtual_interface, por= t), "# ", 10) > + expected_str =3D "64 bytes from 192.168.%d.2:" % port > + self.verify(any([expected_str in out, expected_str in out1])= , > + "ping not supported") > out =3D self.tester.send_expect( > "ping -w 1 -I %s 192.168.%d.1" % (tx_intf_ip, port), "# = ", 10) > - self.verify("64 bytes from 192.168.%d.1:" % > - port in out, "kni cannot reply ping packet") > - > + out1 =3D self.tester.send_expect( > + "ping -w 1 -I %s 192.168.%d.1" % (tx_interface, port), "= # ", 10) > + expected_str =3D "64 bytes from 192.168.%d.1:" % port > + self.verify(any([expected_str in out, expected_str in out1])= , > + "kni cannot reply ping packet") > out =3D self.dut.send_expect( > "ping -w 1 -I %s 192.168.%d.123" % (v_intf_ip, port), "#= ", 10) > - self.verify( > - "0 received, 100% packet loss" in out, "ping not support= ed") > - > + out1 =3D self.dut.send_expect( > + "ping -w 1 -I %s 192.168.%d.123" % (virtual_interface, p= ort), "# ", > 10) > + expected_str =3D "0 received, 100% packet loss" > + self.verify(all([expected_str in out, expected_str in out1])= , > + "ping not supported") > out =3D self.dut.send_expect( > "ip -family inet6 address show dev %s | awk '/inet6/ { p= rint $2 }'| > cut -d'/' -f1" % virtual_interface, "# ", 10) > ipv6_address =3D out.split('\r\n')[0] > - > + self.tester.send_expect("ifconfig %s up" % tx_interface, "# > + ") > out =3D self.dut.send_expect("ping6 -w 1 -I %s %s" % > (v_intf_ip, str(ipv6_address)), "= # ", 10) > + out1 =3D self.dut.send_expect("ping6 -w 1 -I %s %s" % > + (virtual_interface, > + str(ipv6_address)), "# ", 10) > # FC25 ping6 output info is "64 bytes from ipv6_address%v: > icmp_seq=3D1 ttl=3D64" > # other os ping6 output is "64 bytes from ipv6_address: icmp= _seq=3D1 > ttl=3D64" > - self.verify("64 bytes from %s" % > - ipv6_address in out, "ping6 not supported") > - > + expected_str =3D "64 bytes from %s" % ipv6_address > + self.verify(any([expected_str in out, expected_str in out1])= , > + "ping6 not supported") > out =3D self.tester.send_expect( > "ping6 -w 1 -I %s %s" % (tx_intf_ip, str(ipv6_address)),= "# ", 10) > - self.verify("64 bytes from %s" % > - ipv6_address in out, "kni cannot reply ping6 pac= ket") > - > + out1 =3D self.tester.send_expect( > + "ping6 -w 1 -I %s %s" % (tx_interface, str(ipv6_address)= ), "# ", 10) > + expected_str =3D "64 bytes from %s" % ipv6_address > + self.verify(any([expected_str in out, expected_str in out1])= , > + "kni cannot reply ping6 packet") > ipv6list =3D list(ipv6_address) > for j in range(10): > if str(j) =3D=3D ipv6list[-1]: > @@ -627,8 +637,11 @@ class TestKni(TestCase): >=20 > out =3D self.dut.send_expect("ping6 -w 1 -I %s %s" % > (v_intf_ip, ''.join(ipv6list)), "= # ", 10) > - self.verify( > - "0 received, 100% packet loss" in out, "ping6 not suppor= ted") > + out1 =3D self.dut.send_expect("ping6 -w 1 -I %s %s" % > + (virtual_interface, ''.join(ipv6l= ist)), "# ", 10) > + expected_str =3D "0 received, 100% packet loss" > + self.verify(any([expected_str in out, expected_str in out1])= , > + "ping6 not supported") > # remove ip from tester > self.tester.send_expect( > "ip addr del 192.168.%d.2 dev %s" % (port, tx_interface= ), "# ") > -- > 2.21.0