summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xfunctest/ci/config_functest.yaml5
-rwxr-xr-xfunctest/ci/testcases.yaml56
-rw-r--r--functest/core/pytest_suite_runner.py56
-rw-r--r--functest/opnfv_tests/openstack/snaps/__init__.py0
-rw-r--r--functest/opnfv_tests/openstack/snaps/api_check.py31
-rw-r--r--functest/opnfv_tests/openstack/snaps/connection_check.py31
-rw-r--r--functest/opnfv_tests/openstack/snaps/smoke.py40
-rw-r--r--functest/opnfv_tests/openstack/snaps/snaps_utils.py22
-rw-r--r--functest/utils/functest_utils.py2
-rwxr-xr-xfunctest/utils/openstack_clean.py121
-rwxr-xr-xfunctest/utils/openstack_snapshot.py53
-rwxr-xr-xfunctest/utils/openstack_utils.py26
-rw-r--r--requirements.txt2
-rwxr-xr-xrun_unit_tests.sh10
14 files changed, 269 insertions, 186 deletions
diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml
index c75afdafe..0da2bb8f3 100755
--- a/functest/ci/config_functest.yaml
+++ b/functest/ci/config_functest.yaml
@@ -26,6 +26,7 @@ general:
dir_repo_ovno: /home/opnfv/repos/ovno
dir_repo_parser: /home/opnfv/repos/parser
dir_repo_domino: /home/opnfv/repos/domino
+ dir_repo_snaps: /home/opnfv/repos/snaps
dir_functest: /home/opnfv/functest
dir_functest_test: /home/opnfv/repos/functest/functest/opnfv_tests
dir_results: /home/opnfv/functest/results
@@ -64,6 +65,10 @@ healthcheck:
disk_format: qcow2
wait_time: 60
+snaps:
+ use_keystone: True
+ use_floating_ips: False
+
vping:
ping_timeout: 200
vm_flavor: m1.tiny # adapt to your environment
diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml
index d483e589e..56ca40176 100755
--- a/functest/ci/testcases.yaml
+++ b/functest/ci/testcases.yaml
@@ -19,6 +19,42 @@ tiers:
installer: ''
scenario: '^((?!lxd).)*$'
+ -
+ name: connection_check
+ criteria: 'status == "PASS"'
+ blocking: true
+ description: >-
+ This test case verifies the retrieval of OpenStack clients:
+ Keystone, Glance, Neutron and Nova and may perform some
+ simple queries. When the config value of
+ snaps.use_keystone is True, functest must have access to
+ the cloud's private network.
+
+ dependencies:
+ installer: ''
+ scenario: ''
+ run:
+ module: 'functest.opnfv_tests.openstack.snaps.connection_check'
+ class: 'ConnectionCheck'
+
+ -
+ name: api_check
+ criteria: 'status == "PASS"'
+ blocking: true
+ description: >-
+ This test case verifies the retrieval of OpenStack clients:
+ Keystone, Glance, Neutron and Nova and may perform some
+ simple queries. When the config value of
+ snaps.use_keystone is True, functest must have access to
+ the cloud's private network.
+
+ dependencies:
+ installer: ''
+ scenario: ''
+ run:
+ module: 'functest.opnfv_tests.openstack.snaps.api_check'
+ class: 'ApiCheck'
+
-
name: smoke
order: 1
@@ -106,6 +142,26 @@ tiers:
installer: ''
scenario: 'onos'
+ -
+ name: snaps_smoke
+ criteria: 'status == "PASS"'
+ blocking: true
+ description: >-
+ This test case contains tests that setup and destroy
+ environments with VMs with and without Floating IPs
+ with a newly created user and project. Set the config
+ value snaps.use_floating_ips (True|False) to toggle
+ this functionality. When the config value of
+ snaps.use_keystone is True, functest must have access to
+ the cloud's private network.
+
+ dependencies:
+ installer: ''
+ scenario: ''
+ run:
+ module: 'functest.opnfv_tests.openstack.snaps.smoke'
+ class: 'SnapsSmoke'
+
-
name: features
order: 2
diff --git a/functest/core/pytest_suite_runner.py b/functest/core/pytest_suite_runner.py
new file mode 100644
index 000000000..ba372c3b9
--- /dev/null
+++ b/functest/core/pytest_suite_runner.py
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+#
+# Copyright (c) 2015 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
+
+from functest.core import TestCasesBase
+import unittest
+import time
+
+
+class PyTestSuiteRunner(TestCasesBase.TestCasesBase):
+ """
+ This superclass is designed to execute pre-configured unittest.TestSuite()
+ objects
+ """
+ def __init__(self):
+ super(PyTestSuiteRunner, self).__init__()
+ self.suite = None
+
+ def run(self, **kwargs):
+ """
+ Starts test execution from the functest framework
+ """
+ start_time = time.time()
+ result = unittest.TextTestRunner(verbosity=2).run(self.suite)
+ end_time = time.time()
+
+ if result.errors:
+ self.logger.error('Number of errors in test suite - ' +
+ str(len(result.errors)))
+ for test, message in result.errors:
+ self.logger.error(str(test) + " ERROR with " + message)
+
+ if result.failures:
+ self.logger.error('Number of failures in test suite - ' +
+ str(len(result.failures)))
+ for test, message in result.failures:
+ self.logger.error(str(test) + " FAILED with " + message)
+
+ if (result.errors and len(result.errors) > 0) \
+ or (result.failures and len(result.failures) > 0):
+ self.logger.info("%s FAILED" % self.case_name)
+ self.criteria = 'FAIL'
+ exit_code = TestCasesBase.TestCasesBase.EX_RUN_ERROR
+ else:
+ self.logger.info("%s OK" % self.case_name)
+ exit_code = TestCasesBase.TestCasesBase.EX_OK
+
+ self.details = {'timestart': start_time,
+ 'duration': round(end_time - start_time, 1),
+ 'status': self.criteria}
+ return exit_code
diff --git a/functest/opnfv_tests/openstack/snaps/__init__.py b/functest/opnfv_tests/openstack/snaps/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/functest/opnfv_tests/openstack/snaps/__init__.py
diff --git a/functest/opnfv_tests/openstack/snaps/api_check.py b/functest/opnfv_tests/openstack/snaps/api_check.py
new file mode 100644
index 000000000..e6ee81e9d
--- /dev/null
+++ b/functest/opnfv_tests/openstack/snaps/api_check.py
@@ -0,0 +1,31 @@
+# Copyright (c) 2015 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 functest.utils.functest_utils as ft_utils
+from functest.core.pytest_suite_runner import PyTestSuiteRunner
+from functest.opnfv_tests.openstack.snaps import snaps_utils
+from snaps import test_suite_builder
+import unittest
+
+
+class ApiCheck(PyTestSuiteRunner):
+ """
+ This test executes the Python Tests included with the SNAPS libraries
+ that exercise many of the OpenStack APIs within Keystone, Glance, Neutron,
+ and Nova
+ """
+ def __init__(self):
+ super(ApiCheck, self).__init__()
+
+ self.suite = unittest.TestSuite()
+ creds_file = ft_utils.get_functest_config('general.openstack.creds')
+ use_key = ft_utils.get_functest_config('snaps.use_keystone')
+ ext_net_name = snaps_utils.get_ext_net_name()
+
+ test_suite_builder.add_openstack_api_tests(self.suite, creds_file,
+ ext_net_name,
+ use_keystone=use_key)
diff --git a/functest/opnfv_tests/openstack/snaps/connection_check.py b/functest/opnfv_tests/openstack/snaps/connection_check.py
new file mode 100644
index 000000000..42e38d67c
--- /dev/null
+++ b/functest/opnfv_tests/openstack/snaps/connection_check.py
@@ -0,0 +1,31 @@
+# Copyright (c) 2015 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 functest.utils.functest_utils as ft_utils
+from functest.core.pytest_suite_runner import PyTestSuiteRunner
+from functest.opnfv_tests.openstack.snaps import snaps_utils
+from snaps import test_suite_builder
+import unittest
+
+
+class ConnectionCheck(PyTestSuiteRunner):
+ """
+ This test executes the Python Tests included with the SNAPS libraries
+ that simply obtain the different OpenStack clients and may perform
+ simple queries
+ """
+ def __init__(self):
+ super(ConnectionCheck, self).__init__()
+
+ self.suite = unittest.TestSuite()
+ creds_file = ft_utils.get_functest_config('general.openstack.creds')
+ use_key = ft_utils.get_functest_config('snaps.use_keystone')
+ ext_net_name = snaps_utils.get_ext_net_name()
+
+ test_suite_builder.add_openstack_client_tests(self.suite, creds_file,
+ ext_net_name,
+ use_keystone=use_key)
diff --git a/functest/opnfv_tests/openstack/snaps/smoke.py b/functest/opnfv_tests/openstack/snaps/smoke.py
new file mode 100644
index 000000000..25433a325
--- /dev/null
+++ b/functest/opnfv_tests/openstack/snaps/smoke.py
@@ -0,0 +1,40 @@
+# Copyright (c) 2015 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 functest.utils.functest_utils as ft_utils
+from functest.core.pytest_suite_runner import PyTestSuiteRunner
+from functest.opnfv_tests.openstack.snaps import snaps_utils
+from snaps import test_suite_builder
+import unittest
+import os
+
+
+class SnapsSmoke(PyTestSuiteRunner):
+ """
+ This test executes the Python Tests included with the SNAPS libraries
+ that exercise many of the OpenStack APIs within Keystone, Glance, Neutron,
+ and Nova
+ """
+ def __init__(self):
+ super(SnapsSmoke, self).__init__()
+
+ self.suite = unittest.TestSuite()
+ creds_file = ft_utils.get_functest_config('general.openstack.creds')
+ use_key = ft_utils.get_functest_config('snaps.use_keystone')
+ use_fip = ft_utils.get_functest_config('snaps.use_floating_ips')
+ ext_net_name = snaps_utils.get_ext_net_name()
+
+ # Tests requiring floating IPs leverage files contained within the
+ # SNAPS repository and are found relative to that path
+ if use_fip:
+ snaps_dir = ft_utils.get_functest_config(
+ 'general.directories.dir_repo_snaps') + '/snaps'
+ os.chdir(snaps_dir)
+
+ test_suite_builder.add_openstack_integration_tests(
+ self.suite, creds_file, ext_net_name, use_keystone=use_key,
+ use_floating_ips=use_fip)
diff --git a/functest/opnfv_tests/openstack/snaps/snaps_utils.py b/functest/opnfv_tests/openstack/snaps/snaps_utils.py
new file mode 100644
index 000000000..a25ad3e0d
--- /dev/null
+++ b/functest/opnfv_tests/openstack/snaps/snaps_utils.py
@@ -0,0 +1,22 @@
+# Copyright (c) 2015 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 functest.utils.functest_utils as ft_utils
+from snaps.openstack.tests import openstack_tests
+from snaps.openstack.utils import neutron_utils
+
+
+def get_ext_net_name():
+ """
+ Returns the first external network name
+ :return:
+ """
+ os_env_file = ft_utils.get_functest_config('general.openstack.creds')
+ os_creds = openstack_tests.get_credentials(os_env_file=os_env_file)
+ neutron = neutron_utils.neutron_client(os_creds)
+ ext_nets = neutron_utils.get_external_networks(neutron)
+ return ext_nets[0]['network']['name']
diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py
index 3fafd4bf2..8f816cdf9 100644
--- a/functest/utils/functest_utils.py
+++ b/functest/utils/functest_utils.py
@@ -419,7 +419,7 @@ def merge_dicts(dict1, dict2):
def get_testcases_file_dir():
- return "/home/opnfv/repos/functest/functest/ci/testcases.yaml"
+ return get_functest_config('general.functest.testcases_yaml')
def get_functest_yaml():
diff --git a/functest/utils/openstack_clean.py b/functest/utils/openstack_clean.py
index 0c3ae3e32..949eee90f 100755
--- a/functest/utils/openstack_clean.py
+++ b/functest/utils/openstack_clean.py
@@ -9,8 +9,6 @@
# - Neutron networks, subnets and ports
# - Routers
# - Users and tenants
-# - Tacker VNFDs and VNFs
-# - Tacker SFCs and SFC classifiers
#
# Author:
# jose.lausuch@ericsson.com
@@ -25,7 +23,6 @@
import time
import functest.utils.functest_logger as ft_logger
import functest.utils.openstack_utils as os_utils
-import functest.utils.openstack_tacker as os_tacker
import yaml
import functest.utils.functest_constants as ft_constants
@@ -372,109 +369,6 @@ def remove_tenants(keystone_client, default_tenants):
"NOT be deleted.")
-def remove_tacker_vnfds(tacker_client, default_vnfds):
- logger.debug("Removing Tacker VNFDs...")
- vnfds = os_tacker.list_vnfds(tacker_client, verbose=True)['vnfds']
- if vnfds is None:
- logger.debug("There are no Tacker VNFDs in the deployment. ")
- return
-
- for vnfd in vnfds:
- vnfd_name = vnfd['name']
- vnfd_id = vnfd['id']
- logger.debug("'%s', ID=%s " % (vnfd_name, vnfd_id))
- if (vnfd_id not in default_vnfds and
- vnfd_name not in default_vnfds.values()):
- logger.debug(" Removing '%s'..." % vnfd_name)
- deleted = os_tacker.delete_vnfd(tacker_client, vnfd_id=vnfd_id)
- if deleted is not None:
- logger.debug(" > Done!")
- else:
- logger.error("There has been a problem removing the "
- "VNFD '%s'(%s)..." % (vnfd_name, vnfd_id))
- else:
- logger.debug(" > this is a default VNFD and will "
- "NOT be deleted.")
-
-
-def remove_tacker_vnfs(tacker_client, default_vnfs):
- logger.debug("Removing Tacker VNFs...")
- vnfs = os_tacker.list_vnfs(tacker_client, verbose=True)['vnfs']
- if vnfs is None:
- logger.debug("There are no Tacker VNFs in the deployment. ")
- return
-
- for vnf in vnfs:
- vnf_name = vnf['name']
- vnf_id = vnf['id']
- logger.debug("'%s', ID=%s " % (vnf_name, vnf_id))
- if (vnf_id not in default_vnfs and
- vnf_name not in default_vnfs.values()):
- logger.debug(" Removing '%s'..." % vnf_name)
- deleted = os_tacker.delete_vnf(tacker_client, vnf_id=vnf_id)
- if deleted is not None:
- logger.debug(" > Done!")
- else:
- logger.error("There has been a problem removing the "
- "VNF '%s'(%s)..." % (vnf_name, vnf_id))
- else:
- logger.debug(" > this is a default VNF and will "
- "NOT be deleted.")
-
-
-def remove_tacker_sfcs(tacker_client, default_sfcs):
- logger.debug("Removing Tacker SFCs...")
- sfcs = os_tacker.list_sfcs(tacker_client, verbose=True)['sfcs']
- if sfcs is None:
- logger.debug("There are no Tacker SFCs in the deployment. ")
- return
-
- for sfc in sfcs:
- sfc_name = sfc['name']
- sfc_id = sfc['id']
- logger.debug("'%s', ID=%s " % (sfc_name, sfc_id))
- if (sfc_id not in default_sfcs and
- sfc_name not in default_sfcs.values()):
- logger.debug(" Removing '%s'..." % sfc_name)
- deleted = os_tacker.delete_sfc(tacker_client, sfc_id=sfc_id)
- if deleted is not None:
- logger.debug(" > Done!")
- else:
- logger.error("There has been a problem removing the "
- "SFC '%s'(%s)..." % (sfc_name, sfc_id))
- else:
- logger.debug(" > this is a default SFC and will "
- "NOT be deleted.")
-
-
-def remove_tacker_sfc_classifiers(tacker_client, default_sfc_classifiers):
- logger.debug("Removing Tacker SFC classifiers...")
- sfc_clfs = os_tacker.list_sfc_classifiers(
- tacker_client, verbose=True)['sfc_classfiers']
- if sfc_clfs is None:
- logger.debug("There are no Tacker SFC classifiers in the deployment.")
- return
-
- for sfc_clf in sfc_clfs:
- sfc_clf_name = sfc_clf['name']
- sfc_clf_id = sfc_clf['id']
- logger.debug("'%s', ID=%s " % (sfc_clf_name, sfc_clf_id))
- if (sfc_clf_id not in default_sfc_classifiers and
- sfc_clf_name not in default_sfc_classifiers.values()):
- logger.debug(" Removing '%s'..." % sfc_clf_name)
- deleted = os_tacker.delete_sfc_classifier(
- tacker_client, sfc_clf_id=sfc_clf_id)
- if deleted is not None:
- logger.debug(" > Done!")
- else:
- logger.error("There has been a problem removing the "
- "SFC classifier '%s'(%s)..."
- % (sfc_clf_name, sfc_clf_id))
- else:
- logger.debug(" > this is a default SFC classifier and will "
- "NOT be deleted.")
-
-
def main():
logger.info("Cleaning OpenStack resources...")
@@ -482,7 +376,6 @@ def main():
neutron_client = os_utils.get_neutron_client()
keystone_client = os_utils.get_keystone_client()
cinder_client = os_utils.get_cinder_client()
- tacker_client = os_tacker.get_tacker_client()
try:
with open(OS_SNAPSHOT_FILE) as f:
@@ -501,10 +394,6 @@ def main():
default_floatingips = snapshot_yaml.get('floatingips')
default_users = snapshot_yaml.get('users')
default_tenants = snapshot_yaml.get('tenants')
- default_vnfds = snapshot_yaml.get('vnfds')
- default_vnfs = snapshot_yaml.get('vnfs')
- default_sfcs = snapshot_yaml.get('sfcs')
- default_sfc_classifiers = snapshot_yaml.get('sfc_classifiers')
if not os_utils.check_credentials():
logger.error("Please source the openrc credentials and run "
@@ -527,16 +416,6 @@ def main():
separator()
remove_tenants(keystone_client, default_tenants)
separator()
- # Note: Delete in this order
- # 1. Classifiers, 2. SFCs, 3. VNFs, 4. VNFDs
- remove_tacker_sfc_classifiers(tacker_client, default_sfc_classifiers)
- separator()
- remove_tacker_sfcs(tacker_client, default_sfcs)
- separator()
- remove_tacker_vnfs(tacker_client, default_vnfs)
- separator()
- remove_tacker_vnfds(tacker_client, default_vnfds)
- separator()
if __name__ == '__main__':
diff --git a/functest/utils/openstack_snapshot.py b/functest/utils/openstack_snapshot.py
index d6e7fe006..4be1af443 100755
--- a/functest/utils/openstack_snapshot.py
+++ b/functest/utils/openstack_snapshot.py
@@ -9,8 +9,6 @@
# - Neutron networks, subnets and ports
# - Routers
# - Users and tenants
-# - Tacker VNFDs and VNFs
-# - Tacker SFCs and SFC classifiers
#
# Author:
# jose.lausuch@ericsson.com
@@ -24,7 +22,6 @@
import functest.utils.functest_logger as ft_logger
import functest.utils.openstack_utils as os_utils
-import functest.utils.openstack_tacker as os_tacker
import yaml
import functest.utils.functest_constants as ft_constants
@@ -130,51 +127,6 @@ def get_tenants(keystone_client):
return {'tenants': dic_tenants}
-def get_tacker_vnfds(tacker_client):
- logger.debug("Getting Tacker VNFDs...")
- dic_vnfds = {}
- vnfds = os_tacker.list_vnfds(tacker_client, verbose=True)['vnfds']
- if not (vnfds is None or len(vnfds) == 0):
- for vnfd in vnfds:
- dic_vnfds.update({vnfd['id']:
- vnfd['name']})
- return {'vnfds': dic_vnfds}
-
-
-def get_tacker_vnfs(tacker_client):
- logger.debug("Getting Tacker VNFs...")
- dic_vnfs = {}
- vnfs = os_tacker.list_vnfs(tacker_client, verbose=True)['vnfs']
- if not (vnfs is None or len(vnfs) == 0):
- for vnf in vnfs:
- dic_vnfs.update({vnf['id']:
- vnf['name']})
- return {'vnfs': dic_vnfs}
-
-
-def get_tacker_sfcs(tacker_client):
- logger.debug("Getting Tacker SFCs...")
- dic_sfcs = {}
- sfcs = os_tacker.list_sfcs(tacker_client, verbose=True)['sfcs']
- if not (sfcs is None or len(sfcs) == 0):
- for sfc in sfcs:
- dic_sfcs.update({sfc['id']:
- sfc['name']})
- return {'sfcs': dic_sfcs}
-
-
-def get_tacker_sfc_classifiers(tacker_client):
- logger.debug("Getting Tacker SFC classifiers...")
- dic_sfc_clfs = {}
- sfc_clfs = os_tacker.list_sfc_clasifiers(
- tacker_client, verbose=True)['sfc_classifiers']
- if not (sfc_clfs is None or len(sfc_clfs) == 0):
- for sfc_clf in sfc_clfs:
- dic_sfc_clfs.update({sfc_clf['id']:
- sfc_clf['name']})
- return {'sfc_classifiers': dic_sfc_clfs}
-
-
def main():
logger.info("Generating OpenStack snapshot...")
@@ -182,7 +134,6 @@ def main():
neutron_client = os_utils.get_neutron_client()
keystone_client = os_utils.get_keystone_client()
cinder_client = os_utils.get_cinder_client()
- tacker_client = os_tacker.get_tacker_client()
if not os_utils.check_credentials():
logger.error("Please source the openrc credentials and run the" +
@@ -199,10 +150,6 @@ def main():
snapshot.update(get_floatinips(nova_client))
snapshot.update(get_users(keystone_client))
snapshot.update(get_tenants(keystone_client))
- snapshot.update(get_tacker_vnfds(tacker_client))
- snapshot.update(get_tacker_vnfs(tacker_client))
- snapshot.update(get_tacker_sfcs(tacker_client))
- snapshot.update(get_tacker_sfc_classifiers(tacker_client))
with open(OS_SNAPSHOT_FILE, 'w+') as yaml_file:
yaml_file.write(yaml.safe_dump(snapshot, default_flow_style=False))
diff --git a/functest/utils/openstack_utils.py b/functest/utils/openstack_utils.py
index df6fb5d1a..10aaf5034 100755
--- a/functest/utils/openstack_utils.py
+++ b/functest/utils/openstack_utils.py
@@ -56,8 +56,19 @@ def get_credentials(service):
"""
creds = {}
+ keystone_api_version = os.getenv('OS_IDENTITY_API_VERSION')
+ if (keystone_api_version is None or
+ keystone_api_version == '2'):
+ keystone_v3 = False
+ tenant_env = 'OS_TENANT_NAME'
+ tenant = 'tenant_name'
+ else:
+ keystone_v3 = True
+ tenant_env = 'OS_PROJECT_NAME'
+ tenant = 'project_name'
+
# Check that the env vars exists:
- envvars = ('OS_USERNAME', 'OS_PASSWORD', 'OS_AUTH_URL', 'OS_TENANT_NAME')
+ envvars = ('OS_USERNAME', 'OS_PASSWORD', 'OS_AUTH_URL', tenant_env)
for envvar in envvars:
if os.getenv(envvar) is None:
raise MissingEnvVar(envvar)
@@ -69,7 +80,6 @@ def get_credentials(service):
tenant = "project_id"
else:
password = "password"
- tenant = "tenant_name"
# The most common way to pass these info to the script is to do it through
# environment variables.
@@ -77,8 +87,18 @@ def get_credentials(service):
"username": os.environ.get("OS_USERNAME"),
password: os.environ.get("OS_PASSWORD"),
"auth_url": os.environ.get("OS_AUTH_URL"),
- tenant: os.environ.get("OS_TENANT_NAME")
+ tenant: os.environ.get(tenant_env)
})
+ if keystone_v3:
+ if os.getenv('OS_USER_DOMAIN_NAME') is not None:
+ creds.update({
+ "user_domain_name": os.getenv('OS_USER_DOMAIN_NAME')
+ })
+ if os.getenv('OS_PROJECT_DOMAIN_NAME') is not None:
+ creds.update({
+ "project_domain_name": os.getenv('OS_PROJECT_DOMAIN_NAME')
+ })
+
if os.getenv('OS_ENDPOINT_TYPE') is not None:
creds.update({
"endpoint_type": os.environ.get("OS_ENDPOINT_TYPE")
diff --git a/requirements.txt b/requirements.txt
index e4d2877c0..88d0d7dea 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -14,7 +14,7 @@ python-neutronclient==6.0.0
python-congressclient==1.5.0
virtualenv==1.11.4
pexpect==4.0
-requests==2.8.0
+requests>=2.8.0
robotframework==2.9.1
robotframework-requests==0.3.8
robotframework-sshlibrary==2.1.1
diff --git a/run_unit_tests.sh b/run_unit_tests.sh
index 05b3c4ee2..ecd57d8ae 100755
--- a/run_unit_tests.sh
+++ b/run_unit_tests.sh
@@ -41,14 +41,10 @@ virtualenv $WORKSPACE/functest_venv
source $WORKSPACE/functest_venv/bin/activate
# install python packages
-easy_install -U setuptools
-easy_install -U pip
+sudo apt-get install -y build-essential python-dev python-pip
+pip install --upgrade pip
pip install -r $WORKSPACE/test-requirements.txt
-
-
-pip install -e $WORKSPACE
-
-python $WORKSPACE/setup.py develop
+pip install $WORKSPACE
export CONFIG_FUNCTEST_YAML=$(pwd)/functest/ci/config_functest.yaml
# unit tests