diff options
Diffstat (limited to 'testcases')
-rwxr-xr-x | testcases/features/copper.py | 16 | ||||
-rwxr-xr-x | testcases/security_scan/security_scan.py | 13 | ||||
-rw-r--r-- | testcases/vnf/vIMS/orchestrator.py | 2 | ||||
-rwxr-xr-x | testcases/vnf/vRNC/parser.py | 15 |
4 files changed, 27 insertions, 19 deletions
diff --git a/testcases/features/copper.py b/testcases/features/copper.py index b1df99a5..50319d96 100755 --- a/testcases/features/copper.py +++ b/testcases/features/copper.py @@ -14,23 +14,24 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import argparse import sys import time -import argparse import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as functest_utils + parser = argparse.ArgumentParser() parser.add_argument("-r", "--report", help="Create json result file", action="store_true") args = parser.parse_args() -functest_yaml = functest_utils.get_functest_yaml() - -dirs = functest_yaml.get('general').get('directories') -COPPER_REPO = dirs.get('dir_repo_copper') +COPPER_REPO = functest_utils.get_parameter_from_yaml( + 'general.directories.dir_repo_copper') +RESULTS_DIR = functest_utils.get_parameter_from_yaml( + 'general.directories.dir_results') logger = ft_logger.Logger("copper").getLogger() @@ -40,7 +41,10 @@ def main(): start_time = time.time() - ret_val = functest_utils.execute_command(cmd, exit_on_error=False) + log_file = RESULTS_DIR + "/copper.log" + ret_val = functest_utils.execute_command(cmd, + exit_on_error=False, + output_file=log_file) stop_time = time.time() duration = round(stop_time - start_time, 1) diff --git a/testcases/security_scan/security_scan.py b/testcases/security_scan/security_scan.py index 7b925021..ac7b78ed 100755 --- a/testcases/security_scan/security_scan.py +++ b/testcases/security_scan/security_scan.py @@ -12,18 +12,19 @@ # nominated node. Post scan a report is downloaded and if '--clean' is passed # all trace of the scan is removed from the remote system. + +import argparse +import connect import datetime import os import sys -from ConfigParser import SafeConfigParser -import argparse +from ConfigParser import SafeConfigParser from functest.utils.functest_utils import FUNCTEST_REPO as FUNCTEST_REPO from keystoneclient import session from keystoneclient.auth.identity import v2 from novaclient import client -import connect __version__ = 0.1 __author__ = 'Luke Hinds (lhinds@redhat.com)' @@ -80,16 +81,16 @@ def run_tests(host, nodetype): connect.logger.info("Internet Connection OK.") connect.logger.info("Creating temp file structure..") createfiles(host, port, user, localkey) - connect.logger.info("Installing OpenSCAP...") + connect.logger.debug("Installing OpenSCAP...") install_pkg(host, port, user, localkey) - connect.logger.info("Running scan...") + connect.logger.debug("Running scan...") run_scanner(host, port, user, localkey, nodetype) clean = cfgparse.get(nodetype, 'clean') connect.logger.info("Post installation tasks....") post_tasks(host, port, user, localkey, nodetype) if clean: connect.logger.info("Cleaning down environment....") - connect.logger.info("Removing OpenSCAP....") + connect.logger.debug("Removing OpenSCAP....") removepkg(host, port, user, localkey, nodetype) connect.logger.info("Deleting tmp file and reports (remote)...") cleandir(host, port, user, localkey, nodetype) diff --git a/testcases/vnf/vIMS/orchestrator.py b/testcases/vnf/vIMS/orchestrator.py index 3e5117ff..61157a4f 100644 --- a/testcases/vnf/vIMS/orchestrator.py +++ b/testcases/vnf/vIMS/orchestrator.py @@ -188,7 +188,7 @@ class orchestrator: except: self.logger.error("Clearwater undeployment failed") - def _download_blueprints(blueprint_url, branch, dest_path): + def _download_blueprints(self, blueprint_url, branch, dest_path): if os.path.exists(dest_path): shutil.rmtree(dest_path) try: diff --git a/testcases/vnf/vRNC/parser.py b/testcases/vnf/vRNC/parser.py index 37e84d87..5ff207c1 100755 --- a/testcases/vnf/vRNC/parser.py +++ b/testcases/vnf/vRNC/parser.py @@ -14,22 +14,23 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import argparse import time -import argparse import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as functest_utils + parser = argparse.ArgumentParser() parser.add_argument("-r", "--report", help="Create json result file", action="store_true") args = parser.parse_args() -functest_yaml = functest_utils.get_functest_yaml() - -dirs = functest_yaml.get('general').get('directories') -PARSER_REPO = dirs.get('dir_repo_parser') +PARSER_REPO = functest_utils.get_parameter_from_yaml( + 'general.directories.dir_repo_parser') +RESULTS_DIR = functest_utils.get_parameter_from_yaml( + 'general.directories.dir_results') logger = ft_logger.Logger("parser").getLogger() @@ -40,9 +41,11 @@ def main(): cmd = 'cd %s/tests && ./functest_run.sh' % PARSER_REPO start_time = time.time() + log_file = RESULTS_DIR + "/parser.log" ret = functest_utils.execute_command(cmd, info=True, - exit_on_error=False) + exit_on_error=False, + output_file=log_file) stop_time = time.time() status, details = functest_utils.check_test_result(project, |