Fix VVP test case 99/67399/6
authorStamatis Katsaounis <mokats@intracom-telecom.com>
Wed, 27 Mar 2019 07:38:14 +0000 (09:38 +0200)
committerxudan <xudan16@huawei.com>
Fri, 29 Mar 2019 03:16:43 +0000 (23:16 -0400)
This patch adds check for no environment variables provided to
container configuration. Furthermore, it changes the check results
file to a list of check result files.

Change-Id: I2112ee1fd4b3156608d8a27dd3b9c90dbe35a24c
Signed-off-by: Stamatis Katsaounis <mokats@intracom-telecom.com>
Co-Authored-By: Panagiotis Karalis <pkaralis@intracom-telecom.com>
docs/testing/user/userguide/vnf_test_guide.rst
dovetail/container.py
dovetail/report.py
dovetail/tests/unit/test_report.py
etc/testcase/onap-vvp.validate.heat.yml

index 63ed04b..f37858c 100644 (file)
@@ -89,6 +89,7 @@ test results are going to be saved:
 
    $ mkdir -p ${DOVETAIL_HOME}/pre_config
    $ mkdir -p ${DOVETAIL_HOME}/results
+   $ chmod 777 ${DOVETAIL_HOME}/results
 
 
 There should be a file `env_config.sh` inside this directory to provide some info.
index 250bb54..71cb412 100644 (file)
@@ -60,7 +60,9 @@ class Container(object):
         if not shell:
             return None
         env_list = dt_utils.get_value_from_dict('envs', project_cfg)
-        kwargs['environment'] = [env for env in env_list if env is not None]
+        if env_list:
+            kwargs['environment'] = \
+                [env for env in env_list if env is not None]
         volume_list = dt_utils.get_value_from_dict('volumes', project_cfg)
         kwargs['volumes'] = [vol for vol in volume_list if vol is not None]
         kwargs['extra_hosts'] = dt_utils.get_hosts_info(self.logger)
index 556fc76..36a33a4 100644 (file)
@@ -515,8 +515,8 @@ class OnapVvpCrawler(Crawler):
     def create_log(cls):
         cls.logger = dt_logger.Logger(__name__ + '.OnapVvpCrawler').getLogger()
 
-    def crawl(self, testcase, file_path):
-        return self.crawl_from_file(testcase, file_path)
+    def crawl(self, testcase, file_paths):
+        return self.crawl_from_file(testcase, file_paths[0])
 
     def crawl_from_file(self, testcase, file_path):
         if not os.path.exists(file_path):
index e44c6ac..53b06cb 100644 (file)
@@ -980,7 +980,7 @@ class ReportTesting(unittest.TestCase):
         file_path = 'file_path'
 
         crawler = dt_report.OnapVvpCrawler()
-        result = crawler.crawl(None, file_path)
+        result = crawler.crawl(None, [file_path])
 
         mock_path.exists.assert_called_once_with(file_path)
         logger_obj.error.assert_called_once_with(
@@ -1000,7 +1000,7 @@ class ReportTesting(unittest.TestCase):
         mock_open.return_value.__enter__.return_value = file_obj
 
         crawler = dt_report.OnapVvpCrawler()
-        result = crawler.crawl(testcase_obj, file_path)
+        result = crawler.crawl(testcase_obj, [file_path])
         expected = {'criteria': 'PASS'}
 
         mock_path.exists.assert_called_once_with(file_path)
@@ -1022,7 +1022,7 @@ class ReportTesting(unittest.TestCase):
         mock_open.return_value.__enter__.return_value = file_obj
 
         crawler = dt_report.OnapVvpCrawler()
-        result = crawler.crawl(testcase_obj, file_path)
+        result = crawler.crawl(testcase_obj, [file_path])
         expected = {'criteria': 'FAIL'}
 
         mock_path.exists.assert_called_once_with(file_path)
@@ -1044,7 +1044,7 @@ class ReportTesting(unittest.TestCase):
         mock_open.return_value.__enter__.return_value = file_obj
 
         crawler = dt_report.OnapVvpCrawler()
-        result = crawler.crawl(testcase_obj, file_path)
+        result = crawler.crawl(testcase_obj, [file_path])
         expected = {'criteria': 'FAIL'}
 
         mock_path.exists.assert_called_once_with(file_path)
@@ -1068,7 +1068,7 @@ class ReportTesting(unittest.TestCase):
         mock_open.return_value.__enter__.return_value = file_obj
 
         crawler = dt_report.OnapVvpCrawler()
-        result = crawler.crawl(testcase_obj, file_path)
+        result = crawler.crawl(testcase_obj, [file_path])
         expected = {'criteria': 'FAIL'}
 
         mock_path.exists.assert_called_once_with(file_path)
index a4ca9ab..2cdab7c 100644 (file)
@@ -12,5 +12,6 @@ onap-vvp.validate.heat:
     dest_archive_files:
       - onap-vvp_logs/failures
       - onap-vvp_logs/report.json
-    check_results_file: onap-vvp_logs/report.json
+    check_results_files:
+      - onap-vvp_logs/report.json
     sub_testcase_list: