diff options
author | Stamatis Katsaounis <mokats@intracom-telecom.com> | 2019-02-16 19:48:58 +0200 |
---|---|---|
committer | Dan Xu <xudan16@huawei.com> | 2019-02-20 09:37:55 +0000 |
commit | e37ce9db19fb583f60fc8d31a4093a8313ff47b8 (patch) | |
tree | d9bac48462457ff22044120738e5121b3a91d512 | |
parent | addca54f10fc065b8c619ddfd31ee843afbefdd4 (diff) |
Remove deprecated ONAP lifecycle test case
This patch removes the ONAP lifecycle deprecated test case.
Furthermore, it clears helper functions as well as unwanted
configuration.
Change-Id: Ib958457cf120ffb641a72be028d3a031741c44c6
Signed-off-by: Stamatis Katsaounis <mokats@intracom-telecom.com>
-rw-r--r-- | dovetail/container.py | 40 | ||||
-rw-r--r-- | dovetail/report.py | 54 | ||||
-rwxr-xr-x | dovetail/run.py | 2 | ||||
-rw-r--r-- | dovetail/test_runner.py | 8 | ||||
-rw-r--r-- | dovetail/testcase.py | 10 | ||||
-rw-r--r-- | dovetail/tests/unit/test_container.py | 136 | ||||
-rw-r--r-- | dovetail/tests/unit/test_report.py | 110 | ||||
-rw-r--r-- | dovetail/tests/unit/test_run.py | 2 | ||||
-rw-r--r-- | dovetail/tests/unit/test_test_runner.py | 4 | ||||
-rw-r--r-- | dovetail/tests/unit/test_testcase.py | 2 | ||||
-rw-r--r-- | dovetail/utils/dovetail_config.py | 6 | ||||
-rw-r--r-- | etc/compliance/onap.1.0.0.yml | 8 | ||||
-rw-r--r-- | etc/conf/dovetail_config.yml | 4 | ||||
-rw-r--r-- | etc/conf/vnftest_config.yml | 31 | ||||
-rw-r--r-- | etc/testcase/onap.onap.vnf_lifecycle.yml | 16 | ||||
-rw-r--r-- | etc/userconfig/vnf_descriptor.yaml.sample | 20 | ||||
-rw-r--r-- | etc/userconfig/vnftest_conf.yaml | 36 |
17 files changed, 9 insertions, 480 deletions
diff --git a/dovetail/container.py b/dovetail/container.py index 43ecf41b..57145034 100644 --- a/dovetail/container.py +++ b/dovetail/container.py @@ -9,8 +9,6 @@ # http://www.apache.org/licenses/LICENSE-2.0 # -import os - import utils.dovetail_logger as dt_logger import utils.dovetail_utils as dt_utils from utils.dovetail_config import DovetailConfig as dt_cfg @@ -49,22 +47,6 @@ class Container(object): tag = self._get_config('docker_tag', project_cfg, testcase_cfg) return "{}:{}".format(name, tag) if name and tag else None - def set_vnftest_config(self): - dovetail_config = dt_cfg.dovetail_config - - log_vol = '-v %s:%s ' % (dovetail_config['result_dir'], - dovetail_config['vnftest']['result']['log']) - - key_file = os.path.join(dovetail_config['config_dir'], - dovetail_config['pri_key']) - key_container_path = dovetail_config['vnftest']['result']['key_path'] - if not os.path.isfile(key_file): - self.logger.debug("Key file {} is not found".format(key_file)) - key_vol = '' - else: - key_vol = '-v %s:%s ' % (key_file, key_container_path) - return "%s %s" % (log_vol, key_vol) - def create(self, docker_image): dovetail_config = dt_cfg.dovetail_config project_cfg = dovetail_config[self.valid_type] @@ -82,24 +64,11 @@ class Container(object): hosts_config = dt_utils.get_hosts_info(self.logger) - # This part will be totally removed after remove the 4 functions - # set_functest_config has been removed - # set_yardstick_config has been removed - # set_bottlenecks_config has been removed - # set_vnftest_config - config = " " - if self.valid_type.lower() == "vnftest": - config = self.set_vnftest_config() - if not config: - return None - - cmd = 'sudo docker run {opts} {envs} {volumes} {config} ' \ + cmd = 'sudo docker run {opts} {envs} {volumes} ' \ '{hosts_config} {docker_image} {shell}'.format(**locals()) ret, container_id = dt_utils.exec_cmd(cmd, self.logger) if ret != 0: return None - if self.valid_type.lower() == 'vnftest': - self.set_vnftest_conf_file(container_id) self.container_id = container_id return container_id @@ -213,10 +182,3 @@ class Container(object): return for item in project_config['copy_file_in_container']: self.copy_file(item['src_file'], item['dest_file']) - - def set_vnftest_conf_file(self): - valid_type = 'vnftest' - for conf_file in dt_cfg.dovetail_config[valid_type]['vnftest_conf']: - src = conf_file['src_file'] - dest = conf_file['dest_file'] - self.docker_copy(src, dest) diff --git a/dovetail/report.py b/dovetail/report.py index 9a41d299..305129c1 100644 --- a/dovetail/report.py +++ b/dovetail/report.py @@ -29,7 +29,7 @@ from testcase import Testcase class Report(object): results = {'functest': {}, 'yardstick': {}, 'functest-k8s': {}, - 'bottlenecks': {}, 'shell': {}, 'vnftest': {}, 'onap-vtp': {}, + 'bottlenecks': {}, 'shell': {}, 'onap-vtp': {}, 'onap-vvp': {}} logger = None @@ -403,38 +403,6 @@ class ShellCrawler(Crawler): return None -class VnftestCrawler(Crawler): - - logger = None - - def __init__(self): - self.type = 'vnftest' - self.logger.debug('Create crawler: {}'.format(self.type)) - - @classmethod - def create_log(cls): - cls.logger = \ - dt_logger.Logger(__name__ + '.VnftestCrawler').getLogger() - - def crawl(self, testcase, file_path): - return self.crawl_from_file(testcase, file_path) - - def crawl_from_file(self, testcase, file_path): - if not os.path.exists(file_path): - self.logger.error('Result file not found: {}'.format(file_path)) - return None - criteria = 'FAIL' - with open(file_path, 'r') as f: - for jsonfile in f: - data = json.loads(jsonfile) - try: - criteria = data['result']['criteria'] - except KeyError as e: - self.logger.exception('Pass flag not found {}'.format(e)) - json_results = {'criteria': criteria} - return json_results - - class OnapVtpCrawler(Crawler): logger = None @@ -532,7 +500,6 @@ class CrawlerFactory(object): 'functest': FunctestCrawler, 'yardstick': YardstickCrawler, 'bottlenecks': BottlenecksCrawler, - 'vnftest': VnftestCrawler, 'shell': ShellCrawler, 'functest-k8s': FunctestK8sCrawler, 'onap-vtp': OnapVtpCrawler, @@ -673,24 +640,6 @@ class ShellChecker(object): testcase.passed(False) -class VnftestChecker(object): - - logger = None - - @classmethod - def create_log(cls): - cls.logger = \ - dt_logger.Logger(__name__ + '.VnftestCheckers').getLogger() - - @staticmethod - def check(testcase, result): - if not result: - testcase.passed('FAIL') - else: - testcase.passed(result['criteria']) - return - - class OnapVtpChecker(object): logger = None @@ -732,7 +681,6 @@ class CheckerFactory(object): 'yardstick': YardstickChecker, 'bottlenecks': BottlenecksChecker, 'shell': ShellChecker, - 'vnftest': VnftestChecker, 'functest-k8s': FunctestK8sChecker, 'onap-vtp': OnapVtpChecker, 'onap-vvp': OnapVvpChecker diff --git a/dovetail/run.py b/dovetail/run.py index 98d70011..f538b86c 100755 --- a/dovetail/run.py +++ b/dovetail/run.py @@ -109,14 +109,12 @@ def create_logs(): dt_report.FunctestCrawler.create_log() dt_report.FunctestK8sCrawler.create_log() dt_report.YardstickCrawler.create_log() - dt_report.VnftestCrawler.create_log() dt_report.BottlenecksCrawler.create_log() dt_report.OnapVtpCrawler.create_log() dt_report.OnapVvpCrawler.create_log() dt_report.FunctestChecker.create_log() dt_report.FunctestK8sChecker.create_log() dt_report.YardstickChecker.create_log() - dt_report.VnftestChecker.create_log() dt_report.BottlenecksChecker.create_log() dt_report.OnapVtpChecker.create_log() dt_report.OnapVvpChecker.create_log() diff --git a/dovetail/test_runner.py b/dovetail/test_runner.py index 9745597d..00cc99e5 100644 --- a/dovetail/test_runner.py +++ b/dovetail/test_runner.py @@ -270,13 +270,6 @@ class ShellRunner(Runner): 'exception: {}'.format(result_filename, e)) -class VnftestRunner(DockerRunner): - - def __init__(self, testcase): - self.type = 'vnftest' - super(VnftestRunner, self).__init__(testcase) - - class OnapVtpRunner(DockerRunner): config_file_name = 'onap-vtp_config.yml' @@ -316,7 +309,6 @@ class TestRunnerFactory(object): "yardstick": YardstickRunner, "bottlenecks": BottlenecksRunner, "shell": ShellRunner, - "vnftest": VnftestRunner, "functest-k8s": FunctestK8sRunner, "onap-vtp": OnapVtpRunner, "onap-vvp": OnapVvpRunner diff --git a/dovetail/testcase.py b/dovetail/testcase.py index 93aa6072..e40ec4db 100644 --- a/dovetail/testcase.py +++ b/dovetail/testcase.py @@ -340,15 +340,6 @@ class ShellTestcase(Testcase): self.type = 'shell' -class VnftestTestcase(Testcase): - - validate_testcase_list = {} - - def __init__(self, testcase_yaml): - super(VnftestTestcase, self).__init__(testcase_yaml) - self.type = 'vnftest' - - class OnapVtpTestcase(Testcase): validate_testcase_list = {} @@ -373,7 +364,6 @@ class TestcaseFactory(object): 'yardstick': YardstickTestcase, 'bottlenecks': BottlenecksTestcase, 'shell': ShellTestcase, - 'vnftest': VnftestTestcase, 'functest-k8s': FunctestK8sTestcase, 'onap-vtp': OnapVtpTestcase, 'onap-vvp': OnapVvpTestcase diff --git a/dovetail/tests/unit/test_container.py b/dovetail/tests/unit/test_container.py index 803566b1..6a8b99fc 100644 --- a/dovetail/tests/unit/test_container.py +++ b/dovetail/tests/unit/test_container.py @@ -36,22 +36,6 @@ class ContainerTesting(unittest.TestCase): pass @patch('dovetail.container.dt_cfg') - @patch.object(Container, 'docker_copy') - def test_set_vnftest_conf_file(self, mock_copy, mock_config): - source_file = 'source' - destination_file = 'destination_file' - mock_config.dovetail_config = { - 'vnftest': { - 'vnftest_conf': [{ - 'src_file': source_file, - 'dest_file': destination_file}]}} - - self.container.set_vnftest_conf_file() - - mock_copy.assert_called_once_with( - source_file, destination_file) - - @patch('dovetail.container.dt_cfg') @patch.object(Container, 'copy_file') def test_copy_files_in_container(self, mock_copy, mock_config): source_file = 'source' @@ -416,53 +400,6 @@ class ContainerTesting(unittest.TestCase): self.assertEquals(self.logger, self.container.logger) - @patch('dovetail.container.dt_cfg') - @patch('dovetail.container.os.path') - def test_set_vnftest_config_no_file(self, mock_path, mock_config): - v_one = 'v_one' - v_two = 'v_two' - v_three = 'v_three' - v_four = 'v_four' - v_five = 'v_five' - mock_path.join.return_value = '/'.join([v_two, v_three]) - mock_path.isfile.return_value = False - mock_config.dovetail_config = { - 'result_dir': v_one, 'config_dir': v_two, - 'pri_key': v_three, 'vnftest': { - 'result': {'log': v_four, 'key_path': v_five}}} - - expected = '-v {}:{} '.format(v_one, v_four) - result = self.container.set_vnftest_config() - - mock_path.join.assert_called_once_with(v_two, v_three) - mock_path.isfile.assert_called_once_with('/'.join([v_two, v_three])) - self.logger.debug.assert_called_once_with( - 'Key file {} is not found'.format('/'.join([v_two, v_three]))) - self.assertEquals(expected, result) - - @patch('dovetail.container.dt_cfg') - @patch('dovetail.container.os.path') - def test_set_vnftest_config(self, mock_path, mock_config): - v_one = 'v_one' - v_two = 'v_two' - v_three = 'v_three' - v_four = 'v_four' - v_five = 'v_five' - mock_path.join.return_value = '/'.join([v_two, v_three]) - mock_path.isfile.return_value = True - mock_config.dovetail_config = { - 'result_dir': v_one, 'config_dir': v_two, - 'pri_key': v_three, 'vnftest': { - 'result': {'log': v_four, 'key_path': v_five}}} - - expected = '-v {}:{} -v {}/{}:{} '.format(v_one, v_four, v_two, - v_three, v_five) - result = self.container.set_vnftest_config() - - mock_path.join.assert_called_once_with(v_two, v_three) - mock_path.isfile.assert_called_once_with('/'.join([v_two, v_three])) - self.assertEquals(expected, result) - @patch('dovetail.container.dt_utils') @patch('dovetail.container.dt_cfg') def test_create(self, mock_config, mock_utils): @@ -485,7 +422,7 @@ class ContainerTesting(unittest.TestCase): call('volumes', project_config)]) mock_utils.get_hosts_info.assert_called_once_with(self.logger) mock_utils.exec_cmd.assert_called_once_with( - 'sudo docker run opts envs volume_one volume_two host_info ' + 'sudo docker run opts envs volume_one volume_two host_info ' 'docker_image shell', self.logger) self.assertEquals(expected, result) @@ -506,12 +443,10 @@ class ContainerTesting(unittest.TestCase): @patch('dovetail.container.dt_utils') @patch('dovetail.container.dt_cfg') - @patch('dovetail.container.os.getenv') - def test_create_error(self, mock_getenv, mock_config, mock_utils): + def test_create_error(self, mock_config, mock_utils): docker_image = 'docker_image' mock_utils.get_value_from_dict.side_effect = [ 'opts', 'shell', 'envs', ['volume_one']] - mock_getenv.side_effect = ['True', 'dovetail_home', None, 'True'] mock_utils.get_hosts_info.return_value = 'host_info' mock_utils.check_https_enabled.return_value = True mock_utils.exec_cmd.return_value = (1, 'error') @@ -526,71 +461,6 @@ class ContainerTesting(unittest.TestCase): call('volumes', project_config)]) mock_utils.get_hosts_info.assert_called_once_with(self.logger) mock_utils.exec_cmd.assert_called_once_with( - 'sudo docker run opts envs volume_one host_info ' + 'sudo docker run opts envs volume_one host_info ' 'docker_image shell', self.logger) self.assertEquals(None, result) - - @patch('dovetail.container.dt_utils') - @patch('dovetail.container.dt_cfg') - @patch('dovetail.container.os.getenv') - @patch.object(Container, 'set_vnftest_config') - @patch.object(Container, 'set_vnftest_conf_file') - def test_create_vnftest(self, mock_setvnffile, mock_setvnfconf, - mock_getenv, mock_config, mock_utils): - docker_image = 'docker_image' - container_id = 'container_id' - mock_utils.get_value_from_dict.side_effect = [ - 'opts', 'shell', 'envs', ['volume_one']] - mock_getenv.side_effect = ['False', 'dovetail_home', 'cacert', 'True'] - mock_setvnfconf.return_value = 'vnftest_config' - mock_utils.get_hosts_info.return_value = 'host_info' - mock_utils.exec_cmd.return_value = (0, container_id) - project_config = {} - mock_config.dovetail_config = {'vnftest': project_config} - - expected = container_id - self.container.valid_type = 'vnftest' - result = self.container.create(docker_image) - self.container.valid_type = 'bottlenecks' - - mock_utils.get_value_from_dict.assert_has_calls([ - call('opts', project_config), - call('shell', project_config), - call('envs', project_config), - call('volumes', project_config)]) - mock_utils.get_hosts_info.assert_called_once_with(self.logger) - mock_setvnfconf.assert_called_once_with() - mock_setvnffile.assert_called_once_with(container_id) - mock_utils.exec_cmd.assert_called_once_with( - 'sudo docker run opts envs volume_one vnftest_config host_info ' - 'docker_image shell', - self.logger) - self.assertEquals(expected, result) - - @patch('dovetail.container.dt_utils') - @patch('dovetail.container.dt_cfg') - @patch('dovetail.container.os.getenv') - @patch.object(Container, 'set_vnftest_config') - def test_create_vnftest_error(self, mock_setvnfconf, - mock_getenv, mock_config, mock_utils): - docker_image = 'docker_image' - mock_utils.get_value_from_dict.side_effect = [ - 'opts', 'shell', 'envs', ['volume_one']] - mock_getenv.return_value = 'True' - mock_setvnfconf.return_value = None - mock_config.dovetail_config = { - 'vnftest': 'value', - 'build_tag': 'v_one'} - - self.container.valid_type = 'vnftest' - result = self.container.create(docker_image) - self.container.valid_type = 'bottlenecks' - - mock_utils.get_value_from_dict.assert_has_calls([ - call('opts', 'value'), - call('shell', 'value'), - call('envs', 'value'), - call('volumes', 'value')]) - mock_utils.get_hosts_info.assert_called_once_with(self.logger) - mock_setvnfconf.assert_called_once_with() - self.assertEquals(None, result) diff --git a/dovetail/tests/unit/test_report.py b/dovetail/tests/unit/test_report.py index d97cacf8..acd44141 100644 --- a/dovetail/tests/unit/test_report.py +++ b/dovetail/tests/unit/test_report.py @@ -34,20 +34,18 @@ class ReportTesting(unittest.TestCase): dt_report.FunctestK8sCrawler.logger = None dt_report.YardstickCrawler.logger = None dt_report.BottlenecksCrawler.logger = None - dt_report.VnftestCrawler.logger = None dt_report.OnapVtpCrawler.logger = None dt_report.OnapVvpCrawler.logger = None dt_report.FunctestChecker.logger = None dt_report.FunctestK8sChecker.logger = None dt_report.YardstickChecker.logger = None dt_report.BottlenecksChecker.logger = None - dt_report.VnftestChecker.logger = None dt_report.OnapVtpChecker.logger = None dt_report.OnapVvpChecker.logger = None dt_report.Report.logger = None dt_report.Report.results = { 'functest': {}, 'yardstick': {}, 'functest-k8s': {}, - 'bottlenecks': {}, 'shell': {}, 'vnftest': {}, 'onap-vtp': {}, + 'bottlenecks': {}, 'shell': {}, 'onap-vtp': {}, 'onap-vvp': {}} def _produce_report_initial_text(self, report_data): @@ -879,85 +877,6 @@ class ReportTesting(unittest.TestCase): self.assertEquals('result', result) @patch('dovetail.report.dt_logger') - def test_vnftest_crawler_create_log(self, mock_logger): - getlogger_obj = Mock() - logger_obj = Mock() - logger_obj.getLogger.return_value = getlogger_obj - mock_logger.Logger.return_value = logger_obj - - dt_report.VnftestCrawler.create_log() - - self.assertEquals(getlogger_obj, dt_report.VnftestCrawler.logger) - - @patch('dovetail.report.os.path') - def test_vnftest_crawler_crawl_not_exists(self, mock_path): - logger_obj = Mock() - dt_report.VnftestCrawler.logger = logger_obj - mock_path.exists.return_value = False - file_path = 'file_path' - - crawler = dt_report.VnftestCrawler() - result = crawler.crawl(None, file_path) - - mock_path.exists.assert_called_once_with(file_path) - logger_obj.error.assert_called_once_with( - 'Result file not found: {}'.format(file_path)) - self.assertEquals(None, result) - - @patch('__builtin__.open') - @patch('dovetail.report.json.loads') - @patch('dovetail.report.os.path') - def test_vnftest_crawler_crawl(self, mock_path, mock_loads, - mock_open): - dt_report.VnftestCrawler.logger = Mock() - mock_path.exists.return_value = True - file_path = 'file_path' - testcase_obj = Mock() - file_obj = Mock() - mock_open.return_value.__enter__.return_value = [file_obj] - data_dict = { - 'result': { - 'criteria': 'PASS' - } - } - mock_loads.return_value = data_dict - - crawler = dt_report.VnftestCrawler() - result = crawler.crawl(testcase_obj, file_path) - expected = {'criteria': 'PASS'} - - mock_path.exists.assert_called_once_with(file_path) - mock_open.assert_called_once_with(file_path, 'r') - mock_loads.assert_called_once_with(file_obj) - self.assertEquals(expected, result) - - @patch('__builtin__.open') - @patch('dovetail.report.json.loads') - @patch('dovetail.report.os.path') - def test_vnftest_crawler_crawl_key_error(self, mock_path, mock_loads, - mock_open): - logger_obj = Mock() - dt_report.VnftestCrawler.logger = logger_obj - mock_path.exists.return_value = True - file_path = 'file_path' - testcase_obj = Mock() - file_obj = Mock() - mock_open.return_value.__enter__.return_value = [file_obj] - - mock_loads.return_value = {} - - crawler = dt_report.VnftestCrawler() - result = crawler.crawl(testcase_obj, file_path) - expected = {'criteria': 'FAIL'} - - mock_path.exists.assert_called_once_with(file_path) - mock_open.assert_called_once_with(file_path, 'r') - mock_loads.assert_called_once_with(file_obj) - logger_obj.exception.assert_called_once_with( - "Pass flag not found 'result'") - self.assertEquals(expected, result) - - @patch('dovetail.report.dt_logger') def test_onapvtp_crawler_create_log(self, mock_logger): getlogger_obj = Mock() logger_obj = Mock() @@ -1425,33 +1344,6 @@ class ReportTesting(unittest.TestCase): testcase_obj.passed.assert_called_once_with(False) - @patch('dovetail.report.dt_logger') - def test_vnftest_checker_create_log(self, mock_logger): - getlogger_obj = Mock() - logger_obj = Mock() - logger_obj.getLogger.return_value = getlogger_obj - mock_logger.Logger.return_value = logger_obj - - dt_report.VnftestChecker.create_log() - - self.assertEquals(getlogger_obj, dt_report.VnftestChecker.logger) - - def test_vnftest_check_result(self): - testcase_obj = Mock() - result = {'criteria': 'PASS'} - - dt_report.VnftestChecker.check(testcase_obj, result) - - testcase_obj.passed.assert_called_once_with('PASS') - - def test_vnftest_check_result_none(self): - testcase_obj = Mock() - result = {} - - dt_report.VnftestChecker.check(testcase_obj, result) - - testcase_obj.passed.assert_called_once_with('FAIL') - def test_checker_factory(self): result = dt_report.CheckerFactory.create('shell') self.assertEquals(dt_report.ShellChecker, result.__class__) diff --git a/dovetail/tests/unit/test_run.py b/dovetail/tests/unit/test_run.py index fed198c0..80b5eca6 100644 --- a/dovetail/tests/unit/test_run.py +++ b/dovetail/tests/unit/test_run.py @@ -211,11 +211,9 @@ class RunTesting(unittest.TestCase): mock_report.Report.create_log.assert_called_once_with() mock_report.FunctestCrawler.create_log.assert_called_once_with() mock_report.YardstickCrawler.create_log.assert_called_once_with() - mock_report.VnftestCrawler.create_log.assert_called_once_with() mock_report.BottlenecksCrawler.create_log.assert_called_once_with() mock_report.FunctestChecker.create_log.assert_called_once_with() mock_report.YardstickChecker.create_log.assert_called_once_with() - mock_report.VnftestChecker.create_log.assert_called_once_with() mock_report.BottlenecksChecker.create_log.assert_called_once_with() mock_testcase.Testcase.create_log.assert_called_once_with() mock_testcase.Testsuite.create_log.assert_called_once_with() diff --git a/dovetail/tests/unit/test_test_runner.py b/dovetail/tests/unit/test_test_runner.py index 0eb12135..345dfd65 100644 --- a/dovetail/tests/unit/test_test_runner.py +++ b/dovetail/tests/unit/test_test_runner.py @@ -211,9 +211,9 @@ class TestRunnerTesting(unittest.TestCase): @patch('dovetail.test_runner.dt_utils') @patch('dovetail.test_runner.os') def test_archive_logs_no_files(self, mock_os, mock_utils, mock_config): - t_runner.VnftestRunner.create_log() + t_runner.FunctestRunner.create_log() mock_config.dovetail_config = {'result_dir': 'result_dir'} - docker_runner = t_runner.VnftestRunner(self.testcase) + docker_runner = t_runner.FunctestRunner(self.testcase) mock_os.environ = {'DOVETAIL_HOME': 'dovetail_home'} mock_utils.get_value_from_dict.return_value = [] diff --git a/dovetail/tests/unit/test_testcase.py b/dovetail/tests/unit/test_testcase.py index b224a130..e3f2a64c 100644 --- a/dovetail/tests/unit/test_testcase.py +++ b/dovetail/tests/unit/test_testcase.py @@ -89,7 +89,7 @@ class TestcaseTesting(unittest.TestCase): @patch('dovetail.testcase.dt_cfg') @patch.object(tcase.Testcase, 'parse_cmd') def test_prepare_cmd_testcase_cmd(self, mock_parse, mock_config): - testcase = tcase.VnftestTestcase(self.testcase_yaml) + testcase = tcase.ShellTestcase(self.testcase_yaml) testcase.testcase['validate']['cmds'] = ['cmd'] mock_config.dovetail_config = {} mock_parse.return_value = True diff --git a/dovetail/utils/dovetail_config.py b/dovetail/utils/dovetail_config.py index e448888f..1d13c696 100644 --- a/dovetail/utils/dovetail_config.py +++ b/dovetail/utils/dovetail_config.py @@ -22,12 +22,6 @@ class DovetailConfig(object): with open(os.path.join(conf_path, 'dovetail_config.yml')) as f: cls.dovetail_config = yaml.safe_load(f) - for extra_config_file in cls.dovetail_config['include_config']: - file_path = os.path.join(conf_path, extra_config_file) - with open(file_path) as f: - extra_config = yaml.safe_load(f) - cls.dovetail_config.update(extra_config) - path = os.path.join(conf_path, cls.dovetail_config['cli_file_name']) with open(path) as f: cmd_yml = yaml.safe_load(f) diff --git a/etc/compliance/onap.1.0.0.yml b/etc/compliance/onap.1.0.0.yml deleted file mode 100644 index b7566b3f..00000000 --- a/etc/compliance/onap.1.0.0.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -onap.1.0.0: - name: onap.1.0.0 - version: '1.0.0' - vnf_type: tosca - testcases_list: - optional: - - onap.lifecycle.tc001 diff --git a/etc/conf/dovetail_config.yml b/etc/conf/dovetail_config.yml index cdad0554..72d7fda3 100644 --- a/etc/conf/dovetail_config.yml +++ b/etc/conf/dovetail_config.yml @@ -20,7 +20,6 @@ testsuite_supported: - ovp.2018.09 - onap.tosca.2019.04 - onap.heat.2019.04 - - onap.1.0.0 # used for testcase cmd template in jinja2 format # we have two variables available now @@ -31,6 +30,3 @@ parameters: path: '("name",)' - name: validate_testcase path: '("validate", "testcase")' - -include_config: - - vnftest_config.yml diff --git a/etc/conf/vnftest_config.yml b/etc/conf/vnftest_config.yml deleted file mode 100644 index 4104d763..00000000 --- a/etc/conf/vnftest_config.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -vnftest: - image_name: onap/vnfsdk/vnftest - docker_tag: latest - opts: '-id --privileged=true' - shell: '/bin/bash' - config: - dir: '/home/onap/userconfig' - pre_condition: - - 'echo this is pre_condition' - cmds: - - 'mkdir -p /home/onap/vnftest/results/' - - "cd /home/onap/repos/vnftest && source /etc/vnftest/openstack.creds && - export CONF_FILE=/etc/vnftest/vnftest.yaml && - vnftest task start --output-file /home/onap/vnftest/results/{{testcase}}.out - /etc/vnftest/vnf_descriptor.yaml - tests/onap/test_cases/{{validate_testcase}}.yaml" - post_condition: - - 'echo this is post_condition' - result: - dir: '/home/onap/vnftest/results' - log: '/tmp/vnftest' - key_path: '/root/.ssh/id_rsa' - openrc: '/etc/vnftest/openstack.creds' - vnftest_conf: - - - src_file: '/home/opnfv/dovetail/pre_config/vnftest_conf.yaml' - dest_file: '/etc/vnftest/vnftest.yaml' - - - src_file: '/home/opnfv/dovetail/pre_config/vnf_descriptor.yaml' - dest_file: '/etc/vnftest/vnf_descriptor.yaml' diff --git a/etc/testcase/onap.onap.vnf_lifecycle.yml b/etc/testcase/onap.onap.vnf_lifecycle.yml deleted file mode 100644 index 9bb928ce..00000000 --- a/etc/testcase/onap.onap.vnf_lifecycle.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -onap.onap.vnf_lifecycle: - name: onap.onap.vnf_lifecycle - objective: vnf lifecycle tests - validate: - type: vnftest - testcase: onap_vnftest_tc001 - report: - source_archive_files: - - vnftest.log - - onap.onap.vnf_lifecycle.out - dest_archive_files: - - onap_logs/onap.onap.vnf_lifecycle.log - - onap_logs/onap.onap.vnf_lifecycle.out - check_results_file: onap_logs/onap.onap.vnf_lifecycle.out - sub_testcase_list: diff --git a/etc/userconfig/vnf_descriptor.yaml.sample b/etc/userconfig/vnf_descriptor.yaml.sample deleted file mode 100644 index 98741768..00000000 --- a/etc/userconfig/vnf_descriptor.yaml.sample +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.0 (the"License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and limitations under -# the License -############################################################################## - ---- - -vnf_name: sample_firewall -type: CSAR -vnf_id: 123456 -csar_package_location: /home/opnfv/userconfig/pre_config/vFW_sample.csar
\ No newline at end of file diff --git a/etc/userconfig/vnftest_conf.yaml b/etc/userconfig/vnftest_conf.yaml deleted file mode 100644 index 781540bd..00000000 --- a/etc/userconfig/vnftest_conf.yaml +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.0 (the"License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and limitations under -# the License -############################################################################## - -dir: - conf: /etc/nvftest - repos: /home/vnftest/repos/vnftest - log: /tmp/vnftest - -file: - output_file: /tmp/vnftest.out - html_file: /tmp/vnftest.htm - reporting_file: /tmp/report.html - -component: - aai_ip: 10.247.43.140 - aai_port: 30202 - aai_ssl_port: 30233 - mso_ip: 10.247.43.140 - sdc_ip: 10.247.43.140 - sdc_port: 30205 - sdc_catalog_port: 30206 - sdc_designer_user: cs0008 - sdc_tester_user: jm0007 - sdc_governance_user: gv0001 - sdc_operations_user: op0001
\ No newline at end of file |