test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH v2] framework: init pexcept sessions from crb instance
       [not found] <448613555-19236-1-git-send-email-yong.liu@intel.com>
@ 2015-11-27  8:59 ` Yong Liu
  2015-11-30  2:14   ` Xu, HuilongX
  0 siblings, 1 reply; 3+ messages in thread
From: Yong Liu @ 2015-11-27  8:59 UTC (permalink / raw)
  To: dts

From: Marvin Liu <yong.liu@intel.com>

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 <yong.liu@intel.com>

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 = crb
         self.read_cache = False
         self.skip_setup = False
         self.serializer = serializer
         self.ports_info = None
 
+        self.logger = getLogger(name)
+        self.session = SSHConnection(self.get_ip_address(), name,
+                                     self.get_password())
+        self.session.init_log(self.logger)
+        self.alt_session = SSHConnection(
+            self.get_ip_address(),
+            name + '_alt',
+            self.get_password())
+        self.alt_session.init_log(self.logger)
+
     def send_expect(self, cmds, expected, timeout=TIMEOUT,
                     alt_session=False, verify=False):
         """
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 = 'dut_pci_dev_info'
 
     def __init__(self, crb, serializer):
-        super(Dut, self).__init__(crb, serializer)
         self.NAME = 'dut'
+        super(Dut, self).__init__(crb, serializer, self.NAME)
 
         self.host_init_flag = False
-        self.logger = getLogger(self.NAME)
-        self.session = SSHConnection(self.get_ip_address(), self.NAME,
-                                     self.get_password())
-        self.session.init_log(self.logger)
-        self.alt_session = SSHConnection(
-            self.get_ip_address(),
-            self.NAME + '_alt',
-            self.get_password())
-        self.alt_session.init_log(self.logger)
         self.number_of_cores = 0
         self.tester = None
         self.cores = []
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 = 'tester_pci_dev_info'
 
     def __init__(self, crb, serializer):
-        super(Tester, self).__init__(crb, serializer)
         self.NAME = 'tester'
-
-        self.logger = getLogger(self.NAME)
-        self.session = SSHConnection(self.get_ip_address(),
-                                     self.NAME, self.get_password())
-        self.session.init_log(self.logger)
-        self.alt_session = 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 = False
         self.dut = None
-- 
1.9.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dts] [PATCH v2] framework: init pexcept sessions from crb instance
  2015-11-27  8:59 ` [dts] [PATCH v2] framework: init pexcept sessions from crb instance Yong Liu
@ 2015-11-30  2:14   ` Xu, HuilongX
  2015-11-30  4:41     ` Liu, Yong
  0 siblings, 1 reply; 3+ messages in thread
From: Xu, HuilongX @ 2015-11-30  2:14 UTC (permalink / raw)
  To: Liu, Yong, dts

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 <yong.liu@intel.com>
> 
> 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 <yong.liu@intel.com>
> 
> 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 = crb
>          self.read_cache = False
>          self.skip_setup = False
>          self.serializer = serializer
>          self.ports_info = None
> 
> +        self.logger = getLogger(name)
> +        self.session = SSHConnection(self.get_ip_address(), name,
> +                                     self.get_password())
> +        self.session.init_log(self.logger)
> +        self.alt_session = SSHConnection(
> +            self.get_ip_address(),
> +            name + '_alt',
> +            self.get_password())
> +        self.alt_session.init_log(self.logger)
> +
>      def send_expect(self, cmds, expected, timeout=TIMEOUT,
>                      alt_session=False, verify=False):
>          """
> 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 = 'dut_pci_dev_info'
> 
>      def __init__(self, crb, serializer):
> -        super(Dut, self).__init__(crb, serializer)
>          self.NAME = 'dut'
> +        super(Dut, self).__init__(crb, serializer, self.NAME)
> 
>          self.host_init_flag = False
> -        self.logger = getLogger(self.NAME)
> -        self.session = SSHConnection(self.get_ip_address(), self.NAME,
> -                                     self.get_password())
> -        self.session.init_log(self.logger)
> -        self.alt_session = SSHConnection(
> -            self.get_ip_address(),
> -            self.NAME + '_alt',
> -            self.get_password())
> -        self.alt_session.init_log(self.logger)
>          self.number_of_cores = 0
>          self.tester = None
>          self.cores = []
> 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 = 'tester_pci_dev_info'
> 
>      def __init__(self, crb, serializer):
> -        super(Tester, self).__init__(crb, serializer)
>          self.NAME = 'tester'
> -
> -        self.logger = getLogger(self.NAME)
> -        self.session = SSHConnection(self.get_ip_address(),
> -                                     self.NAME, self.get_password())
> -        self.session.init_log(self.logger)
> -        self.alt_session = 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 = False
>          self.dut = None
> --
> 1.9.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dts] [PATCH v2] framework: init pexcept sessions from crb instance
  2015-11-30  2:14   ` Xu, HuilongX
@ 2015-11-30  4:41     ` Liu, Yong
  0 siblings, 0 replies; 3+ messages in thread
From: Liu, Yong @ 2015-11-30  4:41 UTC (permalink / raw)
  To: Xu, HuilongX, dts

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
> 
> 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 <yong.liu@intel.com>
> >
> > 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 <yong.liu@intel.com>
> >
> > 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 = crb
> >          self.read_cache = False
> >          self.skip_setup = False
> >          self.serializer = serializer
> >          self.ports_info = None
> >
> > +        self.logger = getLogger(name)
> > +        self.session = SSHConnection(self.get_ip_address(), name,
> > +                                     self.get_password())
> > +        self.session.init_log(self.logger)
> > +        self.alt_session = SSHConnection(
> > +            self.get_ip_address(),
> > +            name + '_alt',
> > +            self.get_password())
> > +        self.alt_session.init_log(self.logger)
> > +
> >      def send_expect(self, cmds, expected, timeout=TIMEOUT,
> >                      alt_session=False, verify=False):
> >          """
> > 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 = 'dut_pci_dev_info'
> >
> >      def __init__(self, crb, serializer):
> > -        super(Dut, self).__init__(crb, serializer)
> >          self.NAME = 'dut'
> > +        super(Dut, self).__init__(crb, serializer, self.NAME)
> >
> >          self.host_init_flag = False
> > -        self.logger = getLogger(self.NAME)
> > -        self.session = SSHConnection(self.get_ip_address(), self.NAME,
> > -                                     self.get_password())
> > -        self.session.init_log(self.logger)
> > -        self.alt_session = SSHConnection(
> > -            self.get_ip_address(),
> > -            self.NAME + '_alt',
> > -            self.get_password())
> > -        self.alt_session.init_log(self.logger)
> >          self.number_of_cores = 0
> >          self.tester = None
> >          self.cores = []
> > 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 = 'tester_pci_dev_info'
> >
> >      def __init__(self, crb, serializer):
> > -        super(Tester, self).__init__(crb, serializer)
> >          self.NAME = 'tester'
> > -
> > -        self.logger = getLogger(self.NAME)
> > -        self.session = SSHConnection(self.get_ip_address(),
> > -                                     self.NAME, self.get_password())
> > -        self.session.init_log(self.logger)
> > -        self.alt_session = 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 = False
> >          self.dut = None
> > --
> > 1.9.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-30  4:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <448613555-19236-1-git-send-email-yong.liu@intel.com>
2015-11-27  8:59 ` [dts] [PATCH v2] framework: init pexcept sessions from crb instance Yong Liu
2015-11-30  2:14   ` Xu, HuilongX
2015-11-30  4:41     ` Liu, Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).