3 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 """Refstack testcase implementation."""
16 from refstack_client import list_parser
18 from functest.opnfv_tests.openstack.tempest import tempest
19 from functest.utils import config
22 class Refstack(tempest.TempestCommon):
23 """Refstack testcase implementation class."""
25 __logger = logging.getLogger(__name__)
27 defcorelist = os.path.join(
28 getattr(config.CONF, 'dir_refstack_data'), 'defcore.txt')
30 def __init__(self, **kwargs):
31 if "case_name" not in kwargs:
32 kwargs["case_name"] = 'refstack'
33 super(Refstack, self).__init__(**kwargs)
34 self.res_dir = os.path.join(
35 getattr(config.CONF, 'dir_results'), 'refstack')
36 self.list = os.path.join(self.res_dir, 'tempest-list.txt')
38 def generate_test_list(self):
39 parser = list_parser.TestListParser(
40 getattr(config.CONF, 'dir_repo_tempest'))
41 nfile = parser.get_normalized_test_list(Refstack.defcorelist)
42 shutil.copyfile(nfile, self.list)
44 def apply_tempest_blacklist(self):