From patchwork Tue Jan 18 15:34:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Owen Hilyard X-Patchwork-Id: 106036 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 86157A034C; Tue, 18 Jan 2022 16:35:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D9D54273D; Tue, 18 Jan 2022 16:35:02 +0100 (CET) Received: from mail-ua1-f98.google.com (mail-ua1-f98.google.com [209.85.222.98]) by mails.dpdk.org (Postfix) with ESMTP id 425534273D for ; Tue, 18 Jan 2022 16:35:00 +0100 (CET) Received: by mail-ua1-f98.google.com with SMTP id h11so37487474uar.5 for ; Tue, 18 Jan 2022 07:35:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J0EgA9ebPo0ZjS9UEqEy1dzD9rzWulPt46Rl+lOBpgo=; b=Hf7iNUTaTm3nC5Yc6SmQhu5bIhLn+vIAmgOpnoCfdkBtbVM34iKpk1Lpvamo8DC6z5 wPKK4sf89TS/s/VLJXzG4K82oEd6R89QHxmH4hZyU52JK7pAJSynlpELBUijuSpsKJZI rAY7iN5JFreFw8blLZqvsfNBzbmp6KdW8mQV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J0EgA9ebPo0ZjS9UEqEy1dzD9rzWulPt46Rl+lOBpgo=; b=TrtI5HOyWck/nJ+zKt54LX2JLKNMfuSG5QVPn1UPYgDJ9SEzpHj5cx5NrJ8N4mFNRl PulQE/qn0vV9NTXjzcW3xlaaXeAwIki+101yOFX5NgksNZPHI8r51wKllyEmpe8zHyDQ fHKFsq3zjBS47UUGikNhItWYFhKhXgzLKNvPqvcXcCg+Ey6/TluCYZtx1WdcsC1aGPmE 0+oD5iJW1StCkRujLSHR1G2yy9DT89BUquklN9QR0c5es7nNlXiGW5n7M9ZiYzdMsTGd W6ZXuER+WL882y/p7y5GIAblPPh/pMVbDohD0cc+Sc2JUB+S+OfX0eFSOoJXA3KgWVaH oU/w== X-Gm-Message-State: AOAM530Xq7WojFZhEPfvQvSb0FbSndjPuTxf8ClkwgO51iGgra35WDkb 8/ENG8+7nO9O9jWTLGs5y+O8gNWsCeg3x1cKUhqWfZCG/LL2qjoHEHEiFSxveJ59Yv1IUnvrDDl bE/vmbQlqkHMIQafHVusYU7R5U6cEFc3+QnEW8A+ggjAxsRN6emszrA0IkNURzwOav3JzaeFcH5 kXGeBE1+2UBfO+cA== X-Google-Smtp-Source: ABdhPJwx5aOx2/lpn7RzleC1mhOWdZuqM+u/Cli14K3HLqg1cfRl6P38lC4x6k9AYAQWBVbxhHt23mwlviIK X-Received: by 2002:a9f:36a6:: with SMTP id p35mr9590608uap.1.1642520099639; Tue, 18 Jan 2022 07:34:59 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id g126sm1515489vke.7.2022.01.18.07.34.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jan 2022 07:34:59 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::105d]) by postal.iol.unh.edu (Postfix) with ESMTP id E72CA6052500; Tue, 18 Jan 2022 10:34:58 -0500 (EST) From: ohilyard@iol.unh.edu To: dts@dpdk.org Cc: lijuan.tu@intel.com, juraj.linkes@pantheon.tech, Owen Hilyard Subject: [PATCH v2] Fix hardcoded config folders Date: Tue, 18 Jan 2022 10:34:44 -0500 Message-Id: <20220118153443.26193-1-ohilyard@iol.unh.edu> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220111155937.36524-1-ohilyard@iol.unh.edu> References: <20220111155937.36524-1-ohilyard@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 From: Owen Hilyard All hardcoded instances of "DTS_ROOT/conf" or "./conf" have been replaced with CONFIG_ROOT_PATH, which is either the environment variable DTS_CFG_FOLDER if it is set, or is DTS_ROOT/conf/ by default. Signed-off-by: Owen Hilyard Tested-by: Jun Dong --- doc/dts_gsg/quick_start.rst | 8 ++++---- doc/dts_gsg/usr_guide/ixia.rst | 8 ++++---- doc/dts_gsg/usr_guide/trex.rst | 18 ++++++++--------- doc/dts_gsg/usr_guide/usage.rst | 20 +++++++++---------- framework/checkCase.py | 12 +++++------ framework/project_dpdk.py | 4 ++-- framework/virt_base.py | 4 ++-- framework/virt_scene.py | 2 +- ...tSuite_iavf_package_driver_error_handle.py | 3 ++- tests/TestSuite_ipsec_gw_cryptodev_func.py | 4 +++- tests/TestSuite_nic_single_core_perf.py | 2 +- tests/TestSuite_perf_virtio_user_loopback.py | 2 +- .../TestSuite_pvp_multi_paths_performance.py | 2 +- ...lti_paths_vhost_single_core_performance.py | 2 +- ...ti_paths_virtio_single_core_performance.py | 2 +- tests/TestSuite_vf_single_core_perf.py | 2 +- tests/TestSuite_vhost_cbdma.py | 2 +- tests/TestSuite_vhost_user_live_migration.py | 5 +++-- ...te_virtio_user_for_container_networking.py | 2 +- tests/rte_flow_common.py | 2 +- tests/vhost_peer_conf.py | 4 +++- tools/setup.py | 10 ++++++---- 22 files changed, 63 insertions(+), 57 deletions(-) diff --git a/doc/dts_gsg/quick_start.rst b/doc/dts_gsg/quick_start.rst index 78352a73..a2dbfa68 100644 --- a/doc/dts_gsg/quick_start.rst +++ b/doc/dts_gsg/quick_start.rst @@ -155,7 +155,7 @@ DPDK source code should be packed as "dpdk.tar.gz" and moved into dts/dep: Configuring DTS --------------- -A few of files should be configured, including execution.cfg, conf/crbs, conf/ports.cfg. +A few of files should be configured, including execution.cfg, $DTS_CFG_FOLDER/crbs, $DTS_CFG_FOLDER/ports.cfg. execution.cfg ~~~~~~~~~~~~~ @@ -175,7 +175,7 @@ execution.cfg * crbs: IP address of the DUT system * test_suites: a list of test suites to be executed -conf/crbs.cfg +$DTS_CFG_FOLDER/crbs.cfg ~~~~~~~~~~~~~ .. code-block:: console @@ -196,7 +196,7 @@ conf/crbs.cfg * tester_ip: IP address of tester * tester_passwd: Password of Tester linux account, user name should same as dut_user -conf/ports.cfg +$DTS_CFG_FOLDER/ports.cfg ~~~~~~~~~~~~~~ .. code-block:: console @@ -206,7 +206,7 @@ conf/ports.cfg pci=0000:06:00.0,peer=0000:81:00.0; pci=0000:06:00.1,peer=0000:81:00.1; -* [192.168.1.1]: same as crbs in execution.cfg and dut_ip in conf/crbs.cfg +* [192.168.1.1]: same as crbs in execution.cfg and dut_ip in $DTS_CFG_FOLDER/crbs.cfg * pci: pci address of DUT port * peer: pci address of Tester port which connected to the DUT port whose pci is `pci`. diff --git a/doc/dts_gsg/usr_guide/ixia.rst b/doc/dts_gsg/usr_guide/ixia.rst index 2ad754ef..bd665652 100644 --- a/doc/dts_gsg/usr_guide/ixia.rst +++ b/doc/dts_gsg/usr_guide/ixia.rst @@ -25,7 +25,7 @@ First of all, you must configure execution.cfg as below: Configure CRB information ~~~~~~~~~~~~~~~~~~~~~~~~~ -Then please add the detail information about your CRB in conf/crbs.conf as following: +Then please add the detail information about your CRB in $DTS_CFG_FOLDER/crbs.conf as following: .. code-block:: console @@ -52,7 +52,7 @@ ports topology as below: IXIA port 0 <---------> DUT port 0 IXIA port 1 <---------> DUT port 1 -please add port configuration in conf/ports.cfg as following: +please add port configuration in $DTS_CFG_FOLDER/ports.cfg as following: .. code-block:: console @@ -64,7 +64,7 @@ please add port configuration in conf/ports.cfg as following: Configure pktgen information ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -please configure Pktgen information in conf/pktgen.cfg +please configure Pktgen information in $DTS_CFG_FOLDER/pktgen.cfg .. code-block:: console @@ -86,7 +86,7 @@ Configure your own suites Performance tests generally have configuration files. it's name corresponds to the suite. -Below is the conf/nic_single_core_perf.cfg configuration file. +Below is the $DTS_CFG_FOLDER/nic_single_core_perf.cfg configuration file. You can set the test parameters according to your test needs. diff --git a/doc/dts_gsg/usr_guide/trex.rst b/doc/dts_gsg/usr_guide/trex.rst index e8b1fe94..00e15baa 100644 --- a/doc/dts_gsg/usr_guide/trex.rst +++ b/doc/dts_gsg/usr_guide/trex.rst @@ -167,11 +167,11 @@ Add the performance test suite and set perf=true:: parameters=nic_type=cfg:perf=true root@tester:dts# -Configure conf/crbs.cfg +Configure $DTS_CFG_FOLDER/crbs.cfg ~~~~~~~~~~~~~~~~~~~~~~~ Set the pktgen_group=trex or pktgen_group=TREX, this item is case insensitive:: - root@tester:dts# cat conf/crbs.cfg + root@tester:dts# cat $DTS_CFG_FOLDER/crbs.cfg [192.168.1.1] dut_ip=192.168.1.1 dut_user=root @@ -185,12 +185,12 @@ Set the pktgen_group=trex or pktgen_group=TREX, this item is case insensitive:: channels=4 bypass_core0=True -Configure conf/ports.cfg +Configure $DTS_CFG_FOLDER/ports.cfg ~~~~~~~~~~~~~~~~~~~~~~~~~ This configuration is just same with PF function test, so if you have completed some functional test, -you have no need to modify the conf/ports.cfg, just like below:: +you have no need to modify the $DTS_CFG_FOLDER/ports.cfg, just like below:: - root@tester:dts# cat conf/ports.cfg + root@tester:dts# cat $DTS_CFG_FOLDER/ports.cfg [192.168.1.1] ports = pci=0000:05:00.0,peer=0000:0b:00.0; @@ -198,7 +198,7 @@ you have no need to modify the conf/ports.cfg, just like below:: In addition, it could be configured as below:: - root@tester:dts# cat conf/ports.cfg + root@tester:dts# cat $DTS_CFG_FOLDER/ports.cfg [192.168.1.1] ports = pci=0000:05:00.0,peer=TREX:0; @@ -206,13 +206,13 @@ In addition, it could be configured as below:: We recommend to use the first format configuration, as it has no need to do modification when we do functional test. -Configure conf/pktgen.cfg +Configure $DTS_CFG_FOLDER/pktgen.cfg ~~~~~~~~~~~~~~~~~~~~~~~~~~ -Fill in the conf/pktgen.cfg with your TREX setting, for the first time, you should set start_trex=yes. +Fill in the $DTS_CFG_FOLDER/pktgen.cfg with your TREX setting, for the first time, you should set start_trex=yes. Set the IP address of the device which you installed TREX into item ‘server=’, it should be the tester IP. The configuration should as below:: - root@tester:dts# cat conf/pktgen.cfg + root@tester:dts# cat $DTS_CFG_FOLDER/pktgen.cfg [TREX] trex_root_path=/opt/trex/v2.88 trex_lib_path=/opt/trex/v2.88/automation/trex_control_plane/interactive diff --git a/doc/dts_gsg/usr_guide/usage.rst b/doc/dts_gsg/usr_guide/usage.rst index ef729a9e..391662f6 100644 --- a/doc/dts_gsg/usr_guide/usage.rst +++ b/doc/dts_gsg/usr_guide/usage.rst @@ -22,7 +22,7 @@ First of all, you must configure execution.cfg as below: x86_64-native-linuxapp-gcc parameters=nic_type=cfg:func=true -* crbs: IP address of the DUT. The detail information is defined in file conf/crbs.cfg. +* crbs: IP address of the DUT. The detail information is defined in file $DTS_CFG_FOLDER/crbs.cfg. * drivername: the driver devices used by DPDK bound to. * build_type: the tool for building DPDK, it can be meson and makefile. DPDK 20.11+ only uses meson and ninja. * rx_mode: vector instructions used in tests, it can be novector/sse/avx2/avx512. it is optional, if not set, dpdk uses avx2 by default. @@ -31,7 +31,7 @@ First of all, you must configure execution.cfg as below: * parameters: multiple keywords as following: * nic_type: it is the type of the NIC to use. The types are defined in the file settings.py. - There's a special type named as **cfg**, which mean network information will be loaded from file conf/ports.cfg. + There's a special type named as **cfg**, which mean network information will be loaded from file $DTS_CFG_FOLDER/ports.cfg. If use NIC type such as niantic, fortville_25g, it requires all DUT are the same types and no any same devices connected to Tester, as DTS will test all devices connected to Tester. Therefore, recommend using **cfg**. * func=true: run only functional test. @@ -59,7 +59,7 @@ Here are an example for functional testing: Configure CRB information ~~~~~~~~~~~~~~~~~~~~~~~~~ -Then please add the detail information about your CRB in conf/crbs.conf as following: +Then please add the detail information about your CRB in $DTS_CFG_FOLDER/crbs.conf as following: .. code-block:: console @@ -105,7 +105,7 @@ Here are an example for functional testing: Configure port information ~~~~~~~~~~~~~~~~~~~~~~~~~~ -If set ``nic_type=cfg`` in execution.cfg, please add port configuration in conf/ports.cfg as following: +If set ``nic_type=cfg`` in execution.cfg, please add port configuration in $DTS_CFG_FOLDER/ports.cfg as following: .. code-block:: console @@ -122,7 +122,7 @@ It supports three patterns, the first one is for functional testing, the second * if it is func testing, it is pci address * if pktgen is ``TRex``, the `X` in ``TREX:X`` is port id in TRex configuration file, e.g. /etc/trex_cfg.yaml. - * if pktgen is ``IXIA``, the `X` is card id ,and the `Y` is port id, which configured in ./conf/pktgen.cfg. + * if pktgen is ``IXIA``, the `X` is card id ,and the `Y` is port id, which configured in DTS_CFG_FOLDER/pktgen.cfg (./conf/pktgen.cfg by default). Here are an example for functional testing: @@ -155,7 +155,7 @@ Here are an example for TRex: Configure all test suites ~~~~~~~~~~~~~~~~~~~~~~~~~ -conf/global_suite.cfg is a global suite configure file which is shared by all suites. +$DTS_CFG_FOLDER/global_suite.cfg is a global suite configure file which is shared by all suites. .. code-block:: console @@ -168,8 +168,8 @@ conf/global_suite.cfg is a global suite configure file which is shared by all su Configure your own suites ~~~~~~~~~~~~~~~~~~~~~~~~~ -Not all test suites have it's own configuration file which depended on script. If it has, the configuration file is conf/[suite_name].cfg -For example, suite metrics has its suite configure file conf/metric.cfg: +Not all test suites have it's own configuration file which depended on script. If it has, the configuration file is $DTS_CFG_FOLDER/[suite_name].cfg +For example, suite metrics has its suite configure file $DTS_CFG_FOLDER/metric.cfg: .. code-block:: console @@ -183,12 +183,12 @@ For example, suite metrics has its suite configure file conf/metric.cfg: Configure your pktgen ~~~~~~~~~~~~~~~~~~~~~ -Pktgen information are configured in conf/pktgen.cfg, pktgen_group must be configured too: +Pktgen information are configured in $DTS_CFG_FOLDER/pktgen.cfg, pktgen_group must be configured too: * traffic generator is ``TRex``, set ``pktgen_group=trex`` in crbs.cfg. * traffic generator is ``IXIA``, set ``pktgen_group=ixia`` in crbs.cfg. -Then configure conf/pktgen.cfg as following: +Then configure $DTS_CFG_FOLDER/pktgen.cfg as following: .. code-block:: console diff --git a/framework/checkCase.py b/framework/checkCase.py index 3182dc77..82c86c46 100644 --- a/framework/checkCase.py +++ b/framework/checkCase.py @@ -1,19 +1,17 @@ import collections import json +import os -import xlrd - -from .settings import HOST_DRIVER_SETTING, get_nic_name, load_global_setting +from .settings import HOST_DRIVER_SETTING, get_nic_name, load_global_setting, CONFIG_ROOT_PATH from .utils import RED -filter_json_file = './conf/test_case_checklist.json' -support_json_file = './conf/test_case_supportlist.json' - +filter_json_file = os.path.join(CONFIG_ROOT_PATH, 'test_case_checklist.json') +support_json_file = os.path.join(CONFIG_ROOT_PATH, 'test_case_supportlist.json') class CheckCase(object): """ Class for check test case running criteria. All information will be loaded - from conf/test_case_*list.json. Current two files are maintained. One is + from DTS_CFG_FOLDER/test_case_*list.json. Current two files are maintained. One is for check whether test case should skip, another one is for check whether current environment support test case execution. """ diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index 9927bcc1..05462b6d 100644 --- a/framework/project_dpdk.py +++ b/framework/project_dpdk.py @@ -46,7 +46,7 @@ from .settings import ( NICS, accepted_nic, load_global_setting, - save_global_setting, + save_global_setting, CONFIG_ROOT_PATH, ) from .ssh_connection import SSHConnection from .tester import Tester @@ -571,7 +571,7 @@ class DPDKdut(Dut): folder_info = folder.split('/') name = folder_info[-1] if name != 'examples' and name not in self.apps_name: - raise Exception('Please config %s file path on conf/app_name.cfg' % name) + raise Exception(f'Please config {name} file path on {os.path.join(CONFIG_ROOT_PATH, "app_name.cfg")}') if name == 'examples': example = 'all' diff --git a/framework/virt_base.py b/framework/virt_base.py index 148a4d18..e6b9f038 100644 --- a/framework/virt_base.py +++ b/framework/virt_base.py @@ -120,7 +120,7 @@ class VirtBase(object): def load_global_config(self): """ - Load global configure in the path DTS_ROOT_PATH/conf. + Load global configure in the path CONFIG_ROOT_PATH. """ conf = VirtConf(VIRTCONF) conf.load_virt_config(self.virt_type) @@ -138,7 +138,7 @@ class VirtBase(object): def load_local_config(self, suite_name): """ - Load local configure in the path DTS_ROOT_PATH/conf. + Load local configure in the path CONFIG_ROOT_PATH ('DTS_ROOT_PATH/$DTS_CFG_FOLDER/' by default). """ # load local configuration by suite and vm name try: diff --git a/framework/virt_scene.py b/framework/virt_scene.py index cc36a09b..1acb7a0c 100644 --- a/framework/virt_scene.py +++ b/framework/virt_scene.py @@ -41,7 +41,7 @@ from .utils import create_mask # scenario module for handling scenario # 1. load configurations -# config saved in conf/scenarios/name.cfg +# config saved in $DTS_CFG_FOLDER/scenarios/name.cfg # load configurations will saved in vm list # 2. handle special config # pf_idx=0,vf_num=2,driver=default; diff --git a/tests/TestSuite_iavf_package_driver_error_handle.py b/tests/TestSuite_iavf_package_driver_error_handle.py index 0cdba385..c4277fc7 100644 --- a/tests/TestSuite_iavf_package_driver_error_handle.py +++ b/tests/TestSuite_iavf_package_driver_error_handle.py @@ -35,6 +35,7 @@ import time from framework.config import UserConf from framework.pmd_output import PmdOutput +from framework.settings import CONFIG_ROOT_PATH from framework.test_case import TestCase @@ -47,7 +48,7 @@ class Testiavf_package_and_driver_check(TestCase): self.verify(len(self.dut_ports) >= 1, "Insufficient ports") self.PF_QUEUE = 16 - conf_file = 'conf/iavf_driver_package.cfg' + conf_file = os.path.join(CONFIG_ROOT_PATH, 'iavf_driver_package.cfg') conf_peer = UserConf(conf_file) conf_session = conf_peer.conf._sections['suite'] self.driverPath_latest = conf_session['ice_driver_file_location_latest'] diff --git a/tests/TestSuite_ipsec_gw_cryptodev_func.py b/tests/TestSuite_ipsec_gw_cryptodev_func.py index a5d6e775..57ca79d9 100644 --- a/tests/TestSuite_ipsec_gw_cryptodev_func.py +++ b/tests/TestSuite_ipsec_gw_cryptodev_func.py @@ -30,11 +30,13 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import binascii +import os.path import time import framework.packet as packet import framework.utils as utils import tests.cryptodev_common as cc +from framework.settings import CONFIG_ROOT_PATH from framework.test_case import TestCase @@ -87,7 +89,7 @@ class TestIPsecGW(TestCase): "u": "0x1" } - conf_file = r'conf/ipsec_ep0.cfg' + conf_file = os.path.join(CONFIG_ROOT_PATH, 'ipsec_ep0.cfg') self.dut.session.copy_file_to(conf_file, '/tmp') def set_up(self): diff --git a/tests/TestSuite_nic_single_core_perf.py b/tests/TestSuite_nic_single_core_perf.py index 1012dbf3..e1020895 100644 --- a/tests/TestSuite_nic_single_core_perf.py +++ b/tests/TestSuite_nic_single_core_perf.py @@ -206,7 +206,7 @@ class TestNicSingleCorePerf(TestCase): def handle_expected(self): """ - Update expected numbers to configurate file: conf/$suite_name.cfg + Update expected numbers to configurate file: $DTS_CFG_FOLDER/$suite_name.cfg """ if load_global_setting(UPDATE_EXPECTED) == "yes": for fwd_config in list(self.test_parameters.keys()): diff --git a/tests/TestSuite_perf_virtio_user_loopback.py b/tests/TestSuite_perf_virtio_user_loopback.py index 6ab6fa48..d15dbb53 100644 --- a/tests/TestSuite_perf_virtio_user_loopback.py +++ b/tests/TestSuite_perf_virtio_user_loopback.py @@ -186,7 +186,7 @@ class TestPerfVirtioUserLoopback(TestCase): def handle_expected(self): """ - Update expected numbers to configurate file: conf/$suite_name.cfg + Update expected numbers to configurate file: $DTS_CFG_FOLDER/$suite_name.cfg """ if load_global_setting(UPDATE_EXPECTED) == "yes": for frame_size in self.test_parameters.keys(): diff --git a/tests/TestSuite_pvp_multi_paths_performance.py b/tests/TestSuite_pvp_multi_paths_performance.py index b316f779..5428f2d3 100644 --- a/tests/TestSuite_pvp_multi_paths_performance.py +++ b/tests/TestSuite_pvp_multi_paths_performance.py @@ -177,7 +177,7 @@ class TestPVPMultiPathPerformance(TestCase): def handle_expected(self): """ - Update expected numbers to configurate file: conf/$suite_name.cfg + Update expected numbers to configurate file: $DTS_CFG_FOLDER/$suite_name.cfg """ if load_global_setting(UPDATE_EXPECTED) == "yes": for frame_size in self.test_parameters.keys(): diff --git a/tests/TestSuite_pvp_multi_paths_vhost_single_core_performance.py b/tests/TestSuite_pvp_multi_paths_vhost_single_core_performance.py index 663cc45f..b3d0ac64 100644 --- a/tests/TestSuite_pvp_multi_paths_vhost_single_core_performance.py +++ b/tests/TestSuite_pvp_multi_paths_vhost_single_core_performance.py @@ -175,7 +175,7 @@ class TestPVPMultiPathVhostPerformance(TestCase): def handle_expected(self): """ - Update expected numbers to configurate file: conf/$suite_name.cfg + Update expected numbers to configurate file: $DTS_CFG_FOLDER/$suite_name.cfg """ if load_global_setting(UPDATE_EXPECTED) == "yes": for frame_size in self.test_parameters.keys(): diff --git a/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py b/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py index b6432ca0..489e12de 100644 --- a/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py +++ b/tests/TestSuite_pvp_multi_paths_virtio_single_core_performance.py @@ -178,7 +178,7 @@ class TestPVPMultiPathVirtioPerformance(TestCase): def handle_expected(self): """ - Update expected numbers to configurate file: conf/$suite_name.cfg + Update expected numbers to configurate file: $DTS_CFG_FOLDER/$suite_name.cfg """ if load_global_setting(UPDATE_EXPECTED) == "yes": for frame_size in self.test_parameters.keys(): diff --git a/tests/TestSuite_vf_single_core_perf.py b/tests/TestSuite_vf_single_core_perf.py index ea4ccfb9..3b3b15e3 100644 --- a/tests/TestSuite_vf_single_core_perf.py +++ b/tests/TestSuite_vf_single_core_perf.py @@ -210,7 +210,7 @@ class TestVfSingleCorePerf(TestCase): def handle_expected(self): """ - Update expected numbers to configurate file: conf/$suite_name.cfg + Update expected numbers to configurate file: $DTS_CFG_FOLDER/$suite_name.cfg """ if load_global_setting(UPDATE_EXPECTED) == "yes": for fwd_config in list(self.test_parameters.keys()): diff --git a/tests/TestSuite_vhost_cbdma.py b/tests/TestSuite_vhost_cbdma.py index c0cc772d..02d7e25e 100644 --- a/tests/TestSuite_vhost_cbdma.py +++ b/tests/TestSuite_vhost_cbdma.py @@ -574,7 +574,7 @@ class TestVirTioVhostCbdma(TestCase): def handle_expected(self, mode_list): """ - Update expected numbers to configurate file: conf/$suite_name.cfg + Update expected numbers to configurate file: $DTS_CFG_FOLDER/$suite_name.cfg """ if load_global_setting(UPDATE_EXPECTED) == "yes": for mode in mode_list: diff --git a/tests/TestSuite_vhost_user_live_migration.py b/tests/TestSuite_vhost_user_live_migration.py index e50800d5..8796f16a 100644 --- a/tests/TestSuite_vhost_user_live_migration.py +++ b/tests/TestSuite_vhost_user_live_migration.py @@ -28,13 +28,14 @@ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - +import os.path import re import time import framework.utils as utils from framework.config import UserConf from framework.exception import VirtDutInitException +from framework.settings import CONFIG_ROOT_PATH from framework.test_case import TestCase from framework.virt_common import VM @@ -54,7 +55,7 @@ class TestVhostUserLiveMigration(TestCase): "Insufficient ports for testing") # get mount info from cfg file - conf_info = UserConf('conf/%s.cfg' % self.suite_name) + conf_info = UserConf(os.path.join(CONFIG_ROOT_PATH, f'{self.suite_name}.cfg')) conf_session = conf_info.conf._sections['mount_info'] self.mount_path = conf_session['backup_mount_path'] self.share_path = conf_session['host_share_dir'] diff --git a/tests/TestSuite_virtio_user_for_container_networking.py b/tests/TestSuite_virtio_user_for_container_networking.py index 037a1bd2..7c93d9a8 100644 --- a/tests/TestSuite_virtio_user_for_container_networking.py +++ b/tests/TestSuite_virtio_user_for_container_networking.py @@ -198,7 +198,7 @@ class TestVirtioUserForContainer(TestCase): def handle_expected(self): """ - Update expected numbers to configurate file: conf/$suite_name.cfg + Update expected numbers to configurate file: $DTS_CFG_FOLDER/$suite_name.cfg """ if load_global_setting(UPDATE_EXPECTED) == "yes": for frame_size in self.test_parameters.keys(): diff --git a/tests/rte_flow_common.py b/tests/rte_flow_common.py index 969d3222..6c2782e9 100644 --- a/tests/rte_flow_common.py +++ b/tests/rte_flow_common.py @@ -41,7 +41,7 @@ CVL_TXQ_RXQ_NUMBER = 16 # switch filter common functions def get_suite_config(test_case): """ - get the suite config from conf/suite.cfg. + get the suite config from $DTS_CFG_FOLDER/suite.cfg. """ suite_config = {} if "ice_driver_file_location" in test_case.get_suite_cfg(): diff --git a/tests/vhost_peer_conf.py b/tests/vhost_peer_conf.py index c8802277..4dc47341 100644 --- a/tests/vhost_peer_conf.py +++ b/tests/vhost_peer_conf.py @@ -28,10 +28,12 @@ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import os from framework.config import UserConf +from framework.settings import CONFIG_ROOT_PATH -conf_file = 'conf/vhost_peer_conf.cfg' +conf_file = os.path.join(CONFIG_ROOT_PATH, 'vhost_peer_conf.cfg') conf_peer = UserConf(conf_file) conf_session = conf_peer.conf._sections['peerconf'] diff --git a/tools/setup.py b/tools/setup.py index c70730c7..f4cc5d74 100755 --- a/tools/setup.py +++ b/tools/setup.py @@ -20,10 +20,12 @@ DTS_TOOLS = DTS_PATH + '/tools' DTS_SUITES = DTS_PATH + '/tests' DTS_EXECS = DTS_PATH + '/executions' -DTS_EXEC_CFG = DTS_PATH + '/execution.cfg' -DTS_CRBS_CFG = DTS_PATH + '/conf/crbs.cfg' -DTS_PORTS_CFG = DTS_PATH + '/conf/ports.cfg' -DTS_IXIA_CFG = DTS_PATH + '/conf/ixia.cfg' +CONFIG_ROOT_PATH = os.environ.get("DTS_CFG_FOLDER") or os.path.join(DTS_PATH, "conf/") + +DTS_EXEC_CFG = os.path.join(DTS_PATH, 'execution.cfg') +DTS_CRBS_CFG = os.path.join(CONFIG_ROOT_PATH, 'crbs.cfg') +DTS_PORTS_CFG = os.path.join(CONFIG_ROOT_PATH, 'ports.cfg') +DTS_IXIA_CFG = os.path.join(CONFIG_ROOT_PATH, 'ixia.cfg') sys.path.append(DTS_FRAMEWORK) sys.path.append(DTS_TOOLS)