aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/openstack/tempest/test_conf_utils.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-04-12 20:58:01 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-04-12 21:05:55 +0200
commit71c4b3b719289929c226cae60eb1b23ada16eeb2 (patch)
treefd90e6fcd06f2f12152ac9d3e9962162c215b09a /functest/tests/unit/openstack/tempest/test_conf_utils.py
parent51acd93bfe71e2cbd897f071e58b641ccd5ca1ac (diff)
Fix role processing in Patrole
Role has to be listed in tempest.conf before calling testr. It also saves the right config file. Change-Id: Ifd122f31d0bfe3e9b3f93c6d62526acce96953d3 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/openstack/tempest/test_conf_utils.py')
-rw-r--r--functest/tests/unit/openstack/tempest/test_conf_utils.py26
1 files changed, 1 insertions, 25 deletions
diff --git a/functest/tests/unit/openstack/tempest/test_conf_utils.py b/functest/tests/unit/openstack/tempest/test_conf_utils.py
index 161d9c076..8988e96a1 100644
--- a/functest/tests/unit/openstack/tempest/test_conf_utils.py
+++ b/functest/tests/unit/openstack/tempest/test_conf_utils.py
@@ -188,28 +188,6 @@ class OSTempestConfUtilsTesting(unittest.TestCase):
self.assertTrue(mock_get_vid.called)
self.assertTrue(mock_get_did.called)
- def test_backup_config_default(self):
- with mock.patch('functest.opnfv_tests.openstack.tempest.'
- 'conf_utils.os.path.exists',
- return_value=False), \
- mock.patch('functest.opnfv_tests.openstack.tempest.'
- 'conf_utils.os.makedirs') as mock_makedirs, \
- mock.patch('functest.opnfv_tests.openstack.tempest.'
- 'conf_utils.shutil.copyfile') as mock_copyfile:
- conf_utils.backup_tempest_config(
- 'test_conf_file', res_dir='test_dir')
- self.assertTrue(mock_makedirs.called)
- self.assertTrue(mock_copyfile.called)
-
- with mock.patch('functest.opnfv_tests.openstack.tempest.'
- 'conf_utils.os.path.exists',
- return_value=True), \
- mock.patch('functest.opnfv_tests.openstack.tempest.'
- 'conf_utils.shutil.copyfile') as mock_copyfile:
- conf_utils.backup_tempest_config(
- 'test_conf_file', res_dir='test_dir')
- self.assertTrue(mock_copyfile.called)
-
def _test_missing_param(self, params, image_id, flavor_id):
with mock.patch('functest.opnfv_tests.openstack.tempest.'
'conf_utils.ConfigParser.RawConfigParser.'
@@ -221,13 +199,11 @@ class OSTempestConfUtilsTesting(unittest.TestCase):
'conf_utils.ConfigParser.RawConfigParser.'
'write') as mwrite, \
mock.patch('__builtin__.open', mock.mock_open()), \
- mock.patch('functest.opnfv_tests.openstack.tempest.'
- 'conf_utils.backup_tempest_config'), \
mock.patch('functest.utils.functest_utils.yaml.safe_load',
return_value={'validation': {'ssh_timeout': 300}}):
os.environ['OS_ENDPOINT_TYPE'] = ''
conf_utils.configure_tempest_update_params(
- 'test_conf_file', res_dir='test_dir', image_id=image_id,
+ 'test_conf_file', image_id=image_id,
flavor_id=flavor_id)
mset.assert_any_call(params[0], params[1], params[2])
self.assertTrue(mread.called)