Enable OVP tests to run on a DPDK-enabled system 33/59333/7
authorPanagiotis Karalis <pkaralis@intracom-telecom.com>
Fri, 29 Jun 2018 13:14:22 +0000 (16:14 +0300)
committerPanagiotis Karalis <pkaralis@intracom-telecom.com>
Thu, 12 Jul 2018 08:40:02 +0000 (11:40 +0300)
DPDK-enabled NFVIs require support for hugepages which
in turn is configured by means of extra_specs in flavors.
Currently, Functest enables hugepage support if the name
of the scenario contains the substring "ovs".

Dovetail allows end users to run all tests on DPDK-enabled systems
and the documentation has been updates accordingly.

JIRA: DOVETAIL-665

Change-Id: If4898da168f8b4c69a045ef3b00b8a8862f29b0c
Signed-off-by: Panagiotis Karalis <pkaralis@intracom-telecom.com>
docs/testing/user/userguide/cli_reference.rst
docs/testing/user/userguide/testing_guide.rst
dovetail/run.py
dovetail/test_runner.py
etc/conf/cmd_config.yml
etc/conf/functest_config.yml

index 7fca713..9377c2a 100644 (file)
@@ -83,6 +83,10 @@ Commands List
 | dovetail run --vnf_tag | -v <vnftest_docker_image_tag>                 | Specify vnftest's docker image tag, default is beijing.0                                          |
 |                                                                        |                                                                                                   |
 +------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+
+| dovetail run --deploy-scenario <deploy_scenario_name>                  | Specify the deploy scenario having as project name 'ovs'                                          |
+|                                                                        |                                                                                                   |
++------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------+
+
 
 Commands Examples
 =================
@@ -191,23 +195,25 @@ Dovetail Run Commands
    Dovetail compliance test entry!
 
    Options:
