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 63C9F58DB for ; Mon, 30 Nov 2015 05:41:29 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 29 Nov 2015 20:41:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,363,1444719600"; d="scan'208";a="850160289" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 29 Nov 2015 20:41:27 -0800 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 29 Nov 2015 20:41:27 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 29 Nov 2015 20:41:26 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.138]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.88]) with mapi id 14.03.0248.002; Mon, 30 Nov 2015 12:41:25 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH v2] framework: init pexcept sessions from crb instance Thread-Index: AQHRKxTMqeFgKVCvhEambhtrcTO5z56z/GEQ Date: Mon, 30 Nov 2015 04:41:24 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10F71F76@SHSMSX103.ccr.corp.intel.com> References: <448613555-19236-1-git-send-email-yong.liu@intel.com> <1448614799-20107-1-git-send-email-yong.liu@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-inteldataclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsIiwiaWQiOiI2M2FmOWQ2Ny1kZDhmLTQ1MDgtYjIxMS04ZWJmZGI5MDE1ZTUiLCJwcm9wcyI6W3sibiI6IkludGVsRGF0YUNsYXNzaWZpY2F0aW9uIiwidmFscyI6W3sidmFsdWUiOiJDVFBfSUMifV19XX0sIlN1YmplY3RMYWJlbHMiOltdLCJUTUNWZXJzaW9uIjoiMTUuNC4xMC4xOSIsIlRydXN0ZWRMYWJlbEhhc2giOiI2dVVaclwvbm9xYzZ0emNhVnJHN2tLTUJveklYdCtLTlRjNTZjNlB0S3hidz0ifQ== 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 v2] framework: init pexcept sessions from crb instance 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, 30 Nov 2015 04:41:30 -0000 Huilong, thanks for figure out. I'll submit another patch for it. > -----Original Message----- > From: Xu, HuilongX > Sent: Monday, November 30, 2015 10:14 AM > To: Liu, Yong; dts@dpdk.org > Subject: RE: [dts] [PATCH v2] framework: init pexcept sessions from crb > instance >=20 > Hi yong, > Could you check Virtdut init function in ./framework/virt_dut.py? > I think you need update it also. > Thanks a lot > > -----Original Message----- > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yong Liu > > Sent: Friday, November 27, 2015 5:00 PM > > To: dts@dpdk.org > > Subject: [dts] [PATCH v2] framework: init pexcept sessions from crb > > instance > > > > From: Marvin Liu > > > > Dut and tester will inherit pexpect sessions from crb instance. > > Session is basic componment of crb instance, should be initialized in > crb > > module. > > > > Signed-off-by: Marvin Liu > > > > diff --git a/framework/crb.py b/framework/crb.py > > index fcbd7d9..1164338 100644 > > --- a/framework/crb.py > > +++ b/framework/crb.py > > @@ -34,6 +34,8 @@ import dts > > import re > > import os > > from settings import TIMEOUT, IXIA > > +from ssh_connection import SSHConnection > > +from logger import getLogger > > > > """ > > CRB (customer reference board) basic functions and handlers > > @@ -48,13 +50,23 @@ class Crb(object): > > CPU/PCI/NIC on the board and setup running environment for DPDK. > > """ > > > > - def __init__(self, crb, serializer): > > + def __init__(self, crb, serializer, name): > > self.crb =3D crb > > self.read_cache =3D False > > self.skip_setup =3D False > > self.serializer =3D serializer > > self.ports_info =3D None > > > > + self.logger =3D getLogger(name) > > + self.session =3D SSHConnection(self.get_ip_address(), name, > > + self.get_password()) > > + self.session.init_log(self.logger) > > + self.alt_session =3D SSHConnection( > > + self.get_ip_address(), > > + name + '_alt', > > + self.get_password()) > > + self.alt_session.init_log(self.logger) > > + > > def send_expect(self, cmds, expected, timeout=3DTIMEOUT, > > alt_session=3DFalse, verify=3DFalse): > > """ > > diff --git a/framework/dut.py b/framework/dut.py > > index 70bd146..f5563d0 100644 > > --- a/framework/dut.py > > +++ b/framework/dut.py > > @@ -39,7 +39,6 @@ from settings import NICS, LOG_NAME_SEP > > from ssh_connection import SSHConnection > > from crb import Crb > > from net_device import NetDevice > > -from logger import getLogger > > from virt_resource import VirtResource > > from utils import RED > > > > @@ -62,19 +61,10 @@ class Dut(Crb): > > PCI_DEV_CACHE_KEY =3D 'dut_pci_dev_info' > > > > def __init__(self, crb, serializer): > > - super(Dut, self).__init__(crb, serializer) > > self.NAME =3D 'dut' > > + super(Dut, self).__init__(crb, serializer, self.NAME) > > > > self.host_init_flag =3D False > > - self.logger =3D getLogger(self.NAME) > > - self.session =3D SSHConnection(self.get_ip_address(), self.NAM= E, > > - self.get_password()) > > - self.session.init_log(self.logger) > > - self.alt_session =3D SSHConnection( > > - self.get_ip_address(), > > - self.NAME + '_alt', > > - self.get_password()) > > - self.alt_session.init_log(self.logger) > > self.number_of_cores =3D 0 > > self.tester =3D None > > self.cores =3D [] > > diff --git a/framework/tester.py b/framework/tester.py > > index 1f4f7ae..aeae1f8 100644 > > --- a/framework/tester.py > > +++ b/framework/tester.py > > @@ -58,17 +58,8 @@ class Tester(Crb): > > PCI_DEV_CACHE_KEY =3D 'tester_pci_dev_info' > > > > def __init__(self, crb, serializer): > > - super(Tester, self).__init__(crb, serializer) > > self.NAME =3D 'tester' > > - > > - self.logger =3D getLogger(self.NAME) > > - self.session =3D SSHConnection(self.get_ip_address(), > > - self.NAME, self.get_password()) > > - self.session.init_log(self.logger) > > - self.alt_session =3D SSHConnection(self.get_ip_address(), > > - self.NAME + '_alt', > > - self.get_password()) > > - self.alt_session.init_log(self.logger) > > + super(Tester, self).__init__(crb, serializer, self.NAME) > > > > self.bgProcIsRunning =3D False > > self.dut =3D None > > -- > > 1.9.3