aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docker/Dockerfile3
-rwxr-xr-xdocker/common.sh8
-rwxr-xr-xdocker/prepare_env.sh27
-rw-r--r--docker/requirements.pip5
-rwxr-xr-xdocker/run_tests.sh12
-rw-r--r--testcases/VIM/OpenStack/CI/libraries/clean_openstack.py44
-rw-r--r--testcases/config_functest.yaml45
-rw-r--r--testcases/functest_utils.py153
-rw-r--r--testcases/tests/TestFunctestUtils.py122
-rw-r--r--testcases/vIMS/CI/orchestrator.py6
-rw-r--r--testcases/vIMS/CI/vIMS.py1
11 files changed, 376 insertions, 50 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile
index decce6812..6ae06e235 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -59,10 +59,13 @@ RUN chmod 700 /root/.ssh
RUN git config --global http.sslVerify false
RUN git clone https://gerrit.opnfv.org/gerrit/functest ${repos_dir}/functest
RUN git clone https://gerrit.opnfv.org/gerrit/releng ${repos_dir}/releng
+RUN git clone https://gerrit.opnfv.org/gerrit/doctor ${repos_dir}/doctor
RUN git clone https://github.com/openstack/rally.git ${repos_dir}/rally
RUN git clone https://github.com/opendaylight/integration.git ${repos_dir}/odl_integration
RUN git clone -b stable https://github.com/boucherv-orange/clearwater-live-test ${repos_dir}/vims-test
RUN git clone https://github.com/openstack/networking-bgpvpn ${repos_dir}/bgpvpn
+RUN git clone https://gerrit.onosproject.org/OnosSystemTest ${repos_dir}/onos
+RUN git clone https://github.com/opnfv/promise ${repos_dir}/promise
RUN pip install -r ${repos_dir}/functest/docker/requirements.pip
RUN pip install -r ${repos_dir}/rally/requirements.txt
diff --git a/docker/common.sh b/docker/common.sh
index 82a4719a1..aabc32cbe 100755
--- a/docker/common.sh
+++ b/docker/common.sh
@@ -53,6 +53,10 @@ VIMS_BRANCH=$(cat $config_file | grep -w vims_test_branch | awk 'END {print $NF}
VIMS_COMMIT=$(cat $config_file | grep -w vims_test_commit | awk 'END {print $NF}')
BGPVPN_BRANCH=$(cat $config_file | grep -w bgpvpn_branch | awk 'END {print $NF}')
BGPVPN_COMMIT=$(cat $config_file | grep -w bgpvpn_commit | awk 'END {print $NF}')
+ONOS_BRANCH=$(cat $config_file | grep -w onos_branch | awk 'END {print $NF}')
+ONOS_COMMIT=$(cat $config_file | grep -w onos_commit | awk 'END {print $NF}')
+PROMISE_BRANCH=$(cat $config_file | grep -w promise_branch | awk 'END {print $NF}')
+PROMISE_COMMIT=$(cat $config_file | grep -w promise_commit | awk 'END {print $NF}')
echo "_____Parsed needed data from ${config_file}:"
@@ -76,6 +80,10 @@ echo "RALLY_BRANCH=${RALLY_BRANCH}"
echo "RALLY_COMMIT=${RALLY_COMMIT}"
echo "VIMS_BRANCH=${VIMS_BRANCH}"
echo "VIMS_COMMIT=${VIMS_COMMIT}"
+echo "ONOS_BRANCH=${ONOS_BRANCH}"
+echo "ONOS_COMMIT=${ONOS_COMMIT}"
+echo "PROMISE_BRANCH=${PROMISE_BRANCH}"
+echo "PROMISE_COMMIT=${PROMISE_COMMIT}"
echo "############################"
info () {
diff --git a/docker/prepare_env.sh b/docker/prepare_env.sh
index 983eefc08..321ae9fe3 100755
--- a/docker/prepare_env.sh
+++ b/docker/prepare_env.sh
@@ -142,6 +142,33 @@ if [ $offline == false ]; then
info "BGPVPN repo: given commit is ${BGPVPN_COMMIT}. Reseting..."
git reset --hard ${BGPVPN_COMMIT}
fi
+
+ info "Updating ONOS repository...."
+ cd ${ONOS_REPO_DIR}
+ if [ ${ONOS_BRANCH} != "master" ]; then
+ info "ONOS repo: checkout ${ONOS} branch..."
+ git checkout ${ONOS_BRANCH}
+ fi
+ info "ONOS repo: pulling to latest..."
+ git pull
+ if [ ${ONOS_COMMIT} != "latest" ]; then
+ info "ONOS repo: given commit is ${ONOS_COMMIT}. Reseting..."
+ git reset --hard ${ONOS_COMMIT}
+ fi
+
+ info "Updating PROMISE repository...."
+ cd ${PROMISE_REPO_DIR}
+ if [ ${PROMISE_BRANCH} != "master" ]; then
+ info "PROMISE repo: checkout ${PROMISE} branch..."
+ git checkout ${PROMISE_BRANCH}
+ fi
+ info "PROMISE repo: pulling to latest..."
+ git pull
+ if [ ${PROMISE_COMMIT} != "latest" ]; then
+ info "PROMISE repo: given commit is ${PROMISE_COMMIT}. Reseting..."
+ git reset --hard ${PROMISE_COMMIT}
+ fi
+
fi
# We do this regardless if its online or offline mode.
diff --git a/docker/requirements.pip b/docker/requirements.pip
index 03036a828..8644154cf 100644
--- a/docker/requirements.pip
+++ b/docker/requirements.pip
@@ -4,10 +4,13 @@ python-neutronclient==2.6.0
python-novaclient==2.28.1
python-glanceclient==1.1.0
python-cinderclient==1.4.0
+python-ceilometerclient==1.5.1
python-keystoneclient==1.6.0
virtualenv==1.11.4
pexpect==4.0
requests==2.8.0
robotframework==2.9.1
robotframework-requests==0.3.8
-robotframework-sshlibrary==2.1.1 \ No newline at end of file
+robotframework-sshlibrary==2.1.1
+configObj==5.0.6
+Flask==0.10.1
diff --git a/docker/run_tests.sh b/docker/run_tests.sh
index 28830e845..257fab1d9 100755
--- a/docker/run_tests.sh
+++ b/docker/run_tests.sh
@@ -17,7 +17,7 @@ where:
-h|--help show this help text
-r|--report push results to database (false by default)
-t|--test run specific set of tests
- <test_name> one or more of the following: vping,odl,rally,tempest,vims. Separated by comma.
+ <test_name> one or more of the following: vping,odl,rally,tempest,vims,onos, promise. Separated by comma.
examples:
@@ -111,7 +111,15 @@ function run_test(){
# cp ${BGPVPN_REPO_DIR}/networking_bgpvpn_tempest/<whatever you need> \
# ${tempest_dir}/tempest/api/bgpvpn/
# ${tempest_dir}/run_tempest.sh tempest.api.bgpvpn.<test_case_name>
- esac
+ ;;
+ "onos")
+ info "Running ONOS test case..."
+ python ${FUNCTEST_REPO_DIR}/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py
+ ;;
+ "promise")
+ info "Running PROMISE test case..."
+ # TODO
+ esac
}
diff --git a/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py b/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py
index 4f950b228..eab89d22d 100644
--- a/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py
+++ b/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py
@@ -134,8 +134,14 @@ def remove_volumes(cinder_client):
if functest_utils.delete_volume(cinder_client, volume_id):
logger.debug(" > Done!")
else:
- logger.info(" > ERROR: There has been a problem removing the "
- "volume %s..." % volume_id)
+ logger.debug("Trying forced removal...")
+ if functest_utils.delete_volume(cinder_client,
+ volume_id,
+ forced=True):
+ logger.debug(" > Done!")
+ else:
+ logger.info(" > ERROR: There has been a problem removing the "
+ "volume %s..." % volume_id)
def remove_floatingips(nova_client):
@@ -177,11 +183,13 @@ def remove_networks(neutron_client):
net_id = network['id']
net_name = network['name']
logger.debug(" '%s', ID=%s " %(net_name,net_id))
- if net_name not in default_networks:
- logger.debug(" > this is not a default network and will be deleted.")
- network_ids.append(net_id)
- else:
+ if net_name in default_networks:
logger.debug(" > this is a default network and will NOT be deleted.")
+ elif network['router:external'] == True:
+ logger.debug(" > this is an external network and will NOT be deleted.")
+ else:
+ logger.debug(" > this network will be deleted.")
+ network_ids.append(net_id)
#delete ports
ports = functest_utils.get_port_list(neutron_client)
@@ -225,6 +233,7 @@ def remove_ports(neutron_client, ports, network_ids):
else:
logger.info(" > ERROR: There has been a problem removing the "
"port %s ..." %port_id)
+ force_remove_port(neutron_client, port_id)
elif port['device_owner'] == 'network:router_interface':
logger.debug("Detaching port %s (subnet %s) from router %s ..."
@@ -236,16 +245,21 @@ def remove_ports(neutron_client, ports, network_ids):
else:
logger.info(" > ERROR: There has been a problem removing the "
"interface %s from router %s..." %(subnet_id,router_id))
+ force_remove_port(neutron_client, port_id)
else:
- logger.debug("Clearing device_owner for port %s ..." % port_id)
- functest_utils.update_neutron_port(neutron_client,
- port_id,
- device_owner='clear')
- logger.debug("Removing port %s ..." % port_id)
- if functest_utils.delete_neutron_port(neutron_client, port_id):
- logger.debug(" > Done!")
- else:
- logger.debug(" > Port %s could not be removed directly" % port_id)
+ force_remove_port(neutron_client, port_id)
+
+
+def force_remove_port(neutron_client, port_id):
+ logger.debug("Clearing device_owner for port %s ..." % port_id)
+ functest_utils.update_neutron_port(neutron_client,
+ port_id,
+ device_owner='clear')
+ logger.debug("Removing port %s ..." % port_id)
+ if functest_utils.delete_neutron_port(neutron_client, port_id):
+ logger.debug(" > Done!")
+ else:
+ logger.info(" > ERROR: Deleting port %s failed" % port_id)
def remove_routers(neutron_client, routers):
diff --git a/testcases/config_functest.yaml b/testcases/config_functest.yaml
index 1cc16e17b..bca4f9dcd 100644
--- a/testcases/config_functest.yaml
+++ b/testcases/config_functest.yaml
@@ -15,6 +15,8 @@ general:
dir_repo_releng: /home/opnfv/repos/releng
dir_repo_vims_test: /home/opnfv/repos/vims-test
dir_repo_bgpvpn: /home/opnfv/repos/bgpvpn
+ dir_repo_onos: /home/opnfv/repos/onos
+ dir_repo_promise: /home/opnfv/repos/promise
dir_functest: /home/opnfv/functest
dir_results: /home/opnfv/functest/results
dir_functest_conf: /home/opnfv/functest/conf
@@ -30,11 +32,15 @@ general:
releng_branch: master
releng_commit: latest
rally_branch: master
- rally_commit: 2c34d1896a7a9f2955a2a09531a9c3eb3f88517b
+ rally_commit: 57efc5327530a34d139b5a1fd1f480195de0aadb
vims_test_branch: stable
vims_test_commit: latest
bgpvpn_branch: master
bgpvpn_commit: latest
+ onos_branch: master
+ onos_commit: latest
+ promise_branch: master
+ promise_commit: latest
openstack:
image_name: functest-img
@@ -166,36 +172,47 @@ results:
# - installer (e.g. my test can be run only with installer Compass)
# possible values: apex, compass, fuel, joid
#
-# - controller (e.g. my test can be done only with controller OpenContrail)
-# possible values: none, odl, onos, opencontrail
+# - the controller (odl, onos, opencontrail)
#
-# - options (ovs, kvm, QEMU, proc) (my test is only possible with OVS 2.3.2)
-# possible values:
-# ovs: ovs2.4, ovsX
-# kvm:
-# qemu:
+# - the scenario (ovs, kvm, QEMU, proc) based on Fuel proposal
+# see https://git.opnfv.org/cgit/fuel/tree/deploy/scenario/scenario.yaml
+# e.g my test is only possible with OVS 2.3.2 on odl
+# not fully clear as the controller may be included with the scenario
+#
+# In a first step, our main need is to trigger ad hox controller suite
+# In second step we may focus with scenario parameter
+# but no so far
+# - either controller suite
+# or
+# - suites that should be runnable on any conf, any scenario
#
#######################################################################
test-dependencies:
- #congress:
- #doctor:
+ doctor:
functest:
+ vping:
+ vims:
+ tempest:
+ rally:
odl:
controller: 'odl'
onos:
controller: 'onos'
onos-ovsdb:
controller: 'onos'
- #promise:
+ promise:
ovno:
controller: 'opencontrail'
policy-test:
controller: 'odl'
sdnvpn:
- options: 'ovs2.4'
opnfv-yardstick-tc026-sdnvpn:
- controller: 'none'
+ controller: 'nosdn'
+ scenario: 'os_ovh_ha'
odl-vpn_service-tests:
controller: 'odl'
+ scenario: 'os_ovh_ha'
openstack-neutron-bgpvpn-api-extension-tests:
- controller: 'none'
+ controller: 'nosdn'
+ scenario: 'os_ovh_ha'
+
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py
index 0734ccbde..53f5706c9 100644
--- a/testcases/functest_utils.py
+++ b/testcases/functest_utils.py
@@ -25,7 +25,7 @@ def check_credentials():
"""
Check if the OpenStack credentials (openrc) are sourced
"""
- env_vars = ['OS_AUTH_URL','OS_USERNAME','OS_PASSWORD','OS_TENANT_NAME']
+ env_vars = ['OS_AUTH_URL', 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']
return all(map(lambda v: v in os.environ and os.environ[v], env_vars))
@@ -69,6 +69,7 @@ def get_instances(nova_client):
except:
return None
+
def get_instance_status(nova_client, instance):
try:
instance = nova_client.servers.get(instance.id)
@@ -76,6 +77,7 @@ def get_instance_status(nova_client, instance):
except:
return None
+
def get_instance_by_name(nova_client, instance_name):
try:
instance = nova_client.servers.find(name=instance_name)
@@ -84,7 +86,6 @@ def get_instance_by_name(nova_client, instance_name):
return None
-
def get_flavor_id(nova_client, flavor_name):
flavors = nova_client.flavors.list(detailed=True)
id = ''
@@ -121,6 +122,7 @@ def get_floating_ips(nova_client):
except:
return None
+
def delete_floating_ip(nova_client, floatingip_id):
try:
nova_client.floating_ips.delete(floatingip_id)
@@ -222,6 +224,7 @@ def remove_interface_router(neutron_client, router_id, subnet_id):
print "Error:", sys.exc_info()[0]
return False
+
def remove_gateway_router(neutron_client, router_id):
try:
neutron_client.remove_gateway_router(router_id)
@@ -301,6 +304,7 @@ def get_router_list(neutron_client):
else:
return router_list
+
def get_port_list(neutron_client):
port_list = neutron_client.list_ports()['ports']
if len(port_list) == 0:
@@ -309,7 +313,6 @@ def get_port_list(neutron_client):
return port_list
-
def get_external_net(neutron_client):
for network in neutron_client.list_networks()['networks']:
if network['router:external']:
@@ -331,30 +334,33 @@ def update_sg_quota(neutron_client, tenant_id, sg_quota, sg_rule_quota):
print "Error:", sys.exc_info()[0]
return False
-def update_cinder_quota(cinder_client, tenant_id, vols_quota, snapshots_quota,gigabytes_quota):
- quotas_values = {
- "volumes": vols_quota,
- "snapshots": snapshots_quota,
- "gigabytes": gigabytes_quota
- }
+
+def update_cinder_quota(cinder_client, tenant_id, vols_quota,
+ snapshots_quota, gigabytes_quota):
+ quotas_values = {"volumes": vols_quota,
+ "snapshots": snapshots_quota,
+ "gigabytes": gigabytes_quota}
try:
- quotas_default=cinder_client.quotas.update(tenant_id,**quotas_values)
+ quotas_default = cinder_client. quotas.update(tenant_id,
+ **quotas_values)
return True
except:
print "Error:", sys.exc_info()[0]
return False
+
def get_private_net(neutron_client):
# Checks if there is an existing shared private network
networks = neutron_client.list_networks()['networks']
if len(networks) == 0:
return None
for net in networks:
- if (net['router:external'] == False) and (net['shared'] == True):
+ if (net['router:external'] is False) and (net['shared'] is True):
return net
return None
+
# ################ GLANCE #################
def get_images(nova_client):
try:
@@ -390,6 +396,7 @@ def create_glance_image(glance_client, image_name, file_path, public=True):
print "Error:", sys.exc_info()[0]
return False
+
def delete_glance_image(nova_client, image_id):
try:
nova_client.images.delete(image_id)
@@ -398,6 +405,7 @@ def delete_glance_image(nova_client, image_id):
print "Error:", sys.exc_info()[0]
return False
+
# ################ CINDER #################
def get_volumes(cinder_client):
try:
@@ -406,14 +414,22 @@ def get_volumes(cinder_client):
except:
return None
-def delete_volume(cinder_client, volume_id):
+def delete_volume(cinder_client, volume_id, forced=False):
try:
- cinder_client.volumes.delete(volume_id)
+ if forced:
+ try:
+ cinder_client.volumes.detach(volume_id)
+ except:
+ print "Error:", sys.exc_info()[0]
+ cinder_client.volumes.force_delete(volume_id)
+ else:
+ cinder_client.volumes.delete(volume_id)
return True
except:
print "Error:", sys.exc_info()[0]
return False
+
# ################ CINDER #################
def get_security_groups(neutron_client):
try:
@@ -422,6 +438,7 @@ def get_security_groups(neutron_client):
except:
return None
+
def delete_security_group(neutron_client, secgroup_id):
try:
neutron_client.delete_security_group(secgroup_id)
@@ -449,6 +466,7 @@ def get_tenant_id(keystone_client, tenant_name):
break
return id
+
def get_users(keystone_client):
try:
users = keystone_client.users.list()
@@ -456,6 +474,7 @@ def get_users(keystone_client):
except:
return None
+
def get_role_id(keystone_client, role_name):
roles = keystone_client.roles.list()
id = ''
@@ -611,7 +630,8 @@ def get_pod_name(logger=None):
return "unknown-pod"
-def push_results_to_db(db_url, case_name, logger, pod_name, git_version, payload):
+def push_results_to_db(db_url, case_name, logger, pod_name,
+ git_version, payload):
url = db_url + "/results"
installer = get_installer_type(logger)
params = {"project_name": "functest", "case_name": case_name,
@@ -626,3 +646,108 @@ def push_results_to_db(db_url, case_name, logger, pod_name, git_version, payload
except:
print "Error:", sys.exc_info()[0]
return False
+
+
+def getTestEnv(test, functest_yaml):
+ # get the config of the testcase based on functest_config.yaml
+ # 2 options
+ # - test = test project e.g; ovno
+ # - test = testcase e.g. functest/odl
+ # look for the / to see if it is a test project or a testcase
+ try:
+ TEST_ENV = functest_yaml.get("test-dependencies")
+
+ if test.find("/") < 0:
+ config_test = TEST_ENV[test]
+ else:
+ test_split = test.split("/")
+ testproject = test_split[0]
+ testcase = test_split[1]
+ config_test = TEST_ENV[testproject][testcase]
+ except KeyError:
+ # if not defined in dependencies => no dependencies
+ config_test = ""
+ except:
+ print "Error getTestEnv:", sys.exc_info()[0]
+
+ return config_test
+
+
+def get_ci_envvars():
+ """
+ Get the CI env variables
+ """
+ ci_env_var = {
+ "installer": os.environ.get('INSTALLER_TYPE'),
+ "controller": os.environ.get('SDN_CONTROLLER'),
+ "options": os.environ.get("OPNFV_FEATURE")}
+ return ci_env_var
+
+
+def isTestRunnable(test, functest_yaml):
+ # check getTestEnv(test) and CI env var
+ # check installer, controller and options
+ # e.g. if test needs onos => do not run odl suite
+ try:
+ # By default we assume that all the tests are always runnable...
+ is_runnable = True
+ # Retrieve CI environment
+ ci_env = get_ci_envvars()
+
+ # Retrieve test environement from config file
+ test_env = getTestEnv(test, functest_yaml)
+
+ # if test_env not empty => dependencies to be checked
+ if test_env is not None and len(test_env) > 0:
+ # possible criteria = ["installer", "controller", "options"]
+ # consider test criteria from config file
+ # compare towards CI env through CI en variable
+ for criteria in test_env:
+ if test_env[criteria] != ci_env[criteria]:
+ # print "Test "+ test + " cannot be run on the environment"
+ is_runnable = False
+ except:
+ print "Error isTestRunnable:", sys.exc_info()[0]
+ return is_runnable
+
+
+def generateTestcaseList(functest_yaml):
+ try:
+ test_list = ""
+ # Retrieve CI environment
+ get_ci_envvars()
+
+ # get testcases
+ testcase_list = functest_yaml.get("test-dependencies")
+ projects = testcase_list.keys()
+ for project in projects:
+ testcases = testcase_list[project]
+ # 1 or 2 levels for testcases project[/case]
+ # if only project name without controller or scenario
+ # => shall be runnable on any controller/scenario
+ if testcases is None:
+ test_list += project + " "
+ else:
+ for testcase in testcases:
+ if testcase == "controller" or testcase == "scenario":
+ # project (1 level)
+ if isTestRunnable(project, functest_yaml):
+ test_list += project + " "
+ else:
+ # project/testcase (2 levels)
+ thetest = project + "/" + testcase
+ if isTestRunnable(thetest, functest_yaml):
+ test_list += testcase + " "
+
+ # create a file that could be consumed by run-test.sh
+ file = open("testcase-list.txt", 'w')
+ file.write(test_list)
+ file.close()
+
+ return test_list
+
+ # test for each testcase if it is runnable
+ # towards the declared configuration
+ # generate the test config file
+ except:
+ print "Error generateTestcaseList:", sys.exc_info()[0]
diff --git a/testcases/tests/TestFunctestUtils.py b/testcases/tests/TestFunctestUtils.py
new file mode 100644
index 000000000..337e4ee8a
--- /dev/null
+++ b/testcases/tests/TestFunctestUtils.py
@@ -0,0 +1,122 @@
+import unittest
+import os
+import sys
+import yaml
+
+sys.path.append("../")
+from functest_utils import getTestEnv, isTestRunnable, generateTestcaseList
+
+
+class TestFunctestUtils(unittest.TestCase):
+
+ def setUp(self):
+ os.environ["INSTALLER_TYPE"] = "fuel"
+ os.environ["SDN_CONTROLLER"] = "odl"
+ os.environ["OPNFV_FEATURE"] = "ovs2.4"
+
+ global functest_yaml
+
+ with open("../config_functest.yaml") as f:
+ functest_yaml = yaml.safe_load(f)
+ f.close()
+
+ def test_getTestEnv(self):
+
+ env_test = getTestEnv('ovno', functest_yaml)
+ self.assertEqual(env_test, {'controller': 'opencontrail'})
+
+ env_test = getTestEnv('doctor', functest_yaml)
+ self.assertEqual(env_test, None)
+
+ env_test = getTestEnv('promise', functest_yaml)
+ self.assertEqual(env_test, None)
+
+ env_test = getTestEnv('functest/tempest', functest_yaml)
+ self.assertEqual(env_test, None)
+
+ env_test = getTestEnv('functest/vims', functest_yaml)
+ self.assertEqual(env_test, None)
+
+ env_test = getTestEnv('functest/odl', functest_yaml)
+ self.assertEqual(env_test, {'controller': 'odl'})
+
+ env_test = getTestEnv('functest/onos', functest_yaml)
+ self.assertEqual(env_test, {'controller': 'onos'})
+
+ env_test = getTestEnv('functest/onos-ovsdb', functest_yaml)
+ self.assertEqual(env_test, {'controller': 'onos'})
+
+ env_test = getTestEnv('policy-test', functest_yaml)
+ self.assertEqual(env_test, {'controller': 'odl'})
+
+ env_test = getTestEnv('sdnvpn/odl-vpn_service-tests', functest_yaml)
+ self.assertEqual(env_test,
+ {'controller': 'odl', 'scenario': 'os_ovh_ha'})
+
+ env_test = getTestEnv('sdnvpn/opnfv-yardstick-tc026-sdnvpn',
+ functest_yaml)
+ self.assertEqual(env_test,
+ {'controller': 'nosdn', 'scenario': 'os_ovh_ha'})
+
+ env_test = getTestEnv('sdnvpn/openstack-neutron-bgpvpn-api-extension-tests',
+ functest_yaml)
+ self.assertEqual(env_test,
+ {'controller': 'nosdn', 'scenario': 'os_ovh_ha'})
+
+ env_test = getTestEnv('foo', functest_yaml)
+ self.assertEqual(env_test, '')
+
+ def test_isTestRunnable(self):
+
+ test = isTestRunnable('ovno', functest_yaml)
+ self.assertFalse(test)
+
+ test = isTestRunnable('doctor', functest_yaml)
+ self.assertTrue(test)
+
+ test = isTestRunnable('promise', functest_yaml)
+ self.assertTrue(test)
+
+ test = isTestRunnable('functest/onos', functest_yaml)
+ self.assertFalse(test)
+
+ test = isTestRunnable('functest/odl', functest_yaml)
+ self.assertTrue(test)
+
+ test = isTestRunnable('functest/vping', functest_yaml)
+ self.assertTrue(test)
+
+ test = isTestRunnable('functest/tempest', functest_yaml)
+ self.assertTrue(test)
+
+ test = isTestRunnable('functest/rally', functest_yaml)
+ self.assertTrue(test)
+
+ test = isTestRunnable('functest/vims', functest_yaml)
+ self.assertTrue(test)
+
+ test = isTestRunnable('sdnvpn/odl-vpn_service-tests',
+ functest_yaml)
+ self.assertTrue(test)
+
+ test = isTestRunnable('sdnvpn/opnfv-yardstick-tc026-sdnvpn',
+ functest_yaml)
+ self.assertFalse(test)
+
+ def test_generateTestcaseList(self):
+
+ test = generateTestcaseList(functest_yaml)
+ test = sorted(test.split(' '))
+ expected_list = "doctor vims odl rally vping tempest promise policy-test odl-vpn_service-tests "
+ expected_list_array = sorted(expected_list.split(' '))
+
+ self.assertEqual(test, expected_list_array)
+
+ def tearDown(self):
+ os.environ["INSTALLER_TYPE"] = ""
+ os.environ["SDN_CONTROLLER"] = ""
+ os.environ["OPNFV_FEATURE"] = ""
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/testcases/vIMS/CI/orchestrator.py b/testcases/vIMS/CI/orchestrator.py
index c62cba4f7..ab0b448fa 100644
--- a/testcases/vIMS/CI/orchestrator.py
+++ b/testcases/vIMS/CI/orchestrator.py
@@ -91,14 +91,14 @@ class orchestrator:
if self.logger:
self.logger.info("Launching the cloudify-manager deployment")
-
- script = "source " + self.testcase_dir + "venv_cloudify/bin/activate; "
+ script = "set -e; "
+ script += "source " + self.testcase_dir + "venv_cloudify/bin/activate; "
script += "cd " + self.testcase_dir + "; "
script += "cfy init -r; "
script += "cd cloudify-manager-blueprint; "
script += "cfy local create-requirements -o requirements.txt -p openstack-manager-blueprint.yaml; "
script += "pip install -r requirements.txt; "
- script += "cfy bootstrap --install-plugins -p openstack-manager-blueprint.yaml -i inputs.yaml; "
+ script += "timeout 1800 cfy bootstrap --install-plugins -p openstack-manager-blueprint.yaml -i inputs.yaml; "
cmd = "/bin/bash -c '" + script + "'"
execute_command(cmd, self.logger)
diff --git a/testcases/vIMS/CI/vIMS.py b/testcases/vIMS/CI/vIMS.py
index 94679f02a..98cc009cf 100644
--- a/testcases/vIMS/CI/vIMS.py
+++ b/testcases/vIMS/CI/vIMS.py
@@ -148,7 +148,6 @@ def test_clearwater():
CW_INPUTS["public_domain"] + '] SIGNUP_CODE="secret"'
cmd = "/bin/bash -c '" + script + "'"
- print cmd
output_file = "output.txt"
f = open(output_file, 'w+')
p = subprocess.call(cmd, shell=True, stdout=f,