From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 2D24FA0096 for ; Tue, 9 Apr 2019 03:41:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 04F504C8F; Tue, 9 Apr 2019 03:41:52 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id D5BD63572 for ; Tue, 9 Apr 2019 03:41:50 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2019 18:41:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,327,1549958400"; d="scan'208";a="336139708" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 08 Apr 2019 18:41:49 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 8 Apr 2019 18:41:49 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 8 Apr 2019 18:41:49 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.164]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.39]) with mapi id 14.03.0415.000; Tue, 9 Apr 2019 09:41:47 +0800 From: "Tu, Lijuan" To: "Li, WenjieX A" , "dts@dpdk.org" CC: "Li, WenjieX A" Thread-Topic: [dts] [PATCH V1] tests/short_live: use a function to detect process Thread-Index: AQHU6sdIYCdt8JpMrkqfZACFG5gFtqYzFTAw Date: Tue, 9 Apr 2019 01:41:46 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BA5E195@SHSMSX101.ccr.corp.intel.com> References: <1554369681-8580-1-git-send-email-wenjiex.a.li@intel.com> In-Reply-To: <1554369681-8580-1-git-send-email-wenjiex.a.li@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.0.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDBmZGYzYzUtODJkZS00YWE4LThhMDctZjg0NjA1YTQyNzkwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUExNZ3lzWlwvUEQzQlh1Wkpqak1HMXZ4cjNyVlZxZVNrWFhSTGtvSFFqV05MV0lEVFVZK3dkNVpRUjBLMXhwXC9VIn0= 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/short_live: use a function to detect process 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 Wenjie Li > Sent: Thursday, April 4, 2019 2:21 AM > To: dts@dpdk.org > Cc: Li, WenjieX A > Subject: [dts] [PATCH V1] tests/short_live: use a function to detect proc= ess >=20 > On some platform, it will take more time to kill the process. Add a funct= ion > to detect the process status, if the process is killed within DELAY_MAX > seconds, break the loop and continue testing, else return "failure". >=20 > Signed-off-by: Wenjie Li > --- > tests/TestSuite_short_live.py | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) >=20 > diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.p= y > index 7da7dd1..c18dac4 100644 > --- a/tests/TestSuite_short_live.py > +++ b/tests/TestSuite_short_live.py > @@ -119,6 +119,18 @@ class TestShortLiveApp(TestCase): > else: > self.verify('PPP' not in out, "Receive test failed") >=20 > + def check_process(self, delay_max=3D10): > + process_file =3D "/var/run/dpdk/rte/config" > + delay =3D 0 > + while delay < delay_max: > + process =3D self.dut.send_expect("lsof %s | wc -l" % process= _file, "#") > + if process !=3D '0': > + time.sleep(1) > + delay =3D delay + 1 > + else: > + break > + self.verify(delay < delay_max, "Failed to kill the process > + within %s seconds" % delay_max) > + > def test_basic_forwarding(self): > """ > Basic rx/tx forwarding test > @@ -161,7 +173,7 @@ class TestShortLiveApp(TestCase): > self.dut.send_expect("pkill -2 testpmd", "#", 60, True) > else: > self.dut.send_expect("pkill -15 testpmd", "#", 60, True) > - time.sleep(2) > + self.check_process() >=20 > def test_clean_up_with_signal_l2fwd(self): > repeat_time =3D 5 > @@ -175,10 +187,9 @@ class TestShortLiveApp(TestCase): > # kill with different Signal > if i%2 =3D=3D 0: > self.dut.send_expect("pkill -2 l2fwd", "#", 60, True) > - time.sleep(2) > else: > self.dut.send_expect("pkill -15 l2fwd", "#", 60, True) > - time.sleep(2) > + self.check_process() >=20 > def test_clean_up_with_signal_l3fwd(self): > repeat_time =3D 5 > @@ -192,10 +203,9 @@ class TestShortLiveApp(TestCase): > # kill with different Signal > if i%2 =3D=3D 0: > self.dut.send_expect("pkill -2 l3fwd", "#", 60, True) > - time.sleep(2) > else: > self.dut.send_expect("pkill -15 l3fwd", "#", 60, True) > - time.sleep(2) > + self.check_process() >=20 > def tear_down(self): > """ > -- > 2.17.2