[dts] [PATCH V1] framework: get apps name of current build type in virt_dut

Zhang, XiX xix.zhang at intel.com
Tue Jul 21 09:09:32 CEST 2020


Tested-by: Zhang, XiX <xix.zhang at intel.com>

-----Original Message-----
From: Ma, LihongX 
Sent: Tuesday, July 21, 2020 7:28 AM
To: dts at dpdk.org; Zhang, XiX <xix.zhang at intel.com>
Cc: Ma, LihongX <lihongx.ma at intel.com>
Subject: [dts][PATCH V1] framework: get apps name of current build type in virt_dut

fix dts issue of d8f3830696b54d48e78463, in virt_dut also need get apps_name from config file

Signed-off-by: lihong <lihongx.ma at intel.com>
---
 framework/virt_base.py |  1 +
 framework/virt_dut.py  | 20 ++++++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/framework/virt_base.py b/framework/virt_base.py index c959ca0..b582f85 100644
--- a/framework/virt_base.py
+++ b/framework/virt_base.py
@@ -460,6 +460,7 @@ class VirtBase(object):
 
         try:
             # setting up dpdk in vm, must call at last
+            vm_dut.target = self.host_dut.target
             vm_dut.prerequisites(self.host_dut.package, self.host_dut.patches, autodetect_topo)
             if set_target:
                 target = self.host_dut.target diff --git a/framework/virt_dut.py b/framework/virt_dut.py index adf486b..03569ba 100644
--- a/framework/virt_dut.py
+++ b/framework/virt_dut.py
@@ -34,8 +34,8 @@ import re
 import time
 import settings
 from utils import RED, parallel_lock
-from config import PortConf
-from settings import NICS, LOG_NAME_SEP, get_netdev
+from config import PortConf, AppNameConf from settings import NICS, 
+LOG_NAME_SEP, get_netdev, load_global_setting, HOST_BUILD_TYPE_SETTING
 from project_dpdk import DPDKdut
 from dut import Dut
 from net_device import GetNicObj
@@ -76,6 +76,8 @@ class VirtDut(DPDKdut):
         self.virttype = virttype
         self.prefix_subfix = str(os.getpid()) + '_' + time.strftime("%Y%m%d%H%M%S", time.localtime())
         self.prefix_list = []
+        self.apps_name_conf = {}
+        self.apps_name = {}
 
     def init_log(self):
         if hasattr(self.host_dut, "test_classname"):
@@ -216,6 +218,20 @@ class VirtDut(DPDKdut):
         for port_info in self.ports_info:
             self.logger.info(port_info)
 
+        # load app name conf
+        name_cfg = AppNameConf()
+        self.apps_name_conf = name_cfg.load_app_name_conf()
+
+        # get apps name of current build type
+        build_type = load_global_setting(HOST_BUILD_TYPE_SETTING)
+        if build_type not in self.apps_name_conf:
+            raise Exception('please config the apps name in app_name.cfg of build type:%s' % build_type)
+        self.apps_name = self.apps_name_conf[build_type]
+        # use the dut target directory instead of 'target' string in app name
+        for app in self.apps_name:
+            cur_app_path = self.apps_name[app].replace('target', self.target)
+            self.apps_name[app] = cur_app_path + ' '
+
     def init_core_list(self):
         self.cores = []
         cpuinfo = self.send_expect("grep --color=never \"processor\""
--
2.7.4

-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestVM2VMVirtioNetPerf.log
Type: application/octet-stream
Size: 309008 bytes
Desc: TestVM2VMVirtioNetPerf.log
URL: <http://mails.dpdk.org/archives/dts/attachments/20200721/8598b627/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestVmHotplug.log
Type: application/octet-stream
Size: 966192 bytes
Desc: TestVmHotplug.log
URL: <http://mails.dpdk.org/archives/dts/attachments/20200721/8598b627/attachment-0001.obj>


More information about the dts mailing list