aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Paraskevopoulos <geopar@intracom-telecom.com>2017-03-18 19:23:22 +0200
committerManuel Buil <mbuil@suse.com>2017-03-18 17:34:49 +0000
commit274de8711c51c3cef513c430356f50360f3e2af4 (patch)
tree25526250f3ec050107011580765a0c0223fa1e2f
parenta00629e030609add3910916b352d3edc5ace7408 (diff)
Run tests in order
Change-Id: I3cbbcd17182bf6f1f6558cb199577d989ac62ae6 Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com> (cherry picked from commit d3b5ba3c16b0918060d1fc800bd47e688146f2c4)
-rw-r--r--sfc/tests/functest/config.yaml5
-rw-r--r--sfc/tests/functest/run_tests.py12
2 files changed, 12 insertions, 5 deletions
diff --git a/sfc/tests/functest/config.yaml b/sfc/tests/functest/config.yaml
index 1e241cdf..bc8cbc3a 100644
--- a/sfc/tests/functest/config.yaml
+++ b/sfc/tests/functest/config.yaml
@@ -20,6 +20,7 @@ defaults:
testcases:
sfc_two_chains_SSH_and_HTTP:
enabled: true
+ order: 1
description: "ODL-SFC tests"
testname_db: "sfc_two_chains_SSH_and_HTTP"
net_name: example-net
@@ -33,6 +34,7 @@ testcases:
sfc_one_chain_two_service_functions_different_computes:
enabled: true
+ order: 0
description: "ODL-SFC Testing SFs in different computes"
testname_db: "sfc_one_chain_two_service_functions_different_computes"
net_name: example-net
@@ -45,7 +47,8 @@ testcases:
test_vnfd_blue: "test2-vnfd2.yaml"
sfc_symmetric_chain:
- enabled: false
+ enabled: false
+ order: 2
description: "Verify the behavior of a symmetric service chain"
testname_db: "sfc_symmetric_chain"
net_name: example-net
diff --git a/sfc/tests/functest/run_tests.py b/sfc/tests/functest/run_tests.py
index 6ad6bb41..204dd3a9 100644
--- a/sfc/tests/functest/run_tests.py
+++ b/sfc/tests/functest/run_tests.py
@@ -23,6 +23,8 @@ import opnfv.utils.ovs_logger as ovs_log
import sfc.lib.cleanup as sfc_cleanup
import sfc.lib.config as sfc_config
import sfc.lib.utils as sfc_utils
+
+from collections import OrderedDict
from opnfv.deployment.factory import Factory as DeploymentFactory
@@ -91,14 +93,16 @@ def main():
config_yaml = yaml.safe_load(f)
testcases = config_yaml.get("testcases")
+ testcases_ordered = OrderedDict(sorted(testcases.items(),
+ key=lambda x: x[1]['order']))
overall_details = {}
overall_status = "FAIL"
overall_start_time = time.time()
- for testcase in testcases:
- if testcases[testcase]['enabled']:
+ for testcase, test_cfg in testcases_ordered.items():
+ if test_cfg['enabled']:
test_name = testcase
- test_descr = testcases[testcase]['description']
- test_name_db = testcases[testcase]['testname_db']
+ test_descr = test_cfg['description']
+ test_name_db = test_cfg['testname_db']
title = ("Running '%s - %s'" %
(test_name, test_descr))
logger.info(title)