From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50081.outbound.protection.outlook.com [40.107.5.81]) by dpdk.org (Postfix) with ESMTP id 8AFEE559A for ; Thu, 17 May 2018 12:16:28 +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=ZtZYiEBVqPrKIxt23LM2YOAVa5I58KdZ9wXsHL1C5JY=; b=d1yvTLup5aWZPPMhjfwjpo/fCxwWxATlvvqJIuyu7MNC3UMPL7WLk2Abzo+8DPW2ZBHje1HIfgda/iDWvpFKgt+jF+/6HRRszMymWWkWhsYLjqTPz54+Bk2ssukktOvO1NUmHw1upyUHntlt5WNGquufVALXjq6MmEh8J5+4ZlY= Received: from AM4PR08MB0913.eurprd08.prod.outlook.com (10.166.133.135) by AM4PR08MB2868.eurprd08.prod.outlook.com (10.171.191.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Thu, 17 May 2018 10:16:26 +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; Thu, 17 May 2018 10:16:26 +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: AQHT7DRxHg8HBSTsT0qKWCnspdgyH6QxlJOAgAAb3BCAABz2gIAABTVQgAAVsYCAAcrsMA== Date: Thu, 17 May 2018 10:16:26 +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> <86228AFD5BCD8E4EBFD2B90117B5E81E63041D27@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E63041D27@SHSMSX103.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR08MB2868; 7:pn4zpw+QTXSyeJjkOCUPqfeJKJc5QG0CX6zsXEVgszaqqCQ0OpJ6fQlBqRESyXgBInygOIeOaXtswfLX3qUwkwKud8ck6UC15Gl/N6eN5Cvc3l7kqSY/J/9svoyqlzyjb1XIr5X3934C0NvNzjoU1fngoChi0z3Wk2KjFoiIdiJxOjF+0Zczk3kDbjMb31QeHS9d8Im5vneFuVnxVObaCepiyZTZYuQsmXth9ZTVdFUfmNlvaa0aCyTReH7ih3Zk 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:AM4PR08MB2868; x-ms-traffictypediagnostic: AM4PR08MB2868: 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)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:AM4PR08MB2868; BCL:0; PCL:0; RULEID:; SRVR:AM4PR08MB2868; x-forefront-prvs: 067553F396 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(366004)(376002)(396003)(346002)(13464003)(189003)(199004)(81156014)(446003)(81166006)(478600001)(2501003)(97736004)(14454004)(86362001)(5250100002)(72206003)(68736007)(26005)(7696005)(93886005)(5660300001)(476003)(486006)(4326008)(8936002)(3660700001)(2906002)(7736002)(3280700002)(551544002)(8676002)(25786009)(305945005)(11346002)(3846002)(53936002)(99286004)(2900100001)(9686003)(106356001)(105586002)(6116002)(55016002)(110136005)(76176011)(6346003)(102836004)(53546011)(6506007)(6246003)(6436002)(74316002)(186003)(55236004)(316002)(66066001)(59450400001)(33656002)(229853002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR08MB2868; H:AM4PR08MB0913.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:3; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Phil.Yang@arm.com; x-microsoft-antispam-message-info: XwuIZQRQPUhGgofzFih1E/oFyG4ZmonwP2BdvF9iFczMKi08vLnaL5RPeXn7PMedq9Bxpem8F9HRoVEckYymoGqIzEmWlbe7LvW7DNbp6akNhAnzAZSoqosCF4FFrOJY5Y6jPyeZVGfQJE+0u+NzsS3UnE91PRpnOwpjIKTieXdJQyby/CWBhjXDnilhfA2G 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: 818650a4-d462-40da-2edf-08d5bbdf3fa6 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 818650a4-d462-40da-2edf-08d5bbdf3fa6 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 May 2018 10:16:26.0718 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB2868 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: Thu, 17 May 2018 10:16:28 -0000 Thanks Marvin. You are right, the delay is unnecessary. I'll rework the patch. Thanks, Phil Yang > -----Original Message----- > From: Liu, Yong > Sent: Wednesday, May 16, 2018 2:37 PM > To: Phil Yang ; dts@dpdk.org > Cc: nd > Subject: RE: [PATCH 1/2] framework/qemu_kvm: fix vm control session failu= re >=20 > Phil, > As I known, this command will only send to self.host_dut which should not= be > possible to occur below error. > Is your dut running some other processes? >=20 > [10.169.40.174:vm0] not ready for login > dut.10.169.40.174: Can't login [vm0] on [10.169.40.174], ret= ry 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] >=20 >=20 >=20 > Thanks, > Marvin >=20 > > -----Original Message----- > > From: Phil.Yang@arm.com [mailto:Phil.Yang@arm.com] > > Sent: Wednesday, May 16, 2018 1:23 PM > > To: Liu, Yong ; dts@dpdk.org > > Cc: nd > > Subject: RE: [PATCH 1/2] framework/qemu_kvm: fix vm control session > > failure > > > > 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 > > telnet 24489 root 3u IPv4 256487 0t0 TCP localhost:58776- > > >localhost: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 > > failure > > > > > > Hi Phil, > > > From the error log, issue was caused by lsof command not installed. > > > Qemu module will check whether connection has been established by thi= s > tool. > > > Could you please install it and try again? If that fix the issue, I > > think only shell > > > regression need to be changed. > > > > > > Thanks, > > > Marvin > > > > > > > -----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 che= ck 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 > > Nodes 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 ea= ch > 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 > > 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) > > > > > > > > > > > > # 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 > > 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 > > > > > > > > > > > > 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