[dts] [PATCH V2 3/3] used create_portmap get portmap

xu,huilong huilongx.xu at intel.com
Tue Dec 22 07:01:18 CET 2015


when not config ports in ./config/port.cfg for vm port, used ping6 auto get portmap

Signed-off-by: xu,huilong <huilongx.xu at intel.com>
---
 framework/virt_dut.py | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/framework/virt_dut.py b/framework/virt_dut.py
index 8d0c5d9..108fef6 100644
--- a/framework/virt_dut.py
+++ b/framework/virt_dut.py
@@ -98,6 +98,10 @@ class VirtDut(DPDKdut):
         return
 
     def create_portmap(self):
+        # if not config ports in vm port config file, used ping6 get portmap
+        if not self.ports_cfg:
+            self.map_available_ports()
+            return
         port_num = len(self.ports_info)
         self.ports_map = [-1] * port_num
         for key in self.ports_cfg.keys():
@@ -136,7 +140,7 @@ class VirtDut(DPDKdut):
         if bind_dev:
             self.bind_interfaces_linux('igb_uio')
 
-    def prerequisites(self, pkgName, patch, auto_portmap):
+    def prerequisites(self, pkgName, patch):
         """
         Prerequest function should be called before execute any test case.
         Will call function to scan all lcore's information which on DUT.
@@ -172,18 +176,13 @@ class VirtDut(DPDKdut):
 
         # no need to rescan ports for guest os just bootup
         # load port infor from config file
-        if auto_portmap is False:
-            self.load_portconf()
+        self.load_portconf()
 
         # enable tester port ipv6
         self.host_dut.enable_tester_ipv6()
         self.mount_procfs()
 
-        if auto_portmap:
-            # auto detect network topology
-            self.map_available_ports()
-        else:
-            self.create_portmap()
+        self.create_portmap()
 
         # disable tester port ipv6
         self.host_dut.disable_tester_ipv6()
-- 
1.9.3



More information about the dts mailing list