aboutsummaryrefslogtreecommitdiffstats
path: root/functest/ci
diff options
context:
space:
mode:
Diffstat (limited to 'functest/ci')
-rwxr-xr-xfunctest/ci/check_os.sh63
-rw-r--r--functest/ci/config_aarch64_patch.yaml20
-rwxr-xr-xfunctest/ci/config_functest.yaml18
-rwxr-xr-xfunctest/ci/config_patch.yaml6
-rwxr-xr-xfunctest/ci/exec_test.sh154
-rw-r--r--functest/ci/installer_params.yaml16
-rwxr-xr-xfunctest/ci/prepare_env.py140
-rw-r--r--functest/ci/rally_aarch64_patch.conf5
-rwxr-xr-xfunctest/ci/run_tests.py25
-rwxr-xr-xfunctest/ci/testcases.yaml187
-rwxr-xr-xfunctest/ci/tier_builder.py3
-rwxr-xr-xfunctest/ci/tier_handler.py19
12 files changed, 379 insertions, 277 deletions
diff --git a/functest/ci/check_os.sh b/functest/ci/check_os.sh
index b875a173..2c5c021c 100755
--- a/functest/ci/check_os.sh
+++ b/functest/ci/check_os.sh
@@ -6,6 +6,16 @@
# jose.lausuch@ericsson.com
#
+declare -A service_cmd_array
+service_cmd_array['nova']='openstack server list'
+service_cmd_array['neutron']='openstack network list'
+service_cmd_array['keystone']='openstack endpoint list'
+service_cmd_array['cinder']='openstack volume list'
+service_cmd_array['glance']='openstack image list'
+
+MANDATORY_SERVICES='nova neutron keystone glance'
+OPTIONAL_SERVICES='cinder'
+
verify_connectivity() {
for i in $(seq 0 9); do
if echo "test" | nc -v -w 10 $1 $2 &>/dev/null; then
@@ -16,6 +26,34 @@ verify_connectivity() {
return 1
}
+check_service() {
+ local service cmd
+ service=$1
+ cmd=${service_cmd_array[$service]}
+ if [ -z "$2" ]; then
+ required='false'
+ else
+ required=$2
+ fi
+ echo ">>Checking ${service} service..."
+ if ! openstack service list | grep -i ${service} > /dev/null; then
+ if [ "$required" == 'false' ]; then
+ echo "WARN: Optional Service ${service} is not enabled!"
+ return
+ else
+ echo "ERROR: Required Service ${service} is not enabled!"
+ exit 1
+ fi
+ fi
+ $cmd &>/dev/null
+ result=$?
+ if [ $result -ne 0 ]; then
+ echo "ERROR: Failed execution $cmd. The $service does not seem to be working."
+ exit 1
+ else
+ echo " ...OK"
+ fi
+}
if [ -z $OS_AUTH_URL ];then
echo "ERROR: OS_AUTH_URL environment variable missing... Have you sourced the OpenStack credentials?"
@@ -56,25 +94,16 @@ fi
echo " ...OK"
-echo "Checking OpenStack basic services:"
-commands=('openstack endpoint list' 'openstack server list' 'openstack network list' \
- 'openstack image list' 'openstack volume list')
-for cmd in "${commands[@]}"
-do
- service=$(echo $cmd | awk '{print $1, $2}')
- echo ">>Checking $service service..."
- $cmd &>/dev/null
- result=$?
- if [ $result -ne 0 ];
- then
- echo "ERROR: Failed execution $cmd. The $service does not seem to be working."
- exit 1
- else
- echo " ...OK"
- fi
+echo "Checking Required OpenStack services:"
+for service in $MANDATORY_SERVICES; do
+ check_service $service "true"
done
+echo "Required OpenStack services are OK."
-echo "OpenStack services are OK."
+echo "Checking Optional OpenStack services:"
+for service in $OPTIONAL_SERVICES; do
+ check_service $service
+done
echo "Checking External network..."
networks=($(neutron net-list -F id | tail -n +4 | head -n -1 | awk '{print $2}'))
diff --git a/functest/ci/config_aarch64_patch.yaml b/functest/ci/config_aarch64_patch.yaml
new file mode 100644
index 00000000..9a345e3f
--- /dev/null
+++ b/functest/ci/config_aarch64_patch.yaml
@@ -0,0 +1,20 @@
+os:
+ general:
+ openstack:
+ image_name: TestVM
+ image_file_name: cirros-d161201-aarch64-disk.img
+ image_password: gocubsgo
+
+ snaps_simple_healthcheck:
+ disk_image: /home/opnfv/functest/data/cirros-d161201-aarch64-disk.img
+ kernel_image: /home/opnfv/functest/data/cirros-d161201-aarch64-kernel
+ ramdisk_image: /home/opnfv/functest/data/cirros-d161201-aarch64-initramfs
+ extra_properties:
+ os_command_line: root=/dev/vdb1 rw rootwait console=tty0 console=ttyS0 console=ttyAMA0
+ hw_video_model: vga
+
+ vping:
+ image_name: TestVM
+
+ doctor:
+ image_name: TestVM
diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml
index d0442cf9..402e2999 100755
--- a/functest/ci/config_functest.yaml
+++ b/functest/ci/config_functest.yaml
@@ -5,8 +5,8 @@ general:
dir_odl: functest/opnfv_tests/sdn/odl
rally: functest/opnfv_tests/openstack/rally
tempest_cases: functest/opnfv_tests/openstack/tempest/custom_tests
- dir_onos: functest/opnfv_tests/sdn/onos/teston
- dir_onos_sfc: functest/opnfv_tests/sdn/onos/sfc
+ onos: functest/opnfv_tests/sdn/onos/teston
+ onos_sfc: functest/opnfv_tests/sdn/onos/sfc
# Absolute path
home: /home/opnfv
@@ -18,8 +18,10 @@ general:
repo_vims_test: /home/opnfv/repos/vnfs/vims-test
repo_sdnvpn: /home/opnfv/repos/sdnvpn
repo_sfc: /home/opnfv/repos/sfc
- dir_repo_onos: /home/opnfv/repos/onos
+ repo_onos: /home/opnfv/repos/onos
repo_promise: /home/opnfv/repos/promise
+ repo_netready: /home/opnfv/repos/netready
+ repo_barometer: /home/opnfv/repos/barometer
repo_doctor: /home/opnfv/repos/doctor
repo_copper: /home/opnfv/repos/copper
dir_repo_ovno: /home/opnfv/repos/ovno
@@ -27,6 +29,7 @@ general:
repo_domino: /home/opnfv/repos/domino
repo_snaps: /home/opnfv/repos/snaps
repo_securityscan: /home/opnfv/repos/securityscanning
+ repo_vrouter: /home/opnfv/repos/vrouter
functest: /home/opnfv/functest
functest_test: /home/opnfv/repos/functest/functest/opnfv_tests
results: /home/opnfv/functest/results
@@ -40,9 +43,11 @@ general:
creds: /home/opnfv/functest/conf/openstack.creds
snapshot_file: /home/opnfv/functest/conf/openstack_snapshot.yaml
- image_name: Cirros-0.3.4
- image_file_name: cirros-0.3.4-x86_64-disk.img
+ image_name: Cirros-0.3.5
+ image_file_name: cirros-0.3.5-x86_64-disk.img
image_disk_format: qcow2
+ image_username: cirros
+ image_password: cubswin:)
flavor_name: opnfv_flavor
flavor_ram: 512
@@ -62,7 +67,7 @@ general:
testcases_yaml: /home/opnfv/repos/functest/functest/ci/testcases.yaml
healthcheck:
- disk_image: /home/opnfv/functest/data/cirros-0.3.4-x86_64-disk.img
+ disk_image: /home/opnfv/functest/data/cirros-0.3.5-x86_64-disk.img
disk_format: qcow2
wait_time: 60
@@ -129,6 +134,7 @@ vnf:
orchestra_ims:
tenant_name: orchestra_ims
tenant_description: ims deployed with openbaton
+ config: orchestra_ims.yaml
opera_ims:
tenant_name: opera_ims
tenant_description: ims deployed with open-o
diff --git a/functest/ci/config_patch.yaml b/functest/ci/config_patch.yaml
index 46064a07..d984a3f4 100755
--- a/functest/ci/config_patch.yaml
+++ b/functest/ci/config_patch.yaml
@@ -1,12 +1,12 @@
lxd:
general:
openstack:
- image_name: Cirros-0.3.4
- image_file_name: cirros-0.3.4-x86_64-lxc.tar.gz
+ image_name: Cirros-0.3.5
+ image_file_name: cirros-0.3.5-x86_64-lxc.tar.gz
image_disk_format: raw
healthcheck:
- disk_image: /home/opnfv/functest/data/cirros-0.3.4-x86_64-lxc.tar.gz
+ disk_image: /home/opnfv/functest/data/cirros-0.3.5-x86_64-lxc.tar.gz
disk_format: raw
fdio:
general:
diff --git a/functest/ci/exec_test.sh b/functest/ci/exec_test.sh
deleted file mode 100755
index aa0cfaf7..00000000
--- a/functest/ci/exec_test.sh
+++ /dev/null
@@ -1,154 +0,0 @@
-#!/bin/bash
-
-#
-# Author: Jose Lausuch (jose.lausuch@ericsson.com)
-# Morgan Richomme (morgan.richomme@orange.com)
-# Installs the Functest framework within the Docker container
-# and run the tests automatically
-#
-#
-# 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
-#
-
-usage="Script to trigger the tests automatically.
-
-usage:
- bash $(basename "$0") [-h|--help] [-t <test_name>]
-
-where:
- -h|--help show this help text
- -r|--report push results to database (false by default)
- -s|--serial run Tempest tests in one thread
- -t|--test run specific test case
- <test_name>"
-
-
-report=""
-serial=false
-
-# Get the list of runnable tests
-# Check if we are in CI mode
-debug=""
-if [[ "${CI_DEBUG,,}" == "true" ]];then
- debug="--debug"
-fi
-
-FUNCTEST_REPO_DIR=${REPOS_DIR}/functest
-FUNCTEST_TEST_DIR=${REPOS_DIR}/functest/functest/opnfv_tests
-FUNCTEST_CONF_DIR=/home/opnfv/functest/conf
-
-export PYTHONUNBUFFERED=1
-
-function odl_tests(){
- keystone_ip=$(openstack catalog show identity |grep publicURL| cut -f3 -d"/" | cut -f1 -d":")
- neutron_ip=$(openstack catalog show network | grep publicURL | cut -f3 -d"/" | cut -f1 -d":")
- odl_ip=${neutron_ip}
- odl_port=8080
- odl_restport=8181
- if [ "$INSTALLER_TYPE" == "fuel" ]; then
- odl_port=8282
- elif [ "$INSTALLER_TYPE" == "apex" ]; then
- odl_ip=$SDN_CONTROLLER_IP
- odl_port=8081
- odl_restport=8081
- elif [ "$INSTALLER_TYPE" == "netvirt" ]; then
- odl_ip=$SDN_CONTROLLER_IP
- odl_port=8081
- odl_restport=8081
- elif [ "$INSTALLER_TYPE" == "joid" ]; then
- odl_ip=$SDN_CONTROLLER
- elif [ "$INSTALLER_TYPE" == "compass" ]; then
- odl_port=8181
- else
- odl_ip=$SDN_CONTROLLER_IP
- fi
-}
-
-
-
-function run_test(){
- test_name=$1
- serial_flag=""
- if [ $serial == "true" ]; then
- serial_flag="-s"
- fi
-
- case $test_name in
- "healthcheck")
- ${FUNCTEST_TEST_DIR}/openstack/healthcheck/healthcheck.sh
- ;;
- "odl")
- odl_tests
- [[ "$report" == "-r" ]] && args=-p
- ${FUNCTEST_TEST_DIR}/sdn/odl/odl.py \
- --keystoneip $keystone_ip \
- --neutronip $neutron_ip \
- --odlip $odl_ip \
- --odlrestconfport $odl_restport \
- --odlwebport $odl_port \
- --ospassword ${OS_PASSWORD} \
- --ostenantname ${OS_TENANT_NAME} \
- --osusername ${OS_USERNAME} \
- ${args}
- ;;
- "onos")
- python ${FUNCTEST_TEST_DIR}/sdn/onos/teston/onos.py
- ;;
- "onos_sfc")
- python ${FUNCTEST_TEST_DIR}/sdn/onos/teston/onos.py -t sfc
- ;;
- "ovno")
- # suite under rewritting for colorado
- # no need to run anything until refactoring done
- # ${REPOS_DIR}/ovno/Testcases/RunTests.sh
- ;;
- *)
- echo "The test case '${test_name}' does not exist."
- exit 1
- esac
-
- if [[ $? != 0 ]]; then exit 1
- else exit 0
- fi
-}
-
-
-# Parse parameters
-while [[ $# > 0 ]]
- do
- key="$1"
- case $key in
- -h|--help)
- echo "$usage"
- exit 0
- shift
- ;;
- -r|--report)
- report="-r"
- ;;
- -s|--serial)
- serial=true
- ;;
- -t|--test|--tests)
- TEST="$2"
- shift
- ;;
- *)
- echo "unknown option $1 $2"
- exit 1
- ;;
- esac
- shift # past argument or value
-done
-
-
-# Source credentials
-echo "Sourcing Credentials ${creds} to run the test.."
-source ${creds}
-
-
-# Run test
-run_test $TEST
diff --git a/functest/ci/installer_params.yaml b/functest/ci/installer_params.yaml
new file mode 100644
index 00000000..26aff9bb
--- /dev/null
+++ b/functest/ci/installer_params.yaml
@@ -0,0 +1,16 @@
+apex:
+ ip: ''
+ user: 'stack'
+ pkey: '/root/.ssh/id_rsa'
+# compass:
+# ip: '192.168.200.2'
+# user: 'root'
+# password: 'root'
+fuel:
+ ip: '10.20.0.2'
+ user: 'root'
+ password: 'r00tme'
+# joid:
+# ip: ''
+# user: ''
+# password: ''
diff --git a/functest/ci/prepare_env.py b/functest/ci/prepare_env.py
index 6b24fe08..724ea14d 100755
--- a/functest/ci/prepare_env.py
+++ b/functest/ci/prepare_env.py
@@ -1,48 +1,49 @@
#!/usr/bin/env python
#
-# Author: Jose Lausuch (jose.lausuch@ericsson.com)
-#
-# Installs the Functest framework within the Docker container
-# and run the tests automatically
-#
-#
# 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
#
-
import argparse
import json
import os
import re
import subprocess
import sys
+import fileinput
import yaml
-from opnfv.utils import constants as opnfv_constants
import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
from functest.utils.constants import CONST
+from opnfv.utils import constants as opnfv_constants
+from opnfv.deployment import factory
+
actions = ['start', 'check']
""" logging configuration """
logger = ft_logger.Logger("prepare_env").getLogger()
-
+handler = None
+# set the architecture to default
+pod_arch = None
+arch_filter = ['aarch64']
CONFIG_FUNCTEST_PATH = CONST.CONFIG_FUNCTEST_YAML
CONFIG_PATCH_PATH = os.path.join(os.path.dirname(
CONFIG_FUNCTEST_PATH), "config_patch.yaml")
-
-with open(CONFIG_PATCH_PATH) as f:
- functest_patch_yaml = yaml.safe_load(f)
+CONFIG_AARCH64_PATCH_PATH = os.path.join(os.path.dirname(
+ CONFIG_FUNCTEST_PATH), "config_aarch64_patch.yaml")
+RALLY_CONF_PATH = os.path.join("/etc/rally/rally.conf")
+RALLY_AARCH64_PATCH_PATH = os.path.join(os.path.dirname(
+ CONFIG_FUNCTEST_PATH), "rally_aarch64_patch.conf")
-class PrepareEnvParser():
+class PrepareEnvParser(object):
def __init__(self):
self.parser = argparse.ArgumentParser()
@@ -107,6 +108,38 @@ def check_env_variables():
logger.info(" IS_CI_RUN=%s" % CONST.IS_CI_RUN)
+def get_deployment_handler():
+ global handler
+ global pod_arch
+
+ installer_params_yaml = os.path.join(CONST.dir_repo_functest,
+ 'functest/ci/installer_params.yaml')
+ if (CONST.INSTALLER_IP and CONST.INSTALLER_TYPE and
+ CONST.INSTALLER_TYPE in opnfv_constants.INSTALLERS):
+ try:
+ installer_params = ft_utils.get_parameter_from_yaml(
+ CONST.INSTALLER_TYPE, installer_params_yaml)
+ except ValueError as e:
+ logger.debug('Printing deployment info is not supported for %s' %
+ CONST.INSTALLER_TYPE)
+ logger.debug(e)
+ else:
+ user = installer_params.get('user', None)
+ password = installer_params.get('password', None)
+ pkey = installer_params.get('pkey', None)
+ try:
+ handler = factory.Factory.get_handler(
+ installer=CONST.INSTALLER_TYPE,
+ installer_ip=CONST.INSTALLER_IP,
+ installer_user=user,
+ installer_pwd=password,
+ pkey_file=pkey)
+ if handler:
+ pod_arch = handler.get_arch()
+ except Exception as e:
+ logger.debug("Cannot get deployment information. %s" % e)
+
+
def create_directories():
print_separator()
logger.info("Creating needed directories...")
@@ -168,8 +201,7 @@ def source_rc_file():
raise Exception("The file %s is empty." % CONST.openstack_creds)
logger.info("Sourcing the OpenStack RC file...")
- os_utils.source_credentials(
- CONST.openstack_creds)
+ os_utils.source_credentials(CONST.openstack_creds)
for key, value in os.environ.iteritems():
if re.search("OS_", key):
if key == 'OS_AUTH_URL':
@@ -183,11 +215,22 @@ def source_rc_file():
def patch_config_file():
+ patch_file(CONFIG_PATCH_PATH)
+
+ if pod_arch and pod_arch in arch_filter:
+ patch_file(CONFIG_AARCH64_PATCH_PATH)
+
+
+def patch_file(patch_file_path):
+ logger.debug('Updating file: %s', patch_file_path)
+ with open(patch_file_path) as f:
+ patch_file = yaml.safe_load(f)
+
updated = False
- for key in functest_patch_yaml:
+ for key in patch_file:
if key in CONST.DEPLOY_SCENARIO:
new_functest_yaml = dict(ft_utils.merge_dicts(
- ft_utils.get_functest_yaml(), functest_patch_yaml[key]))
+ ft_utils.get_functest_yaml(), patch_file[key]))
updated = True
if updated:
@@ -215,6 +258,17 @@ def verify_deployment():
def install_rally():
print_separator()
+
+ if pod_arch and pod_arch in arch_filter:
+ logger.info("Apply aarch64 specific to rally config...")
+ with open(RALLY_AARCH64_PATCH_PATH, "r") as f:
+ rally_patch_conf = f.read()
+
+ for line in fileinput.input(RALLY_CONF_PATH, inplace=1):
+ print line,
+ if "cirros|testvm" in line:
+ print rally_patch_conf
+
logger.info("Creating Rally environment...")
cmd = "rally deployment destroy opnfv-rally"
@@ -222,20 +276,19 @@ def install_rally():
"Deployment %s does not exist."
% CONST.rally_deployment_name),
verbose=False)
+
rally_conf = os_utils.get_credentials_for_rally()
with open('rally_conf.json', 'w') as fp:
json.dump(rally_conf, fp)
cmd = ("rally deployment create "
- "--file=rally_conf.json --name={}"
+ "--file=rally_conf.json --name={0}"
.format(CONST.rally_deployment_name))
- ft_utils.execute_command(cmd,
- error_msg=("Problem while creating "
- "Rally deployment"))
+ error_msg = "Problem while creating Rally deployment"
+ ft_utils.execute_command_raise(cmd, error_msg=error_msg)
cmd = "rally deployment check"
- ft_utils.execute_command(cmd,
- error_msg=("OpenStack not responding or "
- "faulty Rally deployment."))
+ error_msg = "OpenStack not responding or faulty Rally deployment."
+ ft_utils.execute_command_raise(cmd, error_msg=error_msg)
cmd = "rally deployment list"
ft_utils.execute_command(cmd,
@@ -250,19 +303,30 @@ def install_rally():
def install_tempest():
logger.info("Installing tempest from existing repo...")
- cmd = ("rally verify create-verifier --source {0} "
- "--name {1} --type tempest"
- .format(CONST.dir_repo_tempest, CONST.tempest_deployment_name))
- ft_utils.execute_command(cmd,
- error_msg="Problem while installing Tempest.")
+ cmd = ("rally verify list-verifiers | "
+ "grep '{0}' | wc -l".format(CONST.tempest_deployment_name))
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
+ while p.poll() is None:
+ line = p.stdout.readline().rstrip()
+ if str(line) == '0':
+ logger.debug("Tempest %s does not exist" %
+ CONST.tempest_deployment_name)
+ cmd = ("rally verify create-verifier --source {0} "
+ "--name {1} --type tempest"
+ .format(CONST.dir_repo_tempest,
+ CONST.tempest_deployment_name))
+ error_msg = "Problem while installing Tempest."
+ ft_utils.execute_command_raise(cmd, error_msg=error_msg)
def create_flavor():
- os_utils.get_or_create_flavor('m1.tiny',
- '512',
- '1',
- '1',
- public=True)
+ _, flavor_id = os_utils.get_or_create_flavor('m1.tiny',
+ '512',
+ '1',
+ '1',
+ public=True)
+ if flavor_id is None:
+ raise Exception('Failed to create flavor')
def check_environment():
@@ -278,6 +342,12 @@ def check_environment():
logger.info("Functest environment is installed.")
+def print_deployment_info():
+ if handler:
+ logger.info('\n\nDeployment information:\n%s' %
+ handler.get_deployment_info())
+
+
def main(**kwargs):
try:
if not (kwargs['action'] in actions):
@@ -286,6 +356,7 @@ def main(**kwargs):
elif kwargs['action'] == "start":
logger.info("######### Preparing Functest environment #########\n")
check_env_variables()
+ get_deployment_handler()
create_directories()
source_rc_file()
patch_config_file()
@@ -296,6 +367,7 @@ def main(**kwargs):
with open(CONST.env_active, "w") as env_file:
env_file.write("1")
check_environment()
+ print_deployment_info()
elif kwargs['action'] == "check":
check_environment()
except Exception as e:
diff --git a/functest/ci/rally_aarch64_patch.conf b/functest/ci/rally_aarch64_patch.conf
new file mode 100644
index 00000000..a49588bf
--- /dev/null
+++ b/functest/ci/rally_aarch64_patch.conf
@@ -0,0 +1,5 @@
+img_name_regex = ^TestVM$
+img_url = http://download.cirros-cloud.net/daily/20161201/cirros-d161201-aarch64-disk.img
+flavor_ref_ram = 128
+flavor_ref_alt_ram = 256
+heat_instance_type_ram = 128
diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py
index 93518de0..0e951eff 100755
--- a/functest/ci/run_tests.py
+++ b/functest/ci/run_tests.py
@@ -32,13 +32,6 @@ from functest.utils.constants import CONST
logger = ft_logger.Logger("run_tests").getLogger()
-""" global variables """
-EXEC_SCRIPT = ("%s/functest/ci/exec_test.sh" % CONST.dir_repo_functest)
-
-# This will be the return code of this script. If any of the tests fails,
-# this variable will change to Result.EX_ERROR
-
-
class Result(enum.Enum):
EX_OK = os.EX_OK
EX_ERROR = -1
@@ -48,7 +41,7 @@ class BlockingTestFailed(Exception):
pass
-class RunTestsParser():
+class RunTestsParser(object):
def __init__(self):
self.parser = argparse.ArgumentParser()
@@ -119,7 +112,7 @@ def update_test_info(test_name, result, duration):
"duration": duration})
-def get_run_dict_if_defined(testname):
+def get_run_dict(testname):
try:
dict = ft_utils.get_dict_by_test(testname)
if not dict:
@@ -143,7 +136,7 @@ def run_test(test, tier_name, testcases=None):
logger.debug("\n%s" % test)
source_rc_file()
- if GlobalVariables.CLEAN_FLAG:
+ if test.needs_clean() and GlobalVariables.CLEAN_FLAG:
generate_os_snapshot()
flags = (" -t %s" % (test_name))
@@ -151,12 +144,13 @@ def run_test(test, tier_name, testcases=None):
flags += " -r"
result = testcase_base.TestcaseBase.EX_RUN_ERROR
- run_dict = get_run_dict_if_defined(test_name)
+ run_dict = get_run_dict(test_name)
if run_dict:
try:
module = importlib.import_module(run_dict['module'])
cls = getattr(module, run_dict['class'])
test_case = cls()
+
try:
kwargs = run_dict['args']
result = test_case.run(**kwargs)
@@ -173,14 +167,11 @@ def run_test(test, tier_name, testcases=None):
logger.exception("Cannot get class {}".format(
run_dict['class']))
else:
- cmd = ("%s%s" % (EXEC_SCRIPT, flags))
- logger.info("Executing command {} because {} "
- "doesn't implement the new framework".format(
- cmd, test_name))
- result = ft_utils.execute_command(cmd)
+ raise Exception("Cannot import the class for the test case.")
- if GlobalVariables.CLEAN_FLAG:
+ if test.needs_clean() and GlobalVariables.CLEAN_FLAG:
cleanup()
+
end = datetime.datetime.now()
duration = (end - start).seconds
duration_str = ("%02d:%02d" % divmod(duration, 60))
diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml
index 3ff503cb..1a1d0f4b 100755
--- a/functest/ci/testcases.yaml
+++ b/functest/ci/testcases.yaml
@@ -8,26 +8,15 @@ tiers:
operations in the VIM.
testcases:
-
- name: healthcheck
- criteria: 'status == "PASS"'
- blocking: true
- description: >-
- This test case verifies the basic OpenStack services like
- Keystone, Glance, Cinder, Neutron and Nova.
-
- dependencies:
- installer: ''
- scenario: '^((?!lxd).)*$'
- -
name: snaps_health_check
criteria: 'status == "PASS"'
- blocking: false
+ blocking: true
+ clean_flag: false
description: >-
This test case creates executes the SimpleHealthCheck
Python test class which creates an, image, flavor, network,
and Cirros VM instance and observes the console output to
validate the single port obtains the correct IP address.
-
dependencies:
installer: ''
scenario: '^((?!lxd).)*$'
@@ -38,6 +27,7 @@ tiers:
name: connection_check
criteria: 'status == "PASS"'
blocking: true
+ clean_flag: false
description: >-
This test case verifies the retrieval of OpenStack clients:
Keystone, Glance, Neutron and Nova and may perform some
@@ -56,6 +46,7 @@ tiers:
name: api_check
criteria: 'status == "PASS"'
blocking: true
+ clean_flag: false
description: >-
This test case verifies the retrieval of OpenStack clients:
Keystone, Glance, Neutron and Nova and may perform some
@@ -80,13 +71,14 @@ tiers:
name: vping_ssh
criteria: 'status == "PASS"'
blocking: true
+ clean_flag: true
description: >-
This test case verifies: 1) SSH to an instance using floating
IPs over the public network. 2) Connectivity between 2 instances
over a private network.
dependencies:
installer: ''
- scenario: '^((?!bgpvpn|odl_l3).)*$'
+ scenario: '^((?!odl_l3).)*$'
run:
module: 'functest.opnfv_tests.openstack.vping.vping_ssh'
class: 'VPingSSH'
@@ -95,6 +87,7 @@ tiers:
name: vping_userdata
criteria: 'status == "PASS"'
blocking: true
+ clean_flag: true
description: >-
This test case verifies: 1) Boot a VM with given userdata.
2) Connectivity between 2 instances over a private network.
@@ -109,6 +102,7 @@ tiers:
name: tempest_smoke_serial
criteria: 'success_rate == 100%'
blocking: false
+ clean_flag: false
description: >-
This test case runs the smoke subset of the OpenStack
Tempest suite. The list of test cases is generated by
@@ -125,12 +119,13 @@ tiers:
name: rally_sanity
criteria: 'success_rate == 100%'
blocking: false
+ clean_flag: false
description: >-
This test case runs a sub group of tests of the OpenStack
Rally suite in smoke mode.
dependencies:
installer: ''
- scenario: '^((?!bgpvpn).)*$'
+ scenario: ''
run:
module: 'functest.opnfv_tests.openstack.rally.rally'
class: 'RallySanity'
@@ -139,6 +134,7 @@ tiers:
name: odl
criteria: 'success_rate == 100%'
blocking: true
+ clean_flag: false
description: >-
Test Suite for the OpenDaylight SDN Controller. It
integrates some test suites from upstream using
@@ -158,6 +154,7 @@ tiers:
name: odl_netvirt
criteria: 'success_rate == 100%'
blocking: true
+ clean_flag: false
description: >-
Test Suite for the OpenDaylight SDN Controller when
the NetVirt features are installed. It integrates
@@ -179,6 +176,7 @@ tiers:
name: onos
criteria: 'status == "PASS"'
blocking: true
+ clean_flag: true
description: >-
Test Suite for the ONOS SDN Controller. It integrates
some test suites from upstream using TestON as the test
@@ -186,12 +184,15 @@ tiers:
dependencies:
installer: ''
scenario: 'onos'
-
+ run:
+ module: 'functest.opnfv_tests.sdn.onos.onos'
+ class: 'Onos'
-
name: snaps_smoke
criteria: 'status == "PASS"'
blocking: false
+ clean_flag: false
description: >-
This test case contains tests that setup and destroy
environments with VMs with and without Floating IPs
@@ -220,6 +221,7 @@ tiers:
name: promise
criteria: 'success_rate == 100%'
blocking: false
+ clean_flag: true
description: >-
Test suite from Promise project.
dependencies:
@@ -233,6 +235,7 @@ tiers:
name: doctor
criteria: 'status == "PASS"'
blocking: false
+ clean_flag: true
description: >-
Test suite from Doctor project.
dependencies:
@@ -246,6 +249,7 @@ tiers:
name: bgpvpn
criteria: 'status == "PASS"'
blocking: false
+ clean_flag: true
description: >-
Test suite from SDNVPN project.
dependencies:
@@ -259,6 +263,7 @@ tiers:
name: security_scan
criteria: 'status == "PASS"'
blocking: false
+ clean_flag: true
description: >-
Simple Security Scan
dependencies:
@@ -271,6 +276,7 @@ tiers:
# name: copper
# criteria: 'status == "PASS"'
# blocking: false
+# clean_flag: true
# description: >-
# Test suite for policy management based on OpenStack Congress
# dependencies:
@@ -283,6 +289,7 @@ tiers:
name: multisite
criteria: 'success_rate == 100%'
blocking: false
+ clean_flag: false
description: >-
Test suite from kingbird
dependencies:
@@ -295,6 +302,7 @@ tiers:
name: odl-sfc
criteria: 'status == "PASS"'
blocking: false
+ clean_flag: true
description: >-
Test suite for odl-sfc to test two chains and two SFs
dependencies:
@@ -307,15 +315,20 @@ tiers:
name: onos_sfc
criteria: 'status == "PASS"'
blocking: true
+ clean_flag: true
description: >-
Test Suite for onos-sfc to test sfc function.
dependencies:
installer: ''
scenario: 'onos-sfc'
+ run:
+ module: 'functest.opnfv_tests.sdn.onos.onos'
+ class: 'OnosSfc'
-
name: parser
criteria: 'ret == 0'
blocking: false
+ clean_flag: true
description: >-
Test suite from Parser project.
dependencies:
@@ -325,9 +338,23 @@ tiers:
module: 'functest.opnfv_tests.vnf.rnc.parser'
class: 'Parser'
-
+ name: domino
+ criteria: 'status == "PASS"'
+ blocking: false
+ clean_flag: true
+ description: >-
+ Test suite from Domino project.
+ dependencies:
+ installer: ''
+ scenario: ''
+ run:
+ module: 'functest.opnfv_tests.features.domino'
+ class: 'Domino'
+ -
name: orchestra
criteria: 'ret == 0'
blocking: false
+ clean_flag: true
description: >-
Test OpenBaton (Orchestra) stack
dependencies:
@@ -336,46 +363,107 @@ tiers:
run:
module: 'functest.opnfv_tests.features.orchestrator.orchestra'
class: 'OpenbatonOrchestrator'
+ -
+ name: netready
+ criteria: 'status == "PASS"'
+ blocking: false
+ clean_flag: true
+ description: >-
+ Test suite from Netready project.
+ dependencies:
+ installer: 'apex'
+ scenario: 'gluon'
+ run:
+ module: 'functest.opnfv_tests.features.netready'
+ class: 'GluonVping'
+ -
+ name: barometer
+ criteria: 'status == "PASS"'
+ blocking: false
+ clean_flag: true
+ description: >-
+ Test suite for the Barometer project. Separate tests verify the
+ proper configuration and functionality of the following
+ collectd plugins Ceilometer, Hugepages, Memory RAS (mcelog),
+ and OVS Events
+ dependencies:
+ installer: 'fuel'
+ scenario: 'kvm_ovs_dpdk_bar'
+ run:
+ module: 'functest.opnfv_tests.features.barometer'
+ class: 'BarometerCollectd'
-
name: components
order: 3
- ci_loop: 'weekly'
+ ci_loop: 'daily'
description : >-
Extensive testing of OpenStack API.
testcases:
+# -
+# name: tempest_full_parallel
+# criteria: 'success_rate >= 80%'
+# blocking: false
+# clean_flag: false
+# description: >-
+# The list of test cases is generated by
+# Tempest automatically and depends on the parameters of
+# the OpenStack deplopyment.
+# dependencies:
+# installer: '^((?!netvirt).)*$'
+# scenario: ''
+# run:
+# module: 'functest.opnfv_tests.openstack.tempest.tempest'
+# class: 'TempestFullParallel'
-
- name: tempest_full_parallel
- criteria: 'success_rate >= 80%'
+ name: tempest_defcore
+ criteria: 'success_rate == 100%'
blocking: false
+ clean_flag: false
description: >-
- The list of test cases is generated by
- Tempest automatically and depends on the parameters of
- the OpenStack deplopyment.
+ This is the set of Tempest test cases created by OpenStack
+ Interop Working Group for certification purposes.
dependencies:
- installer: '^((?!netvirt).)*$'
- scenario: ''
+ installer: ''
+ scenario: 'nosdn-nofeature-ha'
run:
module: 'functest.opnfv_tests.openstack.tempest.tempest'
- class: 'TempestFullParallel'
-
+ class: 'TempestDefcore'
-
- name: rally_full
- criteria: 'success_rate >= 90%'
+ name: tempest_custom
+ criteria: 'success_rate == 100%'
blocking: false
+ clean_flag: false
description: >-
- This test case runs the full suite of scenarios of the OpenStack
- Rally suite using several threads and iterations.
+ The test case allows running a customized list of tempest
+ test cases defined in a file under
+ <dir_functest_repo>/functest/opnfv_tests/openstack/
+ /tempest/custom_tests/test_list.txt
+ The file is empty and can be customized with the desired tests.
dependencies:
- installer: '^((?!netvirt).)*$'
- scenario: ''
+ installer: 'unknown'
+ scenario: 'unknown'
run:
- module: 'functest.opnfv_tests.openstack.rally.rally'
- class: 'RallyFull'
+ module: 'functest.opnfv_tests.openstack.tempest.tempest'
+ class: 'TempestCustom'
+# -
+# name: rally_full
+# criteria: 'success_rate >= 90%'
+# blocking: false
+# clean_flag: false
+# description: >-
+# This test case runs the full suite of scenarios of the OpenStack
+# Rally suite using several threads and iterations.
+# dependencies:
+# installer: '^((?!netvirt).)*$'
+# scenario: ''
+# run:
+# module: 'functest.opnfv_tests.openstack.rally.rally'
+# class: 'RallyFull'
-
name: vnf
order: 4
- ci_loop: '(daily)|(weekly)'
+ ci_loop: 'weekly'
description : >-
Collection of VNF test cases.
testcases:
@@ -383,12 +471,13 @@ tiers:
name: cloudify_ims
criteria: 'status == "PASS"'
blocking: false
+ clean_flag: true
description: >-
This test case deploys an OpenSource vIMS solution from Clearwater
using the Cloudify orchestrator. It also runs some signaling traffic.
dependencies:
installer: ''
- scenario: 'nosdn-nofeature'
+ scenario: '(ocl)|(nosdn)|^(os-odl)((?!bgpvpn).)*$'
run:
module: 'functest.opnfv_tests.vnf.ims.cloudify_ims'
class: 'ImsVnf'
@@ -396,11 +485,12 @@ tiers:
name: aaa
criteria: 'ret == 0'
blocking: false
+ clean_flag: true
description: >-
Test suite from Parser project.
dependencies:
- installer: 'unknown'
- scenario: 'unknown'
+ installer: ''
+ scenario: ''
run:
module: 'functest.opnfv_tests.vnf.aaa.aaa'
class: 'AaaVnf'
@@ -409,6 +499,7 @@ tiers:
name: juju_epc
criteria: 'ret == 0'
blocking: false
+ clean_flag: true
description: >-
Test suite from OAI project, vEPC deployed with Juju.
dependencies:
@@ -422,11 +513,12 @@ tiers:
name: orchestra_ims
criteria: 'ret == 0'
blocking: false
+ clean_flag: true
description: >-
VNF deployment with OpenBaton (Orchestra)
dependencies:
- installer: 'unknown'
- scenario: 'unknown'
+ installer: ''
+ scenario: ''
run:
module: 'functest.opnfv_tests.vnf.ims.orchestra_ims'
class: 'ImsVnf'
@@ -435,6 +527,7 @@ tiers:
name: opera_ims
criteria: 'ret == 0'
blocking: false
+ clean_flag: true
description: >-
Evolution of vIMS
dependencies:
@@ -443,3 +536,17 @@ tiers:
run:
module: 'functest.opnfv_tests.vnf.ims.opera_ims'
class: 'ImsVnf'
+
+ -
+ name: vyos_vrouter
+ criteria: 'status == "PASS"'
+ blocking: false
+ clean_flag: true
+ description: >-
+ This test case is vRouter testing.
+ dependencies:
+ installer: 'fuel'
+ scenario: 'nosdn-nofeature'
+ run:
+ module: 'functest.opnfv_tests.vnf.router.vyos_vrouter'
+ class: 'VrouterVnf'
diff --git a/functest/ci/tier_builder.py b/functest/ci/tier_builder.py
index e1c3e49e..f4c6f70f 100755
--- a/functest/ci/tier_builder.py
+++ b/functest/ci/tier_builder.py
@@ -11,7 +11,7 @@ import tier_handler as th
import yaml
-class TierBuilder:
+class TierBuilder(object):
def __init__(self, ci_installer, ci_scenario, testcases_file):
self.ci_installer = ci_installer
@@ -50,6 +50,7 @@ class TierBuilder:
dependency=dep,
criteria=dic_testcase['criteria'],
blocking=dic_testcase['blocking'],
+ clean_flag=dic_testcase['clean_flag'],
description=dic_testcase['description'])
if testcase.is_compatible(self.ci_installer, self.ci_scenario):
tier.add_test(testcase)
diff --git a/functest/ci/tier_handler.py b/functest/ci/tier_handler.py
index 1eadfba5..6b4864b5 100755
--- a/functest/ci/tier_handler.py
+++ b/functest/ci/tier_handler.py
@@ -28,7 +28,7 @@ def split_text(text, max_len):
return lines
-class Tier:
+class Tier(object):
def __init__(self, name, order, ci_loop, description=""):
self.tests_array = []
@@ -102,14 +102,20 @@ class Tier:
return out
-class TestCase:
+class TestCase(object):
- def __init__(self, name, dependency, criteria, blocking, description=""):
+ def __init__(self, name,
+ dependency,
+ criteria,
+ blocking,
+ clean_flag,
+ description=""):
self.name = name
self.dependency = dependency
- self.description = description
self.criteria = criteria
self.blocking = blocking
+ self.clean_flag = clean_flag
+ self.description = description
@staticmethod
def is_none(item):
@@ -138,6 +144,9 @@ class TestCase:
def is_blocking(self):
return self.blocking
+ def needs_clean(self):
+ return self.clean_flag
+
def __str__(self):
lines = split_text(self.description, LINE_LENGTH - 6)
@@ -160,7 +169,7 @@ class TestCase:
return out
-class Dependency:
+class Dependency(object):
def __init__(self, installer, scenario):
self.installer = installer