diff options
author | 2018-04-12 20:58:01 +0200 | |
---|---|---|
committer | 2018-04-12 21:08:52 +0200 | |
commit | 0acaa90002c7b9b19eb12db7a515ee3dce2a0243 (patch) | |
tree | 489908cf54191c8ca715c1bbc4dd56267484625c /functest/tests/unit/openstack/tempest/test_tempest.py | |
parent | 6834c086671ad9cef79eb962ea8031235ac81334 (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>
(cherry picked from commit 71c4b3b719289929c226cae60eb1b23ada16eeb2)
Diffstat (limited to 'functest/tests/unit/openstack/tempest/test_tempest.py')
-rw-r--r-- | functest/tests/unit/openstack/tempest/test_tempest.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/functest/tests/unit/openstack/tempest/test_tempest.py b/functest/tests/unit/openstack/tempest/test_tempest.py index e2c4c975b..1fea4e41d 100644 --- a/functest/tests/unit/openstack/tempest/test_tempest.py +++ b/functest/tests/unit/openstack/tempest/test_tempest.py @@ -20,6 +20,7 @@ from functest.opnfv_tests.openstack.tempest import conf_utils class OSTempestTesting(unittest.TestCase): + # pylint: disable=too-many-public-methods def setUp(self): os_creds = OSCreds( @@ -101,6 +102,21 @@ class OSTempestTesting(unittest.TestCase): with self.assertRaises(Exception): self.tempestcommon.parse_verifier_result() + def test_backup_config_default(self): + with mock.patch('os.path.exists', return_value=False), \ + mock.patch('os.makedirs') as mock_makedirs, \ + mock.patch('shutil.copyfile') as mock_copyfile: + self.tempestcommon.backup_tempest_config( + 'test_conf_file', res_dir='test_dir') + self.assertTrue(mock_makedirs.called) + self.assertTrue(mock_copyfile.called) + + with mock.patch('os.path.exists', return_value=True), \ + mock.patch('shutil.copyfile') as mock_copyfile: + self.tempestcommon.backup_tempest_config( + 'test_conf_file', res_dir='test_dir') + self.assertTrue(mock_copyfile.called) + @mock.patch("os.rename") @mock.patch("os.remove") @mock.patch("os.path.exists", return_value=True) |