aboutsummaryrefslogtreecommitdiffstats
path: root/functest
diff options
context:
space:
mode:
Diffstat (limited to 'functest')
-rwxr-xr-xfunctest/ci/config_patch.yaml4
-rw-r--r--functest/core/feature.py7
-rw-r--r--functest/opnfv_tests/openstack/snaps/api_check.py9
-rw-r--r--functest/opnfv_tests/openstack/snaps/connection_check.py9
-rw-r--r--functest/opnfv_tests/openstack/snaps/health_check.py5
-rw-r--r--functest/opnfv_tests/openstack/snaps/smoke.py13
-rw-r--r--functest/opnfv_tests/openstack/snaps/snaps_test_runner.py12
-rw-r--r--functest/opnfv_tests/openstack/snaps/snaps_utils.py8
8 files changed, 39 insertions, 28 deletions
diff --git a/functest/ci/config_patch.yaml b/functest/ci/config_patch.yaml
index d984a3f4..d47766b6 100755
--- a/functest/ci/config_patch.yaml
+++ b/functest/ci/config_patch.yaml
@@ -22,3 +22,7 @@ ovs:
tempest:
use_custom_images: True
use_custom_flavors: True
+multisite:
+ tempest:
+ use_custom_images: True
+ use_custom_flavors: True
diff --git a/functest/core/feature.py b/functest/core/feature.py
index 3c95bdaf..bab1d507 100644
--- a/functest/core/feature.py
+++ b/functest/core/feature.py
@@ -1,5 +1,12 @@
#!/usr/bin/env python
+# Copyright (c) 2016 ZTE Corp and others.
+#
+# 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 time
import functest.core.testcase as base
diff --git a/functest/opnfv_tests/openstack/snaps/api_check.py b/functest/opnfv_tests/openstack/snaps/api_check.py
index bceb7c1d..50f67094 100644
--- a/functest/opnfv_tests/openstack/snaps/api_check.py
+++ b/functest/opnfv_tests/openstack/snaps/api_check.py
@@ -11,7 +11,6 @@ from snaps import test_suite_builder
from functest.opnfv_tests.openstack.snaps.snaps_test_runner import \
SnapsTestRunner
-from functest.utils.constants import CONST
class ApiCheck(SnapsTestRunner):
@@ -28,7 +27,7 @@ class ApiCheck(SnapsTestRunner):
self.suite = unittest.TestSuite()
test_suite_builder.add_openstack_api_tests(
- self.suite,
- CONST.openstack_creds,
- self.ext_net_name,
- use_keystone=CONST.snaps_use_keystone)
+ suite=self.suite,
+ os_creds=self.os_creds,
+ ext_net_name=self.ext_net_name,
+ use_keystone=self.use_keystone)
diff --git a/functest/opnfv_tests/openstack/snaps/connection_check.py b/functest/opnfv_tests/openstack/snaps/connection_check.py
index 0607beb3..f2753aea 100644
--- a/functest/opnfv_tests/openstack/snaps/connection_check.py
+++ b/functest/opnfv_tests/openstack/snaps/connection_check.py
@@ -11,7 +11,6 @@ from snaps import test_suite_builder
from functest.opnfv_tests.openstack.snaps.snaps_test_runner import \
SnapsTestRunner
-from functest.utils.constants import CONST
class ConnectionCheck(SnapsTestRunner):
@@ -28,7 +27,7 @@ class ConnectionCheck(SnapsTestRunner):
self.suite = unittest.TestSuite()
test_suite_builder.add_openstack_client_tests(
- self.suite,
- CONST.openstack_creds,
- self.ext_net_name,
- use_keystone=CONST.snaps_use_keystone)
+ suite=self.suite,
+ os_creds=self.os_creds,
+ ext_net_name=self.ext_net_name,
+ use_keystone=self.use_keystone)
diff --git a/functest/opnfv_tests/openstack/snaps/health_check.py b/functest/opnfv_tests/openstack/snaps/health_check.py
index 245f5052..44e3b876 100644
--- a/functest/opnfv_tests/openstack/snaps/health_check.py
+++ b/functest/opnfv_tests/openstack/snaps/health_check.py
@@ -34,7 +34,8 @@ class HealthCheck(SnapsTestRunner):
self.suite.addTest(
OSIntegrationTestCase.parameterize(
- SimpleHealthCheck, CONST.openstack_creds, self.ext_net_name,
- use_keystone=CONST.snaps_use_keystone,
+ SimpleHealthCheck, os_creds=self.os_creds,
+ ext_net_name=self.ext_net_name,
+ use_keystone=self.use_keystone,
flavor_metadata=self.flavor_metadata,
image_metadata=image_custom_config))
diff --git a/functest/opnfv_tests/openstack/snaps/smoke.py b/functest/opnfv_tests/openstack/snaps/smoke.py
index ceead6bb..5a637f28 100644
--- a/functest/opnfv_tests/openstack/snaps/smoke.py
+++ b/functest/opnfv_tests/openstack/snaps/smoke.py
@@ -27,7 +27,6 @@ class SnapsSmoke(SnapsTestRunner):
super(SnapsSmoke, self).__init__(**kwargs)
self.suite = unittest.TestSuite()
- use_fip = CONST.snaps_use_floating_ips
# The snaps smoke test uses the same config as the
# snaps_health_check suite, so reuse it here
@@ -37,15 +36,15 @@ class SnapsSmoke(SnapsTestRunner):
# Tests requiring floating IPs leverage files contained within the
# SNAPS repository and are found relative to that path
- if use_fip:
+ if self.use_fip:
snaps_dir = CONST.dir_repo_snaps + '/snaps'
os.chdir(snaps_dir)
test_suite_builder.add_openstack_integration_tests(
- self.suite,
- CONST.openstack_creds,
- self.ext_net_name,
- use_keystone=CONST.snaps_use_keystone,
+ suite=self.suite,
+ os_creds=self.os_creds,
+ ext_net_name=self.ext_net_name,
+ use_keystone=self.use_keystone,
flavor_metadata=self.flavor_metadata,
image_metadata=image_custom_config,
- use_floating_ips=use_fip)
+ use_floating_ips=self.use_fip)
diff --git a/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py b/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py
index 2068852e..b17aab0c 100644
--- a/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py
+++ b/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py
@@ -5,12 +5,13 @@
#
# http://www.apache.org/licenses/LICENSE-2.0
-from functest.utils import functest_logger as ft_logger
from functest.core.pytest_suite_runner import PyTestSuiteRunner
from functest.opnfv_tests.openstack.snaps import snaps_utils
from functest.utils import functest_utils
+from functest.utils.constants import CONST
from snaps.openstack import create_flavor
+from snaps.openstack.tests import openstack_tests
class SnapsTestRunner(PyTestSuiteRunner):
@@ -22,8 +23,13 @@ class SnapsTestRunner(PyTestSuiteRunner):
def __init__(self, **kwargs):
super(SnapsTestRunner, self).__init__(**kwargs)
- self.ext_net_name = snaps_utils.get_ext_net_name()
- self.logger = ft_logger.Logger(self.project_name).getLogger()
+ self.os_creds = openstack_tests.get_credentials(
+ os_env_file=CONST.openstack_creds, proxy_settings_str=None,
+ ssh_proxy_cmd=None)
+
+ self.ext_net_name = snaps_utils.get_ext_net_name(self.os_creds)
+ self.use_fip = CONST.snaps_use_floating_ips
+ self.use_keystone = CONST.snaps_use_keystone
scenario = functest_utils.get_scenario()
self.flavor_metadata = create_flavor.MEM_PAGE_SIZE_ANY
diff --git a/functest/opnfv_tests/openstack/snaps/snaps_utils.py b/functest/opnfv_tests/openstack/snaps/snaps_utils.py
index 4ea1a04a..327ba073 100644
--- a/functest/opnfv_tests/openstack/snaps/snaps_utils.py
+++ b/functest/opnfv_tests/openstack/snaps/snaps_utils.py
@@ -5,19 +5,15 @@
#
# http://www.apache.org/licenses/LICENSE-2.0
-from snaps.openstack.tests import openstack_tests
from snaps.openstack.utils import neutron_utils
-from functest.utils.constants import CONST
-
-def get_ext_net_name():
+def get_ext_net_name(os_creds):
"""
Returns the first external network name
+ :param: os_creds: an instance of snaps OSCreds object
:return:
"""
- os_env_file = CONST.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']