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 4C46F2B94 for ; Mon, 19 Dec 2016 04:50:32 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP; 18 Dec 2016 19:50:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,372,1477983600"; d="scan'208";a="44509625" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 18 Dec 2016 19:50:31 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 18 Dec 2016 19:50:31 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 18 Dec 2016 19:50:31 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.11]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.97]) with mapi id 14.03.0248.002; Mon, 19 Dec 2016 11:50:29 +0800 From: "Liu, Yong" To: "Yao, Lei A" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid file uncomplete during scp file from host to VM Thread-Index: AQHSV2kXVBGqOensEEmnsnNmb4kZh6EOlhqQ//+BWgCAAIc54P//fMqAgACKc2A= Date: Mon, 19 Dec 2016 03:50:28 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62D1A85F@SHSMSX103.ccr.corp.intel.com> References: <1481871227-4334-1-git-send-email-lei.a.yao@intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E62D1A457@SHSMSX103.ccr.corp.intel.com> <2DBBFF226F7CF64BAFCA79B681719D953A134F28@shsmsx102.ccr.corp.intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E62D1A564@SHSMSX103.ccr.corp.intel.com> <2DBBFF226F7CF64BAFCA79B681719D953A135F61@shsmsx102.ccr.corp.intel.com> In-Reply-To: <2DBBFF226F7CF64BAFCA79B681719D953A135F61@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjRhMTA5YTktNjBmOC00MDAxLWFhNGEtNDMxZjhmYmI2MTQ0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InBjZWVcLzR1dSs2OW5mVU1hcHVZNWVqRmRDY0Uzak42bkdqRnpGWnErdGE0PSJ9 x-ctpclassification: CTP_IC 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 V1] framework ssh_pexpect: add timeout to avoid file uncomplete during scp file from host to VM 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: Mon, 19 Dec 2016 03:50:33 -0000 Lei, please try again. We need to know the difference between normal connec= tion and vm connection. > -----Original Message----- > From: Yao, Lei A > Sent: Monday, December 19, 2016 11:30 AM > To: Liu, Yong; dts@dpdk.org > Subject: RE: [dts] [PATCH V1] framework ssh_pexpect: add timeout to avoid > file uncomplete during scp file from host to VM >=20 >=20 >=20 > > -----Original Message----- > > From: Liu, Yong > > Sent: Monday, December 19, 2016 11:25 AM > > To: Yao, Lei A ; dts@dpdk.org > > Subject: RE: [dts] [PATCH V1] framework ssh_pexpect: add timeout to > avoid > > file uncomplete during scp file from host to VM > > > > > > > diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py > > > > > index d5b6616..09095a1 100644 > > > > > --- a/framework/ssh_pexpect.py > > > > > +++ b/framework/ssh_pexpect.py > > > > > @@ -185,6 +185,7 @@ class SSHPexpect(object): > > > > > if i =3D=3D 1: > > > > > time.sleep(0.5) > > > > > p.sendline(password) > > > > > + time.sleep(10) > > > > > p.expect("100%", 60) > > > > Expect function has been already wait for about one minute, look > like > > > there's > > > > no need to add more time. > > > This timeout is used before sending the ssh cmd. Not waiting time. > During > > > virtualization test, we find the file will always be corrupted when > scp > > > dpdk.tar.gz from host to vm. Wait 10s after ssh connection set up , > then > > > send scp cmd will resolve this failure. > > > > The sleep command is after "password" message, so I think connection > > between VM and host machine has been created and worked. > > What I wonder is that why file is corrupted after "100%" hint. Either > expect > > worked abnormally or some issues we haven't figured out. > > > I can't find out the root cause at my side. This issue can't reproduced > manually because human will always wait 2~3 seconds after ssh connection > set up , then send scp cmd. Also can't reproduced by pdb. This patch is > just the practice experience which can avoid this error. > > You can try with pdb the function expect_loop which can find in /usr/lib/py= thon2.7/dist-packages/pexpect/__init__.py. When "index >=3D 0" happened, file should transferred normally. If file not= transferred as expected, we need to know why. Thanks > > Thanks, > > Marvin