From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id E78DD58C3 for ; Fri, 27 Nov 2015 08:01:51 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 26 Nov 2015 23:01:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,350,1444719600"; d="scan'208";a="860319345" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.238.55.12]) by orsmga002.jf.intel.com with ESMTP; 26 Nov 2015 23:01:50 -0800 From: Lijuan Tu To: dts@dpdk.org Date: Fri, 27 Nov 2015 14:57:20 +0800 Message-Id: <1448607440-26752-1-git-send-email-lijuanx.a.tu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [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 07:01:52 -0000 in some case ,we will choose session or alt_session to run kill-cmds Signed-off-by: Lijuan Tu --- framework/crb.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) - def kill_all(self): + def kill_all(self, alt_session=True): """ Kill all dpdk applications on CRB. """ pids = [] pid_reg = r'p(\d+)' cmd = 'lsof -Fp /var/run/.rte_config' - out = self.alt_session.session.send_expect(cmd, "# ", 10) + out = self.send_expect(cmd, "# ", 20, alt_session) if len(out): lines = 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=2) cmd = 'lsof -Fp /var/run/.rte_hugepage_info' - out = self.alt_session.session.send_expect(cmd, "# ", 10) + out = 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