b55f7268af87e0517501d9d94b4ac46a321ae387
[functest.git] / functest / opnfv_tests / openstack / refstack / refstack.py
1 #!/usr/bin/env python
2
3 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
4 #
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
9
10 """Refstack testcase implementation."""
11
12 import logging
13 import os
14 import shutil
15
16 from refstack_client import list_parser
17
18 from functest.opnfv_tests.openstack.tempest import tempest
19 from functest.utils import config
20
21
22 class Refstack(tempest.TempestCommon):
23     """Refstack testcase implementation class."""
24
25     __logger = logging.getLogger(__name__)
26
27     defcorelist = os.path.join(
28         getattr(config.CONF, 'dir_refstack_data'), 'defcore.txt')
29
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')
37
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)
43
44     def apply_tempest_blacklist(self):
45         pass