From: "Xu, HuilongX" <huilongx.xu@intel.com>
To: "Liu, Yong" <yong.liu@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Subject: Re: [dts] [PATCH] framework: test case nic code name strip from pci type
Date: Tue, 10 Mar 2015 00:41:49 +0000 [thread overview]
Message-ID: <DF2A19295B96364286FEB7F3DDA27A46010CC03A@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1425892969-13094-1-git-send-email-yong.liu@intel.com>
Acked-by: huilong xu <huilongx.xu@intel.com>
- Tested OS: FC21
- Kernel: 3.17.1-302.fc21.x86_64
- GCC: gcc version 4.9.1 20140930 (Red Hat 4.9.1-11) (GCC)
- CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz
- NIC: Intel Corporation Ethernet Controller X710 for 10GbE SFP+
- Default x86_64-native-linuxapp-gcc configuration
-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yong Liu
Sent: Monday, March 09, 2015 5:23 PM
To: dts@dpdk.org
Subject: [dts] [PATCH] framework: test case nic code name strip from pci type
Case should not take configuration param as real nic name. NIC code name now
convert from dut pci type.
Signed-off-by: Marvin Liu <yong.liu@intel.com>
diff --git a/framework/dts.py b/framework/dts.py
index 1c7a43e..ae12dc9 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -358,7 +358,7 @@ def dts_run_suite(crbInst, test_suites, target, nic):
test_module = __import__('TestSuite_' + test_suite)
for test_classname, test_class in get_subclasses(test_module, TestCase):
- test_suite = test_class(dut, tester, target, nic)
+ test_suite = test_class(dut, tester, target)
dts_log_testsuite(test_suite, log_handler, test_classname)
log_handler.info("\nTEST SUITE : " + test_classname)
diff --git a/framework/settings.py b/framework/settings.py
index 41c9c2c..70e6999 100644
--- a/framework/settings.py
+++ b/framework/settings.py
@@ -136,3 +136,12 @@ TIMEOUT = 15
Global macro for dts.
"""
IXIA = "ixia"
+
+def nic_name_from_type(self, type):
+ """
+ strip nic code name by nic type
+ """
+ for name, nic_type in NICS.items():
+ if nic_type == type:
+ return name
+ return 'Unknown'
diff --git a/framework/test_case.py b/framework/test_case.py
index b1595fb..3d2e2dc 100644
--- a/framework/test_case.py
+++ b/framework/test_case.py
@@ -35,16 +35,20 @@ A base class for creating DTF test cases.
import dts
from exception import VerifyFailure
-from settings import DRIVERS, NICS
+from settings import DRIVERS, NICS, nic_name_from_type
class TestCase(object):
- def __init__(self, dut, tester, target, nic):
+ def __init__(self, dut, tester, target):
self.dut = dut
self.tester = tester
self.target = target
- self.nic = nic
+ self.nics = []
+ for portid in range(len(self.dut.ports_info)):
+ nic_type = self.dut.ports_info[portid]['type']
+ self.nics.append(nic_name_from_type(nic_type))
+ self.nic = self.nics[0]
def set_up_all(self):
pass
--
1.9.3
next prev parent reply other threads:[~2015-03-10 0:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-09 9:22 Yong Liu
2015-03-10 0:41 ` Xu, HuilongX [this message]
2015-03-10 1:47 ` Liu, Yong
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=DF2A19295B96364286FEB7F3DDA27A46010CC03A@SHSMSX101.ccr.corp.intel.com \
--to=huilongx.xu@intel.com \
--cc=dts@dpdk.org \
--cc=yong.liu@intel.com \
/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).