summaryrefslogtreecommitdiffstats
path: root/testcases/OpenStack/tempest/run_tempest.py
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-07-28 21:09:39 +0200
committerJose Lausuch <jose.lausuch@ericsson.com>2016-07-28 20:21:40 +0000
commit4d647e03fc776e9ea369481217d1825c3625b041 (patch)
treee6175c325d9a77b3e3a48d1c55088f722c8b120a /testcases/OpenStack/tempest/run_tempest.py
parent37f3f67687ad8c71a90328d1b9c2c011f0843a59 (diff)
Select test cases in tempest to be blacklisted per each scenario
JIRA: FUNCTEST-396 Added example for SDNVPN test cases Change-Id: I623130fc330c95239d982097552ca09f2a7ea34a Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'testcases/OpenStack/tempest/run_tempest.py')
-rwxr-xr-xtestcases/OpenStack/tempest/run_tempest.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/testcases/OpenStack/tempest/run_tempest.py b/testcases/OpenStack/tempest/run_tempest.py
index f99678df4..8d23b7415 100755
--- a/testcases/OpenStack/tempest/run_tempest.py
+++ b/testcases/OpenStack/tempest/run_tempest.py
@@ -21,11 +21,12 @@ import shutil
import subprocess
import sys
import time
+import yaml
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
-import yaml
+
modes = ['full', 'smoke', 'baremetal', 'compute', 'data_processing',
'identity', 'image', 'network', 'object_storage', 'orchestration',
@@ -330,13 +331,30 @@ def apply_tempest_blacklist():
logger.debug("Applying tempest blacklist...")
cases_file = read_file(TEMPEST_RAW_LIST)
result_file = open(TEMPEST_LIST, 'w')
+ black_tests = []
try:
- black_file = read_file(TEMPEST_BLACKLIST)
+ installer_type = os.getenv('INSTALLER_TYPE')
+ deploy_scenario = os.getenv('DEPLOY_SCENARIO')
+ if (bool(installer_type) * bool(deploy_scenario)):
+ # if INSTALLER_TYPE and DEPLOY_SCENARIO are set we read the file
+ black_list_file = open(TEMPEST_BLACKLIST)
+ black_list_yaml = yaml.safe_load(black_list_file)
+ black_list_file.close()
+ for item in black_list_yaml:
+ scenarios = item['sceanrios']
+ installers = item['installers']
+ if (deploy_scenario in scenarios and
+ installer_type in installers):
+ tests = item['tests']
+ for test in tests:
+ black_tests.append(test)
+ break
except:
- black_file = ''
+ black_tests = []
logger.debug("Tempest blacklist file does not exist.")
+
for line in cases_file:
- if line not in black_file:
+ if line not in black_tests:
result_file.write(str(line) + '\n')
result_file.close()