test suite reviews and discussions
 help / color / Atom feed
* [dts] [PATCH V1] framework: get apps name of current build type in virt_dut
@ 2020-07-20 23:27 lihong
  2020-07-21  7:09 ` Zhang, XiX
  2020-07-24  2:40 ` Tu, Lijuan
  0 siblings, 2 replies; 3+ messages in thread
From: lihong @ 2020-07-20 23:27 UTC (permalink / raw)
  To: dts, xix.zhang; +Cc: lihong

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

Signed-off-by: lihong <lihongx.ma@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


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

* Re: [dts] [PATCH V1] framework: get apps name of current build type in virt_dut
  2020-07-20 23:27 [dts] [PATCH V1] framework: get apps name of current build type in virt_dut lihong
@ 2020-07-21  7:09 ` Zhang, XiX
  2020-07-24  2:40 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Zhang, XiX @ 2020-07-21  7:09 UTC (permalink / raw)
  To: Ma, LihongX, dts

[-- Attachment #1: Type: text/plain, Size: 3023 bytes --]

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

-----Original Message-----
From: Ma, LihongX 
Sent: Tuesday, July 21, 2020 7:28 AM
To: dts@dpdk.org; Zhang, XiX <xix.zhang@intel.com>
Cc: Ma, LihongX <lihongx.ma@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@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


[-- Attachment #2: TestVM2VMVirtioNetPerf.log --]
[-- Type: application/octet-stream, Size: 309008 bytes --]

[-- Attachment #3: TestVmHotplug.log --]
[-- Type: application/octet-stream, Size: 966192 bytes --]

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

* Re: [dts] [PATCH V1] framework: get apps name of current build type in virt_dut
  2020-07-20 23:27 [dts] [PATCH V1] framework: get apps name of current build type in virt_dut lihong
  2020-07-21  7:09 ` Zhang, XiX
@ 2020-07-24  2:40 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2020-07-24  2:40 UTC (permalink / raw)
  To: Ma, LihongX, dts, Zhang, XiX; +Cc: Ma, LihongX

Applied, thanks

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of lihong
> Sent: 2020^[$BG/^[(B7^[$B7n^[(B21^[$BF|^[(B 7:28
> To: dts@dpdk.org; Zhang, XiX <xix.zhang@intel.com>
> Cc: Ma, LihongX <lihongx.ma@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@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


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 23:27 [dts] [PATCH V1] framework: get apps name of current build type in virt_dut lihong
2020-07-21  7:09 ` Zhang, XiX
2020-07-24  2:40 ` Tu, Lijuan

test suite reviews and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/ public-inbox