From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0089.outbound.protection.outlook.com [104.47.1.89]) by dpdk.org (Postfix) with ESMTP id C5E351B647 for ; Wed, 16 May 2018 07:23:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GX9/ZJk+ehrEpfZO58blPxWFx63NAo9mHCw9eodJ8f0=; b=OHU4Q0Db6Rt43k73pArzdTICxN3Es0pjAkWWR7bvgLIf6jyc4pIes8RI4O8V4IBEt+B3zS6ZpV4ltqjfPTDX+WJBGM/19HUhJt2DHGuJ2308uyykDWMM+fA/pR6SyhQtcHjg6z3gLzMP+M26Ipi/psm9dZ6ndyGxjdiJiDqwtG8= Received: from AM4PR08MB0913.eurprd08.prod.outlook.com (10.166.133.135) by AM4PR08MB1076.eurprd08.prod.outlook.com (10.167.91.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.776.11; Wed, 16 May 2018 05:23:00 +0000 Received: from AM4PR08MB0913.eurprd08.prod.outlook.com ([fe80::f960:8c43:9979:cf18]) by AM4PR08MB0913.eurprd08.prod.outlook.com ([fe80::f960:8c43:9979:cf18%6]) with mapi id 15.20.0776.010; Wed, 16 May 2018 05:23:00 +0000 From: Phil Yang To: "Liu, Yong" , "dts@dpdk.org" CC: nd Thread-Topic: [PATCH 1/2] framework/qemu_kvm: fix vm control session failure Thread-Index: AQHT7DRxHg8HBSTsT0qKWCnspdgyH6QxlJOAgAAb3BCAABz2gIAABTVQ Date: Wed, 16 May 2018 05:22:59 +0000 Message-ID: References: <1526378779-10530-1-git-send-email-phil.yang@arm.com> <86228AFD5BCD8E4EBFD2B90117B5E81E63041953@SHSMSX103.ccr.corp.intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E63041AA3@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E63041AA3@SHSMSX103.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Phil.Yang@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR08MB1076; 7:RcNnhb0wN2OJFJ9xIb66Y2McM20SjrBi4wYSZFnXiC5M4vZOdiXe9Sw8K1mGYzEdxMlnlilh81qKuml1SQj+RHEhYkRsX4/jrhh36FUgzws8dQ/zL9l3SWVejFn1GiKnheWlkKtDzsVmKp+uBP8GqXxtz9wPrH79KfqoK2SRmkYCOfex/okYKthhjAbgG3T99Ds6Iv2SE/XqPSUK1GeKsssVposDCZY283Q1YyjZWeBli3kGHoNXNkk/cV2XS6a1 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM4PR08MB1076; x-ms-traffictypediagnostic: AM4PR08MB1076: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(265634631926514)(788757137089)(21532816269658)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:AM4PR08MB1076; BCL:0; PCL:0; RULEID:; SRVR:AM4PR08MB1076; x-forefront-prvs: 0674DC6DD3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(396003)(39860400002)(39380400002)(13464003)(199004)(189003)(55016002)(6436002)(4326008)(2906002)(53936002)(3280700002)(81156014)(3660700001)(6246003)(81166006)(8676002)(9686003)(55236004)(66066001)(76176011)(478600001)(102836004)(72206003)(2900100001)(106356001)(6506007)(59450400001)(105586002)(53546011)(99286004)(229853002)(74316002)(186003)(7696005)(7736002)(110136005)(5660300001)(26005)(486006)(68736007)(93886005)(8936002)(3846002)(6116002)(305945005)(86362001)(14454004)(5250100002)(551544002)(2501003)(33656002)(11346002)(316002)(97736004)(446003)(25786009)(476003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR08MB1076; H:AM4PR08MB0913.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:3; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: iYyvjUdsCARmNQj+Ljx7lcvk5YP8BQLzTjXotmJe5GsDUklak7fmPw+jGrUWxhnC+36qjAMXuGSSDKjt6V7M884Y3Tegv1sPpQ/qpjzufoIs4cBBFwlo2xB43TvcEbcuf2ZSqg531QVHktOxozHGuCagkFS93KYgemRl/95ObsLJzi+a3BG1jEICShL8oA8G spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 7bdb1afb-3180-4aac-3add-08d5baed1722 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bdb1afb-3180-4aac-3add-08d5baed1722 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2018 05:22:59.9947 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB1076 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 05:23:04 -0000 Hi Marvin, The DUT had installed lsof. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D phil@net-arm-c2400_01:~$ sudo lsof -i:7000 | grep telnet=20 telnet 24489 root 3u IPv4 256487 0t0 TCP localhost:58776->loca= lhost:afs3-fileserver (ESTABLISHED) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Thanks, Phil Yang > -----Original Message----- > From: Liu, Yong > Sent: Wednesday, May 16, 2018 1:01 PM > To: Phil Yang ; dts@dpdk.org > Cc: nd > Subject: RE: [PATCH 1/2] framework/qemu_kvm: fix vm control session failu= re >=20 > Hi Phil, > From the error log, issue was caused by lsof command not installed. Qemu > module will check whether connection has been established by this tool. > Could you please install it and try again? If that fix the issue, I think= only shell > regression need to be changed. >=20 > Thanks, > Marvin >=20 > > -----Original Message----- > > From: Phil.Yang@arm.com [mailto:Phil.Yang@arm.com] > > Sent: Wednesday, May 16, 2018 11:56 AM > > To: Liu, Yong ; dts@dpdk.org > > Cc: nd > > Subject: RE: [PATCH 1/2] framework/qemu_kvm: fix vm control session > > failure > > > > Hi Marvin, > > > > For telnet vm control I've encountered serial connection got no repose > > after first time login failure. Below is the log. Please check it. > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > > m] Started Load/Save Random Seed.[\x1b[0;32m OK \x1b[0m] Started > > Apply Kernel Variables.[\x1b[0;32m OK \x1b[0m] Mounted FUSE Control > > File System.[\x1b[0;32m OK \x1b[0m] Mounted Kernel Configuration > > File System.[\x1b[0;32m OK \x1b[0m] Started Create Static Device Node= s in > > /dev. Starting udev Kernel Device Manager...[\x1b[0;32m OK > > \x1b[0m] Reached target Local File Systems (Pre).[\x1b[0;32m OK > > \x1b[0m] Started udev Kernel Device Manager.[\x1b[0;32m OK \x1b[0m] > > Started Dispatch Password Requests to Console Directory > > Watch.[\x1b[0;32m OK \x1b[0m] Reached target Local Encrypted > > Volumes.[\x1b[0;32m OK \x1b[0m] Activated swap /swapfile.[\x1b[0;32m > > OK \x1b[0m] Reached target Swap.[\x1b[0;32m OK \x1b[0m] Started > > Flush Journal to Persistent Storage." > > (Pdb) c > > [10.169.40.174:vm0] not ready for login > > dut.10.169.40.174: Can't login [vm0] on [10.169.40.174], > > retry 1 times!!! > > dut.10.169.40.174: lsof -i:7002 | grep telnet | awk > > '{print $2}' > > Exception happened in [lsof -i:7002 | grep telnet | awk '{print $2}'] > > and output is [lsof -i:7002 | grep telnet | awk '{print $2}' > > Command not found] > > Traceback (most recent call last): > > File "/root/dpdk-dts/framework/virt_base.py", line 284, in start > > self._start_vm() > > File "/root/dpdk-dts/framework/qemu_kvm.py", line 1269, in _start_vm > > self.__wait_vm_ready() > > TimeoutException: TIMEOUT on lsof -i:7002 | grep telnet | awk '{print $= 2}' > > Unhandled expection > > TestVhostPmdXstats: Failure for Set up VM ENV failed > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > So I added a delay to flush the useless output. Which can resolve this > > issue. > > BTW, only telnet connection has this defect. This fix is kind of > > workaround, but It works. > > > > Thanks, > > Phil Yang > > > > > -----Original Message----- > > > From: Liu, Yong > > > Sent: Wednesday, May 16, 2018 9:38 AM > > > To: Phil Yang ; dts@dpdk.org > > > Cc: nd > > > Subject: RE: [PATCH 1/2] framework/qemu_kvm: fix vm control session > > failure > > > > > > 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. > > > 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 > > figure 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 > > > > > > > > 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. > > > > > > > > For socket vm control, added LOGIN_PROMPT into the login status > > > > check for other platform. > > > > Keep the connection longer to avoid failure and reconnection. > > > > > > > > Signed-off-by: Phil Yang > > > > --- > > > > framework/qemu_kvm.py | 11 ++++++----- > > > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > > > > > 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 us= age > > > > 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) > > > > > > > > # 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', '') > > > > > > > > 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 us= age > > > > 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 > > > > > > > > try: > > > > @@ -1034,9 +1034,10 @@ class QEMUKvm(VirtBase): > > > > self.control_session =3D self.host_session > > > > > > > > self.control_session.send_expect("telnet > > > > localhost %d" % self.serial_port, "Connected to localhost", > > > > timeout=3Dself.OPERATION_TIMEOUT) > > > > + time.sleep(5) > > > > > > > > # 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', '') > > > > > > > > # 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 > > > > > > > > # 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