test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH v2 1/6] framework tester: NIC object get from net_device module
Date: Tue, 19 Jan 2016 09:38:06 +0800	[thread overview]
Message-ID: <1453167491-1632-1-git-send-email-yong.liu@intel.com> (raw)

All nic object should get from net device module. If object has been
initalized, there's no need to re-instantiated it.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/framework/tester.py b/framework/tester.py
index c8cebd6..d3dab04 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -37,7 +37,7 @@ import re
 from time import sleep
 from settings import NICS
 from crb import Crb
-from net_device import NetDevice
+from net_device import GetNicObj
 from etgen import IxiaPacketGenerator, SoftwarePacketGenerator
 from settings import IXIA
 import random
@@ -201,7 +201,7 @@ class Tester(Crb):
         try:
             for (pci_bus, pci_id) in self.pci_devices_info:
                 addr_array = pci_bus.split(':')
-                port = NetDevice(self, addr_array[0], addr_array[1])
+                port = GetNicObj(self, addr_array[0], addr_array[1])
                 itf = port.get_interface_name()
                 self.enable_ipv6(itf)
                 self.send_expect("ifconfig %s up" % itf, "# ")
@@ -266,7 +266,7 @@ class Tester(Crb):
             if port_info['type'] == 'ixia':
                 continue
 
-            port = NetDevice(self, port_info['pci'], port_info['type'])
+            port = GetNicObj(self, port_info['pci'], port_info['type'])
             intf = port.get_interface_name()
 
             self.logger.info("Tester cached: [000:%s %s] %s" % (
@@ -290,7 +290,7 @@ class Tester(Crb):
             bus_id = addr_array[0]
             devfun_id = addr_array[1]
 
-            port = NetDevice(self, bus_id, devfun_id)
+            port = GetNicObj(self, bus_id, devfun_id)
             intf = port.get_interface_name()
 
             if "No such file" in intf:
@@ -496,7 +496,7 @@ class Tester(Crb):
                 pkt = pkt_c(pkt_type=pkt_type,
                             pkt_len=random.randint(64, 1514),
                             ran_payload=True)
-                # config packet if has parameters
+
                 if params and len(portList) == len(params):
                     for param in params:
                         layer, config = param
-- 
1.9.3

             reply	other threads:[~2016-01-19  1:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19  1:38 Yong Liu [this message]
2016-01-19  1:38 ` [dts] [PATCH v2 2/6] framework packet: only sniff coming packet when tcpdump support Yong Liu
2016-01-19  1:38 ` [dts] [PATCH v2 3/6] framework pmd_output: support quit command of testpmd Yong Liu
2016-01-19  1:38 ` [dts] [PATCH v2 4/6] tests vf_vlan: add VF vlan test plan Yong Liu
2016-01-19  1:38 ` [dts] [PATCH v2 5/6] tests vf_vlan: add test suite for VF vlan validation Yong Liu
2016-01-19  1:38 ` [dts] [PATCH v2 6/6] conf vf_vlan: add configuration file for VF vlan Yong Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453167491-1632-1-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).