-   -b, --bott_tag TEXT  Overwrite tag for bottlenecks docker container (e.g. cvp.0.4.0)
-   -f, --func_tag TEXT  Overwrite tag for functest docker container (e.g. cvp.0.5.0)
-   -y, --yard_tag TEXT  Overwrite tag for yardstick docker container (e.g. danube.3.2)
-   --testarea TEXT      compliance testarea within testsuite
-   --offline            run in offline method, which means not to update the docker upstream images, functest, yardstick, etc.
-   -r, --report TEXT    push results to DB (e.g. --report http://192.168.135.2:8000/api/v1/results)
-   --testsuite TEXT     compliance testsuite.
-   -d, --debug          Flag for showing debug log on screen.
-   -h, --help           Show this message and exit.
+   -b, --bott_tag TEXT     Overwrite tag for bottlenecks docker container (e.g. cvp.0.4.0)
+   -f, --func_tag TEXT     Overwrite tag for functest docker container (e.g. cvp.0.5.0)
+   -y, --yard_tag TEXT     Overwrite tag for yardstick docker container (e.g. danube.3.2)
+   --deploy-scenario TEXT  Specify the DEPLOY_SCENARIO which will be used as input by each testcase respectively
+   --testarea TEXT         compliance testarea within testsuite
+   --offline               run in offline method, which means not to update the docker upstream images, functest, yardstick, etc.
+   -r, --report TEXT       push results to DB (e.g. --report http://192.168.135.2:8000/api/v1/results)
+   --testsuite TEXT        compliance testsuite.
+   -d, --debug             Flag for showing debug log on screen.
+   -h, --help              Show this message and exit.
 
 .. code-block:: bash
 
-   root@1f230e719e44:~/dovetail/dovetail# dovetail run --testsuite proposed_tests --testarea vping --offline -r http://192.168.135.2:8000/api/v1/results
+   root@1f230e719e44:~/dovetail/dovetail# dovetail run --testsuite proposed_tests --testarea vping --offline -r http://192.168.135.2:8000/api/v1/results --deploy-scenario os-nosdn-ovs-ha
    2017-10-12 14:57:51,278 - run - INFO - ================================================
    2017-10-12 14:57:51,278 - run - INFO - Dovetail compliance: proposed_tests!
    2017-10-12 14:57:51,278 - run - INFO - ================================================
    2017-10-12 14:57:51,278 - run - INFO - Build tag: daily-master-b80bca76-af5d-11e7-879a-0242ac110002
+   2017-10-12 14:57:51,278 - run - INFO - DEPLOY_SCENARIO : os-nosdn-ovs-ha
    2017-10-12 14:57:51,336 - run - WARNING - There is no hosts file /home/jenkins/opnfv/slave_root/workspace/dovetail-compass-huawei-pod7-proposed_tests-danube/cvp/pre_config/hosts.yaml, may be some issues with domain name resolution.
    2017-10-12 14:57:51,517 - run - INFO - >>[testcase]: dovetail.vping.tc001
    2017-10-12 14:58:21,325 - run - INFO - Results have been pushed to database and stored with local file /home/dovetail/results/results.json.
index 17c5431..a979d9d 100644 (file)
@@ -608,6 +608,30 @@ contain additional attributes. For more information on this command line option
 and its intended usage, refer to
 :ref:`dovetail-exemption_process_api_response_validation`.
 
+.. code-block:: bash
+
+   $ dovetail run --testcase dovetail.tempest.osinterop --deploy-scenario os-nosdn-ovs-ha
+
+By default, during test case execution, the respective feature is responsible to
+decide what flavor is going to use for the execution of each test scenario which is under
+of its umbrella.
+In parallel, there is also implemented a mechanism in order for the extra specs in flavors of
+executing test scenarios to be hugepages instead of the default option.
+This is happening if the name of the scenario contains the substring "ovs".
+In this case, the flavor which is going to be used for the running test case has
+'hugepage' characteristics.
+
+Taking the above into our consideration and having in our mind that the DEPLOY_SCENARIO
+environment parameter is not used by dovetail framework (the initial value is 'unknown'),
+we set as input, for the features that they are responsible for the test case execution,
+the DEPLOY_SCENARIO environment parameter having as substring the feature name "ovs"
+(e.g. os-nosdn-ovs-ha).
+
+Note for the users:
+ - if their system uses DPDK, they should run with --deploy-scenario <xx-yy-ovs-zz>
+   (e.g. os-nosdn-ovs-ha)
+ - this is an experimental feature
+
 .. code-block:: bash
 
    $ dovetail run --no-api-validation
index d32650b..4f64375 100755 (executable)
@@ -32,7 +32,6 @@ from utils.dovetail_config import DovetailConfig as dt_cfg
 import utils.dovetail_logger as dt_logger
 import utils.dovetail_utils as dt_utils
 
-
 EXIT_RUN_FAILED = 2
 
 
@@ -203,6 +202,12 @@ def env_init(logger):
     dt_utils.source_env(openrc)
 
 
+def update_deploy_scenario(logger, **kwargs):
+    if 'deploy_scenario' in kwargs and kwargs['deploy_scenario'] is not None:
+        os.environ['DEPLOY_SCENARIO'] = kwargs['deploy_scenario']
+        logger.info("DEPLOY_SCENARIO : %s", os.environ['DEPLOY_SCENARIO'])
+
+
 def check_hosts_file(logger):
     hosts_file = os.path.join(dt_cfg.dovetail_config['config_dir'],
                               'hosts.yaml')
@@ -279,6 +284,7 @@ def main(*args, **kwargs):
     logger.info('================================================')
     logger.info('Build tag: {}'.format(dt_cfg.dovetail_config['build_tag']))
     parse_cli(logger, **kwargs)
+    update_deploy_scenario(logger, **kwargs)
     env_init(logger)
     copy_userconfig_files(logger)
     copy_patch_files(logger)
index 40e5528..c49182b 100644 (file)
@@ -151,6 +151,8 @@ class DockerRunner(object):
         config_item['validate_testcase'] = testcase.validate_testcase()
         config_item['testcase'] = testcase.name()
         config_item['os_insecure'] = os.getenv("OS_INSECURE")
+        if 'DEPLOY_SCENARIO' in os.environ:
+            config_item['deploy_scenario'] = os.environ['DEPLOY_SCENARIO']
         return config_item
 
     def _update_config(self, testcase):
index 0545658..3bfce46 100644 (file)
@@ -93,3 +93,7 @@ cli:
           - '-n'
         is_flag: 'True'
         help: 'Keep all Containers created for debuging.'
+      deployscenario:
+        flags:
+          - '--deploy-scenario'
+        help: 'Specify the DEPLOY_SCENARIO which will be used as input by each testcase respectively'
index 1e7cfeb..b9453e1 100644 (file)
@@ -1,6 +1,7 @@
 ---
 
 {% set validate_testcase = validate_testcase or '' %}
+{% set deploy_scenario = deploy_scenario or 'unknown' %}
 {% set os_insecure = os_insecure or 'False' %}
 {% set os_verify = '' %}
 {% if os_insecure == 'True' %}
@@ -11,7 +12,7 @@ functest:
   image_name: opnfv/functest-smoke
   docker_tag: fraser
   opts: '-id --privileged=true'
-  envs: '{{os_verify}} -e INSTALLER_TYPE=unknown -e DEPLOY_SCENARIO=unknown -e NODE_NAME=unknown
+  envs: '{{os_verify}} -e INSTALLER_TYPE=unknown -e DEPLOY_SCENARIO={{deploy_scenario}} -e NODE_NAME=unknown
          -e TEST_DB_URL=file:///home/opnfv/functest/results/functest_results.txt'
   config:
     dir: '/home/opnfv/userconfig'