From 645da883ab970d9c738e9534d16357ef256e19c9 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Thu, 22 Dec 2016 20:33:23 +0800 Subject: refactor snaps and example using new constants provider JIRA: FUNCTEST-673 Change-Id: If20be3c614f729c17bf6484676de7889747a98c0 Signed-off-by: SerenaFeng --- functest/opnfv_tests/openstack/snaps/smoke.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'functest/opnfv_tests/openstack/snaps/smoke.py') diff --git a/functest/opnfv_tests/openstack/snaps/smoke.py b/functest/opnfv_tests/openstack/snaps/smoke.py index 691f8138..83eb6600 100644 --- a/functest/opnfv_tests/openstack/snaps/smoke.py +++ b/functest/opnfv_tests/openstack/snaps/smoke.py @@ -5,12 +5,14 @@ # # http://www.apache.org/licenses/LICENSE-2.0 -import functest.utils.functest_utils as ft_utils +import os +import unittest + +from snaps import test_suite_builder + 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 +from functest.utils.constants import CONST class SnapsSmoke(PyTestSuiteRunner): @@ -24,18 +26,18 @@ class SnapsSmoke(PyTestSuiteRunner): self.suite = unittest.TestSuite() self.case_name = "snaps_smoke" - 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') + use_fip = CONST.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.dir.dir_repo_snaps') + '/snaps' + snaps_dir = CONST.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, + self.suite, + CONST.openstack_creds, + ext_net_name, + use_keystone=CONST.snaps_use_keystone, use_floating_ips=use_fip) -- cgit 1.2.3-korg