diff options
author | Juha Kosonen <juha.kosonen@nokia.com> | 2018-08-14 16:00:58 +0300 |
---|---|---|
committer | Juha Kosonen <juha.kosonen@nokia.com> | 2018-08-14 16:35:53 +0300 |
commit | 4b7d89de42fe9a3867b12ea39721ad92aff96340 (patch) | |
tree | 18ed8582b287df71a341bd1aaf045dad41728fca /functest/tests/unit | |
parent | 8d3eb364d84f90b19f9e7234d01add8764843081 (diff) |
Create new project/user for rally test
FUNCTEST-1002
Change-Id: Id19b9aa70aeded6d99978084b3de4a63e31a81ad
Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
Diffstat (limited to 'functest/tests/unit')
-rw-r--r-- | functest/tests/unit/openstack/rally/test_rally.py | 12 | ||||
-rw-r--r-- | functest/tests/unit/openstack/tempest/test_conf_utils.py | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py index 1a43e561d..b1dee91cb 100644 --- a/functest/tests/unit/openstack/rally/test_rally.py +++ b/functest/tests/unit/openstack/rally/test_rally.py @@ -23,13 +23,16 @@ class OSRallyTesting(unittest.TestCase): # pylint: disable=too-many-public-methods def setUp(self): with mock.patch('os_client_config.get_config') as mock_get_config, \ - mock.patch('shade.OpenStackCloud') as mock_shade: + mock.patch('shade.OpenStackCloud') as mock_shade, \ + mock.patch('functest.core.tenantnetwork.NewProject') \ + as mock_new_project: self.rally_base = rally.RallyBase() self.rally_base.image = munch.Munch(name='foo') self.rally_base.flavor = munch.Munch(name='foo') self.rally_base.flavor_alt = munch.Munch(name='bar') self.assertTrue(mock_get_config.called) self.assertTrue(mock_shade.called) + self.assertTrue(mock_new_project.called) def test_build_task_args_missing_floating_network(self): os.environ['OS_AUTH_URL'] = '' @@ -281,16 +284,13 @@ class OSRallyTesting(unittest.TestCase): self.rally_base.test_name = 'test1' with mock.patch.object(self.rally_base.cloud, 'list_hypervisors') as mock_list_hyperv, \ - mock.patch.object(self.rally_base.cloud, - 'set_flavor_specs') as mock_set_flavor_specs, \ - mock.patch.object(self.rally_base.cloud, 'create_flavor', + mock.patch.object(self.rally_base, 'create_flavor_alt', side_effect=Exception) \ as mock_create_flavor: with self.assertRaises(Exception): self.rally_base._prepare_env() mock_list_hyperv.assert_called_once() mock_create_flavor.assert_called_once() - mock_set_flavor_specs.assert_not_called() @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.' '_run_task') @@ -310,7 +310,7 @@ class OSRallyTesting(unittest.TestCase): mock_run_task.assert_any_call('test1') def test_clean_up_default(self): - with mock.patch.object(self.rally_base.cloud, + with mock.patch.object(self.rally_base.orig_cloud, 'delete_flavor') as mock_delete_flavor: self.rally_base.flavor_alt = mock.Mock() self.rally_base.clean() diff --git a/functest/tests/unit/openstack/tempest/test_conf_utils.py b/functest/tests/unit/openstack/tempest/test_conf_utils.py index 1585cac09..81febd8c0 100644 --- a/functest/tests/unit/openstack/tempest/test_conf_utils.py +++ b/functest/tests/unit/openstack/tempest/test_conf_utils.py @@ -27,7 +27,8 @@ class OSTempestConfUtilsTesting(unittest.TestCase): mock.call(['rally', 'deployment', 'destroy', '--deployment', str(getattr(config.CONF, 'rally_deployment_name'))]), mock.call(['rally', 'deployment', 'create', '--fromenv', '--name', - str(getattr(config.CONF, 'rally_deployment_name'))]), + str(getattr(config.CONF, 'rally_deployment_name'))], + env=None), mock.call(['rally', 'deployment', 'check'])] mock_exec.assert_has_calls(calls) |