From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 703E8591F for ; Tue, 25 Oct 2016 08:21:18 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 24 Oct 2016 23:21:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,544,1473145200"; d="scan'208";a="1075271436" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by fmsmga002.fm.intel.com with ESMTP; 24 Oct 2016 23:21:01 -0700 From: "xu,gang" To: dts@dpdk.org Cc: "xu,gang" Date: Tue, 25 Oct 2016 14:22:26 +0800 Message-Id: <1477376546-2506-1-git-send-email-gangx.xu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] fix scp error on FreeBSD 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: Tue, 25 Oct 2016 06:21:18 -0000 when scp something to FreeBSD the prompt is different with other ex:FreeBSD is "Password for root@freeBSD:" Fedora is "root@xx.xxx.xxx.xxx's password:" Signed-off-by: xu,gang --- framework/ssh_pexpect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py index 1abf8a1..7bad5f5 100644 --- a/framework/ssh_pexpect.py +++ b/framework/ssh_pexpect.py @@ -176,11 +176,11 @@ class SSHPexpect(object): p = pexpect.spawn(scp_cmd) time.sleep(0.5) ssh_newkey = 'Are you sure you want to continue connecting' - i = p.expect([ssh_newkey, 'password: ', "# ", pexpect.EOF, + i = p.expect([ssh_newkey, '.*ssword', "# ", pexpect.EOF, pexpect.TIMEOUT], 120) if i == 0: # add once in trust list p.sendline('yes') - i = p.expect([ssh_newkey, '[pP]assword: ', pexpect.EOF], 2) + i = p.expect([ssh_newkey, '.*ssword', pexpect.EOF], 2) if i == 1: time.sleep(0.5) -- 1.9.3