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 8EA42A0352; Wed, 6 May 2020 07:48:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 597EA1D6A2; Wed, 6 May 2020 07:48:04 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 186A11D69F for ; Wed, 6 May 2020 07:48:01 +0200 (CEST) IronPort-SDR: wagF/7nxbVEfFUVWQREV/R+zJI+dOJE2IR1Gjd4rrmwW5LNJIhXeKhaJnOjMZ3k7dKq9n+IaUt i9zE2y0qUjmw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2020 22:48:01 -0700 IronPort-SDR: YLBpczgd8fBMJdAdh5lFqZZdYpI2DpREbZblMtH4iWY6k/geoLp8ADWFlJ/8K1cTrJC4V27TdT n83oq1B7DqGA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,358,1583222400"; d="scan'208";a="284499862" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 05 May 2020 22:48:01 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 5 May 2020 22:48:00 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 5 May 2020 22:48:00 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.225]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.248]) with mapi id 14.03.0439.000; Wed, 6 May 2020 13:47:57 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" , "Ma, LihongX" CC: "Mo, YufengX" Thread-Topic: [dts] [PATCH V1 1/1] tests/kni: resolve ping command compatibility Thread-Index: AQHWHsz6LRjnZcmf1kKRO8Sn7hQ/dqialilA Date: Wed, 6 May 2020 05:47:56 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC2215B@SHSMSX101.ccr.corp.intel.com> References: <20200430085547.31123-1-yufengx.mo@intel.com> <20200430085547.31123-2-yufengx.mo@intel.com> In-Reply-To: <20200430085547.31123-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: Thursday, April 30, 2020 4:56 PM > To: dts@dpdk.org; Ma, LihongX > Cc: Mo, YufengX > Subject: [dts] [PATCH V1 1/1] tests/kni: resolve ping command compatibili= ty >=20 >=20 > resolve ping/ping6 command compatibility in low version linux os and high > version linux os. >=20 > -I interface can be either an address, or an interface name. >=20 > Signed-off-by: yufengmx > --- > tests/TestSuite_kni.py | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) >=20 > diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index > 3cbd457..41d8fbe 100644 > --- a/tests/TestSuite_kni.py > +++ b/tests/TestSuite_kni.py > @@ -559,6 +559,7 @@ class TestKni(TestCase): > # Setup IP address on virtual interfaces and tester ports > self.dut.kill_all() > self.start_kni() > + ports_ips =3D {} > for port in self.config['ports']: > virtual_interface =3D self.virtual_interface_name(port) >=20 > @@ -567,14 +568,18 @@ class TestKni(TestCase): > out =3D self.dut.send_expect( > "ifconfig %s up" % virtual_interface, "# ") > time.sleep(5) > + v_intf_ip =3D f"192.168.{port}.1" > + tx_intf_ip =3D f"192.168.{port}.2" > self.dut.send_expect( > - "ifconfig %s 192.168.%d.1 netmask 255.255.255.192" % > (virtual_interface, port), "# ") > + "ifconfig %s %s netmask 255.255.255.192" % (v_intf_ip, > + port), "# ") > self.tester.send_expect( > - "ifconfig %s 192.168.%d.2 netmask 255.255.255.192" % > (tx_interface, port), "# ") > + "ifconfig %s %s netmask 255.255.255.192" % (tx_intf_ip,= port), "# ") > + ports_ips[port] =3D [tx_intf_ip, v_intf_ip] > self.tester.enable_ipv6(tx_interface) > time.sleep(5) > # Send ping requests and check for answers > for port in self.config['ports']: > + tx_intf_ip, v_intf_ip =3D ports_ips[port] >=20 > tx_port =3D self.tester.get_local_port(port) > tx_interface =3D self.tester.get_interface(tx_port) > @@ -582,17 +587,17 @@ class TestKni(TestCase): > virtual_interface =3D self.virtual_interface_name(port) >=20 > out =3D self.dut.send_expect( > - "ping -w 2 -I %s 192.168.%d.2" % (virtual_interface, por= t), "# ", 10) > + "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") >=20 > out =3D self.tester.send_expect( > - "ping -w 1 -I %s 192.168.%d.1" % (tx_interface, port), "= # ", 10) > + "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") >=20 > out =3D self.dut.send_expect( > - "ping -w 1 -I %s 192.168.%d.123" % (virtual_interface, p= ort), "# ", 10) > + "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") >=20 > @@ -601,14 +606,14 @@ class TestKni(TestCase): > ipv6_address =3D out.split('\r\n')[0] >=20 > out =3D self.dut.send_expect("ping6 -w 1 -I %s %s" % > - (virtual_interface, str(ipv6_addr= ess)), "# ", 10) > + (v_intf_ip, 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") >=20 > out =3D self.tester.send_expect( > - "ping6 -w 1 -I %s %s" % (tx_interface, str(ipv6_address)= ), "# ", 10) > + "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") >=20 > @@ -621,7 +626,7 @@ class TestKni(TestCase): > break >=20 > out =3D self.dut.send_expect("ping6 -w 1 -I %s %s" % > - (virtual_interface, ''.join(ipv6l= ist)), "# ", 10) > + (v_intf_ip, ''.join(ipv6list)), > + "# ", 10) > self.verify( > "0 received, 100% packet loss" in out, "ping6 not suppor= ted") > # remove ip from tester > -- > 2.21.0