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/installer_params.yaml16
-rwxr-xr-xfunctest/ci/prepare_env.py31
-rwxr-xr-xfunctest/ci/testcases.yaml8
4 files changed, 96 insertions, 22 deletions
diff --git a/functest/ci/check_os.sh b/functest/ci/check_os.sh
index b875a173e..2c5c021c7 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/installer_params.yaml b/functest/ci/installer_params.yaml
new file mode 100644
index 000000000..bffa894e7
--- /dev/null
+++ b/functest/ci/installer_params.yaml
@@ -0,0 +1,16 @@
+apex:
+ ip: ''
+ user: 'stack'
+ pkey: '/root/.ssh/id_rsa'
+#compass:
+# ip: ''
+# 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 6b24fe086..80bcfc7db 100755
--- a/functest/ci/prepare_env.py
+++ b/functest/ci/prepare_env.py
@@ -21,13 +21,15 @@ import subprocess
import sys
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 """
@@ -278,6 +280,32 @@ def check_environment():
logger.info("Functest environment is installed.")
+def print_deployment_info():
+ 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):
+ installer_params = ft_utils.get_parameter_from_yaml(
+ CONST.INSTALLER_TYPE, installer_params_yaml)
+
+ 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:
+ logger.info('\n\nDeployment information:\n%s' %
+ handler.get_deployment_info())
+ except Exception as e:
+ logger.debug("Cannot get deployment information. %s" % e)
+
+
def main(**kwargs):
try:
if not (kwargs['action'] in actions):
@@ -296,6 +324,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/testcases.yaml b/functest/ci/testcases.yaml
index b93b01ee9..a2633fcfc 100755
--- a/functest/ci/testcases.yaml
+++ b/functest/ci/testcases.yaml
@@ -402,7 +402,7 @@ tiers:
-
name: vnf
order: 4
- ci_loop: '(daily)|(weekly)'
+ ci_loop: 'weekly'
description : >-
Collection of VNF test cases.
testcases:
@@ -415,7 +415,7 @@ tiers:
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'
@@ -426,8 +426,8 @@ tiers:
description: >-
Test suite from Parser project.
dependencies:
- installer: 'unknown'
- scenario: 'unknown'
+ installer: ''
+ scenario: ''
run:
module: 'functest.opnfv_tests.vnf.aaa.aaa'
class: 'AaaVnf'