From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 9755658C3 for ; Fri, 27 Nov 2015 09:10:48 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 27 Nov 2015 00:10:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,351,1444719600"; d="scan'208";a="860349985" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 27 Nov 2015 00:10:32 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 27 Nov 2015 00:10:32 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 27 Nov 2015 00:10:31 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.138]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.83]) with mapi id 14.03.0248.002; Fri, 27 Nov 2015 16:10:30 +0800 From: "Liu, Yong" To: "Tu, LijuanX A" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH]framwork: add new parameter for kill_all Thread-Index: AQHRKOGOLb8GN5eMwkOGQMJcK5tSVZ6vhFlQ Date: Fri, 27 Nov 2015 08:10:29 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10F7047B@SHSMSX103.ccr.corp.intel.com> References: <1448607440-26752-1-git-send-email-lijuanx.a.tu@intel.com> In-Reply-To: <1448607440-26752-1-git-send-email-lijuanx.a.tu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-inteldataclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsIiwiaWQiOiIyMDg3NjkzNi1kM2ZkLTQzMTgtYmRiNi1kZjliMjZlOWMwOWEiLCJwcm9wcyI6W3sibiI6IkludGVsRGF0YUNsYXNzaWZpY2F0aW9uIiwidmFscyI6W3sidmFsdWUiOiJDVFBfSUMifV19XX0sIlN1YmplY3RMYWJlbHMiOltdLCJUTUNWZXJzaW9uIjoiMTUuNC4xMC4xOSIsIlRydXN0ZWRMYWJlbEhhc2giOiJJWDA3dzVFYnQrdlU1MjdDUGhZdVNZXC80UnQza21zYnJkMEQxUjVaUFBibz0ifQ== 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]framwork: add new parameter for kill_all 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: , X-List-Received-Date: Fri, 27 Nov 2015 08:10:49 -0000 Thanks, applied. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu > Sent: Friday, November 27, 2015 2:57 PM > To: dts@dpdk.org > Subject: [dts] [PATCH]framwork: add new parameter for kill_all >=20 > in some case ,we will choose session or alt_session to run kill-cmds >=20 > Signed-off-by: Lijuan Tu > --- > framework/crb.py | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/framework/crb.py b/framework/crb.py > index fcbd7d9..afa4e63 100644 > --- a/framework/crb.py > +++ b/framework/crb.py > @@ -337,14 +337,14 @@ class Crb(object): > f.write(contents) > self.session.copy_file_to(fileName) >=20 > - def kill_all(self): > + def kill_all(self, alt_session=3DTrue): > """ > Kill all dpdk applications on CRB. > """ > pids =3D [] > pid_reg =3D r'p(\d+)' > cmd =3D 'lsof -Fp /var/run/.rte_config' > - out =3D self.alt_session.session.send_expect(cmd, "# ", 10) > + out =3D self.send_expect(cmd, "# ", 20, alt_session) > if len(out): > lines =3D out.split('\r\n') > for line in lines: > @@ -352,11 +352,11 @@ class Crb(object): > if m: > pids.append(m.group(1)) > for pid in pids: > - self.alt_session.session.send_expect('kill -9 %s' % pid, '# = ') > + self.send_expect('kill -9 %s' % pid, '# ', 20, alt_session) > self.get_session_output(timeout=3D2) >=20 > cmd =3D 'lsof -Fp /var/run/.rte_hugepage_info' > - out =3D self.alt_session.session.send_expect(cmd, "# ", 10) > + out =3D self.send_expect(cmd, "# ", 20, alt_session) > if len(out) and "No such file or directory" not in out: > self.logger.warning("There are some dpdk process not free > hugepage") > self.logger.warning("**************************************"= ) > -- > 1.8.4.2