diff options
Diffstat (limited to 'testcases')
-rw-r--r-- | testcases/OpenStack/rally/blacklist.txt | 6 | ||||
-rwxr-xr-x | testcases/OpenStack/rally/run_rally-cert.py | 1 | ||||
-rw-r--r-- | testcases/OpenStack/rally/scenario/opnfv-glance.yaml | 6 | ||||
-rwxr-xr-x | testcases/features/doctor.py | 11 | ||||
-rwxr-xr-x | testcases/features/promise.py | 4 | ||||
-rwxr-xr-x | testcases/features/sfc/prepare_odl_sfc.bash | 38 | ||||
-rwxr-xr-x | testcases/features/sfc/sfc.py | 13 |
7 files changed, 65 insertions, 14 deletions
diff --git a/testcases/OpenStack/rally/blacklist.txt b/testcases/OpenStack/rally/blacklist.txt index e1c83f5b3..8228ea200 100644 --- a/testcases/OpenStack/rally/blacklist.txt +++ b/testcases/OpenStack/rally/blacklist.txt @@ -1,7 +1,7 @@ - scenarios: - - + - os-nosdn-lxd-ha installers: - - + - joid tests: - - + - NovaServers.boot_server_from_volume_and_delete diff --git a/testcases/OpenStack/rally/run_rally-cert.py b/testcases/OpenStack/rally/run_rally-cert.py index ebea59e81..536b4a5c2 100755 --- a/testcases/OpenStack/rally/run_rally-cert.py +++ b/testcases/OpenStack/rally/run_rally-cert.py @@ -163,6 +163,7 @@ def build_task_args(test_file_name): task_args['image_name'] = GLANCE_IMAGE_NAME task_args['flavor_name'] = FLAVOR_NAME task_args['glance_image_location'] = GLANCE_IMAGE_PATH + task_args['glance_image_format'] = GLANCE_IMAGE_FORMAT task_args['tmpl_dir'] = TEMPLATE_DIR task_args['sup_dir'] = SUPPORT_DIR task_args['users_amount'] = USERS_AMOUNT diff --git a/testcases/OpenStack/rally/scenario/opnfv-glance.yaml b/testcases/OpenStack/rally/scenario/opnfv-glance.yaml index adbf8b79a..3a67e7457 100644 --- a/testcases/OpenStack/rally/scenario/opnfv-glance.yaml +++ b/testcases/OpenStack/rally/scenario/opnfv-glance.yaml @@ -1,7 +1,7 @@ GlanceImages.create_and_delete_image: - args: - {{ glance_args(location=glance_image_location) }} + {{ glance_args(location=glance_image_location, type=glance_image_format) }} context: {{ user_context(tenants_amount, users_amount, use_existing_users) }} runner: @@ -12,7 +12,7 @@ GlanceImages.create_and_list_image: - args: - {{ glance_args(location=glance_image_location) }} + {{ glance_args(location=glance_image_location, type=glance_image_format) }} context: {{ user_context(tenants_amount, users_amount, use_existing_users) }} runner: @@ -32,7 +32,7 @@ GlanceImages.create_image_and_boot_instances: - args: - {{ glance_args(location=glance_image_location) }} + {{ glance_args(location=glance_image_location, type=glance_image_format) }} flavor: name: {{ flavor_name }} number_instances: 2 diff --git a/testcases/features/doctor.py b/testcases/features/doctor.py index 95531596f..badcfe605 100755 --- a/testcases/features/doctor.py +++ b/testcases/features/doctor.py @@ -14,6 +14,7 @@ # # import argparse +import os import time import functest.utils.functest_logger as ft_logger @@ -28,8 +29,8 @@ args = parser.parse_args() functest_yaml = functest_utils.get_functest_yaml() -dirs = functest_yaml.get('general').get('directories') -DOCTOR_REPO = dirs.get('dir_repo_doctor') +DOCTOR_REPO = functest_utils.get_parameter_from_yaml( + 'general.directories.dir_repo_doctor') RESULTS_DIR = functest_utils.get_parameter_from_yaml( 'general.directories.dir_results') @@ -38,6 +39,12 @@ logger = ft_logger.Logger("doctor").getLogger() def main(): exit_code = -1 + + # if the image name is explicitly set for the doctor suite, set it as + # enviroment variable + if 'doctor' in functest_yaml and 'image_name' in functest_yaml['doctor']: + os.environ["IMAGE_NAME"] = functest_yaml['doctor']['image_name'] + cmd = 'cd %s/tests && ./run.sh' % DOCTOR_REPO log_file = RESULTS_DIR + "/doctor.log" diff --git a/testcases/features/promise.py b/testcases/features/promise.py index a7899fec5..5b23614d6 100755 --- a/testcases/features/promise.py +++ b/testcases/features/promise.py @@ -182,8 +182,8 @@ def main(): os.environ["OS_TEST_NETWORK"] = network_dic["net_id"] os.chdir(PROMISE_REPO) - results_file_name = 'promise-results.json' - results_file = open(RESULTS_DIR + '/' + results_file_name, 'w+') + results_file_name = RESULTS_DIR + '/' + 'promise-results.json' + results_file = open(results_file_name, 'w+') cmd = 'npm run -s test -- --reporter json' logger.info("Running command: %s" % cmd) diff --git a/testcases/features/sfc/prepare_odl_sfc.bash b/testcases/features/sfc/prepare_odl_sfc.bash new file mode 100755 index 000000000..80ed9bd92 --- /dev/null +++ b/testcases/features/sfc/prepare_odl_sfc.bash @@ -0,0 +1,38 @@ +#!/bin/bash + +# +# Author: George Paraskevopoulos (geopar@intracom-telecom.com) +# Manuel Buil (manuel.buil@ericsson.com) +# Prepares the controller and the compute nodes for the odl-sfc testcase +# +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# + +ODL_SFC_LOG=/home/opnfv/functest/results/odl-sfc.log +ODL_SFC_DIR=${FUNCTEST_REPO_DIR}/testcases/features/sfc + +# Split the output to the log file and redirect STDOUT and STDERR to /dev/null +bash ${ODL_SFC_DIR}/server_presetup_CI.bash |& \ + tee -a ${ODL_SFC_LOG} 1>/dev/null 2>&1 + +# Get return value from PIPESTATUS array (bash specific feature) +ret_val=${PIPESTATUS[0]} +if [ $ret_val != 0 ]; then + echo "The tacker server deployment failed" + exit $ret_val +fi +echo "The tacker server was deployed successfully" + +bash ${ODL_SFC_DIR}/compute_presetup_CI.bash |& \ + tee -a ${ODL_SFC_LOG} 1>/dev/null 2>&1 + +ret_val=${PIPESTATUS[0]} +if [ $ret_val != 0 ]; then + exit $ret_val +fi + +exit 0 diff --git a/testcases/features/sfc/sfc.py b/testcases/features/sfc/sfc.py index 4d0e1260a..c84810efa 100755 --- a/testcases/features/sfc/sfc.py +++ b/testcases/features/sfc/sfc.py @@ -64,7 +64,8 @@ def main(): logger.info("Executing script to get ip_server: '%s'" % contr_cmd) process = subprocess.Popen(contr_cmd, shell=True, - stdout=subprocess.PIPE) + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) ip_server = process.stdout.readline().rstrip() contr_cmd2 = ("sshpass -p r00tme ssh " + ssh_options + " root@10.20.0.2" @@ -72,7 +73,8 @@ def main(): logger.info("Executing script to get ip_compute: '%s'" % contr_cmd2) process = subprocess.Popen(contr_cmd2, shell=True, - stdout=subprocess.PIPE) + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) ip_compute = process.stdout.readline().rstrip() iptable_cmd1 = ("sshpass -p r00tme ssh " + ssh_options + " root@10.20.0.2" @@ -80,8 +82,11 @@ def main(): iptable_cmd2 = ("sshpass -p r00tme ssh " + ssh_options + " root@10.20.0.2" " ssh " + ip_server + " iptables -t nat -P INPUT ACCEPT ") - subprocess.call(iptable_cmd1, shell=True) - subprocess.call(iptable_cmd2, shell=True) + logger.info("Changing firewall policy in controller: '%s'" % iptable_cmd1) + subprocess.call(iptable_cmd1, shell=True, stderr=subprocess.PIPE) + + logger.info("Changing firewall policy in controller: '%s'" % iptable_cmd2) + subprocess.call(iptable_cmd2, shell=True, stderr=subprocess.PIPE) # Getting the different clients |