test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH 1/3] nics fm10k: fix nic object incorrect issue
@ 2016-01-20  8:41 Yong Liu
  2016-01-20  8:41 ` [dts] [PATCH 2/3] framework settings: add atwood channel support Yong Liu
  2016-01-20  8:41 ` [dts] [PATCH 3/3] tests: support atwood in suites Yong Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Yong Liu @ 2016-01-20  8:41 UTC (permalink / raw)
  To: dts

This issue happened at dut/tester have same pci address net device.
Net_device module check they will be same devices, so will return
incorrect net device object.

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

diff --git a/framework/dts.py b/framework/dts.py
index 1e60a01..6c3808b 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -39,6 +39,7 @@ import atexit       # register callback when exit
 import json         # json format
 import signal       # signal module for debug mode
 import time         # time module for unique output folder
+import copy         # copy module for duplicate variable
 
 import rst          # rst file support
 import sys          # system module
@@ -252,8 +253,12 @@ def dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir, nic, virtt
                                        '/.%s.cache' % crbInst['IP'])
     serializer.load_from_file()
 
-    dut = get_project_obj(project, Dut, crbInst, serializer)
-    tester = get_project_obj(project, Tester, crbInst, serializer)
+    dutInst = copy.copy(crbInst)
+    dutInst['My IP'] =  crbInst['IP']
+    dut = get_project_obj(project, Dut, dutInst, serializer)
+    testInst = copy.copy(crbInst)
+    testInst['My IP'] =  crbInst['tester IP']
+    tester = get_project_obj(project, Tester, testInst, serializer)
     dts_log_execution(log_handler)
     dut.tester = tester
     tester.dut = dut
diff --git a/framework/packet.py b/framework/packet.py
index a7853e9..b151021 100755
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -196,7 +196,7 @@ class scapy(object):
         if element == 'src':
             value = layer.sport
         elif element == 'dst':
-            valude = layer.dport
+            value = layer.dport
 
         return value
 
diff --git a/nics/net_device.py b/nics/net_device.py
index c3b3755..0286aa4 100644
--- a/nics/net_device.py
+++ b/nics/net_device.py
@@ -820,7 +820,7 @@ def GetNicObj(crb, bus_id, devfun_id):
     object different from default.
     """
     # find existed NetDevice object
-    obj = get_from_list(crb.crb['IP'], bus_id, devfun_id)
+    obj = get_from_list(crb.crb['My IP'], bus_id, devfun_id)
     if obj:
         return obj
 
@@ -831,8 +831,12 @@ def GetNicObj(crb, bus_id, devfun_id):
         # redrockcanyou nic need special initialization
         from fm10k import RedRockCanyou
         obj = RedRockCanyou(crb, bus_id, devfun_id)
+    elif nic == 'atwood':
+        # atwood nic need special initialization
+        from atwood import Atwood
+        obj = Atwood(crb, bus_id, devfun_id)
     else:
         obj = NetDevice(crb, bus_id, devfun_id)
 
-    add_to_list(crb.crb['IP'], obj)
+    add_to_list(crb.crb['My IP'], obj)
     return obj
-- 
2.4.3

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

end of thread, other threads:[~2016-01-20  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-20  8:41 [dts] [PATCH 1/3] nics fm10k: fix nic object incorrect issue Yong Liu
2016-01-20  8:41 ` [dts] [PATCH 2/3] framework settings: add atwood channel support Yong Liu
2016-01-20  8:41 ` [dts] [PATCH 3/3] tests: support atwood in suites Yong Liu

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).