From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D4859A0526; Tue, 21 Jul 2020 08:59:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CBA2C1C00D; Tue, 21 Jul 2020 08:59:40 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 094561C000 for ; Tue, 21 Jul 2020 08:59:38 +0200 (CEST) IronPort-SDR: SDpGS0Qq1SynUGFfvRZuI+vV0D8RIrLOHF0ZpIv3y0AJIT1+hAxQvDHTE2w6b6NH68eiMhE0pM NpLSewpweXcw== X-IronPort-AV: E=McAfee;i="6000,8403,9688"; a="234930345" X-IronPort-AV: E=Sophos;i="5.75,377,1589266800"; d="scan'208";a="234930345" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2020 23:59:38 -0700 IronPort-SDR: 3o+t2GSkQL6BzuMhsrjeFZf4c5zNKgp78nZDH7U0z9qFYnoIsSxnQWU8txlItkZo/xzsmIrgsu BPXYCZg1DmXQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,377,1589266800"; d="scan'208";a="431881690" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.118.174]) by orsmga004.jf.intel.com with ESMTP; 20 Jul 2020 23:59:35 -0700 From: lihong To: dts@dpdk.org, xix.zhang@intel.com Cc: lihong Date: Tue, 21 Jul 2020 07:27:45 +0800 Message-Id: <1595287665-21936-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] framework: get apps name of current build type in virt_dut X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" fix dts issue of d8f3830696b54d48e78463, in virt_dut also need get apps_name from config file Signed-off-by: lihong --- 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