@@ -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`.
@@ -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.
@@ -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
@@ -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
@@ -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.
"""
@@ -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'
@@ -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:
@@ -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;
@@ -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']
@@ -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):
@@ -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()):
@@ -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():
@@ -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():
@@ -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():
@@ -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():
@@ -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()):
@@ -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:
@@ -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']
@@ -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():
@@ -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():
@@ -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']
@@ -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)