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 5D9891B3F1 for ; Wed, 16 May 2018 03:37:52 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2018 18:37:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,404,1520924400"; d="scan'208";a="49571836" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by FMSMGA003.fm.intel.com with ESMTP; 15 May 2018 18:37:49 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 15 May 2018 18:37:49 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 15 May 2018 18:37:48 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.210]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.179]) with mapi id 14.03.0319.002; Wed, 16 May 2018 09:37:46 +0800 From: "Liu, Yong" To: "phil.yang@arm.com" , "dts@dpdk.org" CC: "nd@arm.com" Thread-Topic: [PATCH 1/2] framework/qemu_kvm: fix vm control session failure Thread-Index: AQHT7DSBi0Wl09Qwok+Ui9XLqGyXvqQxkrKA Date: Wed, 16 May 2018 01:37:47 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E63041953@SHSMSX103.ccr.corp.intel.com> References: <1526378779-10530-1-git-send-email-phil.yang@arm.com> In-Reply-To: <1526378779-10530-1-git-send-email-phil.yang@arm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzQ4NzMyNzUtN2U1MC00MzAzLWE3ODktZGY1MDE0N2Q1ODgxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiI1aWZIOUduZks1ZzAxSDNyTWpNejBKNmtFb3BzeldIMGFRK3RmWXRqaEJHQlNRVkZLZzQ4UzNhblQ3MnBrOUZKIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 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 1/2] framework/qemu_kvm: fix vm control session failure 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: Wed, 16 May 2018 01:37:52 -0000 Thanks, Phil. I'm fine with the changes, just one question about the issue = you met. Qemu module should has taken care of the problem that VM maybe can't login = for the first time.=20 If login action can't be done continuously, I think there may be some kind = of issue here. Could you please check the output of serial session? It may help us to figu= re out the problem. Regards, Marvin > -----Original Message----- > From: phil.yang@arm.com [mailto:phil.yang@arm.com] > Sent: Tuesday, May 15, 2018 6:06 PM > To: dts@dpdk.org > Cc: nd@arm.com; phil.yang@arm.com; Liu, Yong > Subject: [PATCH 1/2] framework/qemu_kvm: fix vm control session failure >=20 > For telnet vm control, it will continuously fail to login to vm when > it doesn't read login prompt during first time connection. So extend > the connection time to get more output each time. >=20 > For socket vm control, added LOGIN_PROMPT into the login status > check for other platform. > Keep the connection longer to avoid failure and reconnection. >=20 > Signed-off-by: Phil Yang > --- > framework/qemu_kvm.py | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) >=20 > diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py > index ec33669..57d16f6 100644 > --- a/framework/qemu_kvm.py > +++ b/framework/qemu_kvm.py > @@ -979,7 +979,7 @@ class QEMUKvm(VirtBase): > Connect to serial port and return connected session for usage > if connected failed will return None > """ > - shell_reg =3D r"(\s*)\[(.*)\]# " > + shell_reg =3D r"(.*)# " > try: > if getattr(self, 'control_session', None) is None: > self.control_session =3D self.host_session > @@ -987,7 +987,7 @@ class QEMUKvm(VirtBase): > self.control_session.send_command("nc -U %s" % > self.serial_path) >=20 > # login message not ouput if timeout too small > - out =3D self.control_session.send_command("", > timeout=3D5).replace('\r', '').replace('\n', '') > + out =3D self.control_session.send_command("", > timeout=3D15).replace('\r', '').replace('\n', '') >=20 > if len(out) =3D=3D 0: > raise StartVMFailedException("Can't get output from > [%s:%s]" % (self.host_dut.crb['My IP'], self.vm_name)) > @@ -1025,7 +1025,7 @@ class QEMUKvm(VirtBase): > Connect to serial port and return connected session for usage > if connected failed will return None > """ > - shell_reg =3D r"(\s*)\[(.*)\]# " > + shell_reg =3D r"(.*)# " > scan_cmd =3D "lsof -i:%d | grep telnet | awk '{print $2}'" % > self.serial_port >=20 > try: > @@ -1034,9 +1034,10 @@ class QEMUKvm(VirtBase): > self.control_session =3D self.host_session >=20 > self.control_session.send_expect("telnet localhost %d" % > self.serial_port, "Connected to localhost", timeout=3Dself.OPERATION_TIME= OUT) > + time.sleep(5) >=20 > # output will be empty if timeout too small > - out =3D self.control_session.send_command("", > timeout=3D5).replace('\r', '').replace('\n', '') > + out =3D self.control_session.send_command("", > timeout=3D10).replace('\r', '').replace('\n', '') >=20 > # if no output from serial port, either connection close or > system hang > if len(out) =3D=3D 0: > @@ -1058,7 +1059,7 @@ class QEMUKvm(VirtBase): > return True >=20 > # login into Redhat os, not sure can work on all > distributions > - if "x86_64 on an x86_64" not in out: > + if ("x86_64 on an x86_64" not in out) and (self.LOGIN_PROMPT > not in out): > print RED("[%s:%s] not ready for login" % > (self.host_dut.crb['My IP'], self.vm_name)) > return False > else: > -- > 2.7.4