Add fixtures instead mock
Add fixtures to replace mocks of deployment workflow inside overcloud deployment tests Partial-Bug: 1619350 Change-Id: I620fa04af281a02600da4b6d059e9830a9dcdd7c
This commit is contained in:
parent
3f7d4946a4
commit
11d2981404
0
tripleoclient/tests/fixture_data/__init__.py
Normal file
0
tripleoclient/tests/fixture_data/__init__.py
Normal file
34
tripleoclient/tests/fixture_data/deployment.py
Normal file
34
tripleoclient/tests/fixture_data/deployment.py
Normal file
@ -0,0 +1,34 @@
|
||||
# Copyright 2018 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
import fixtures
|
||||
|
||||
|
||||
class DeploymentWorkflowFixture(fixtures.Fixture):
|
||||
|
||||
def _setUp(self):
|
||||
super(DeploymentWorkflowFixture, self)._setUp()
|
||||
self.mock_get_overcloud_hosts = self.useFixture(fixtures.MockPatch(
|
||||
'tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
).mock
|
||||
self.mock_enable_ssh_admin = self.useFixture(fixtures.MockPatch(
|
||||
'tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
).mock
|
||||
self.mock_config_download = self.useFixture(fixtures.MockPatch(
|
||||
'tripleoclient.workflows.deployment.config_download')
|
||||
).mock
|
||||
self.mock_get_horizon_url = self.useFixture(fixtures.MockPatch(
|
||||
'tripleoclient.workflows.deployment.get_horizon_url')
|
||||
).mock
|
@ -28,6 +28,7 @@ from swiftclient.exceptions import ClientException as ObjectClientException
|
||||
|
||||
from tripleoclient import constants
|
||||
from tripleoclient import exceptions
|
||||
from tripleoclient.tests.fixture_data import deployment
|
||||
from tripleoclient.tests.v1.overcloud_deploy import fakes
|
||||
from tripleoclient.v1 import overcloud_deploy
|
||||
|
||||
@ -92,14 +93,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
self.cmd._download_missing_files_from_plan = self.real_download_missing
|
||||
shutil.rmtree = self.real_shutil
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch(
|
||||
'tripleoclient.workflows.plan_management.list_deployment_plans',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.plan_management.tarball',
|
||||
autospec=True)
|
||||
@mock.patch("heatclient.common.event_utils.get_events")
|
||||
@ -126,11 +122,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_create_parameters_env,
|
||||
mock_breakpoints_cleanupm,
|
||||
mock_events, mock_tarball,
|
||||
mock_get_horizon_url,
|
||||
mock_list_plans,
|
||||
mock_config_download,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_list_plans):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
arglist = ['--templates', '--ceph-storage-scale', '3']
|
||||
verifylist = [
|
||||
('templates', '/usr/share/openstack-tripleo-heat-templates/'),
|
||||
@ -200,14 +194,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
|
||||
mock_create_tempest_deployer_input.assert_called_with()
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch(
|
||||
'tripleoclient.workflows.plan_management.list_deployment_plans',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.parameters.invoke_plan_env_workflows',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.utils.get_overcloud_endpoint', autospec=True)
|
||||
@ -238,12 +227,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_breakpoints_cleanup, mock_tarball,
|
||||
mock_postconfig, mock_get_overcloud_endpoint,
|
||||
mock_invoke_plan_env_wf,
|
||||
mock_get_horizon_url,
|
||||
mock_list_plans,
|
||||
mock_config_download,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
|
||||
mock_list_plans):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
arglist = ['--templates', '--ceph-storage-scale', '3',
|
||||
'--control-flavor', 'oooq_control', '--no-cleanup']
|
||||
verifylist = [
|
||||
@ -337,16 +323,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
self.assertEqual(env_map.get('parameter_defaults'),
|
||||
parameters_env.get('parameter_defaults'))
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch(
|
||||
'tripleoclient.workflows.plan_management.list_deployment_plans',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.parameters.invoke_plan_env_workflows',
|
||||
autospec=True)
|
||||
@mock.patch('shutil.rmtree', autospec=True)
|
||||
@mock.patch('tripleoclient.utils.get_overcloud_endpoint', autospec=True)
|
||||
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.'
|
||||
@ -377,12 +356,11 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_create_tempest_deployer, mock_create_parameters_env,
|
||||
mock_validate_args,
|
||||
mock_breakpoints_cleanup,
|
||||
mock_tarball, mock_postconfig,
|
||||
mock_get_overcloud_endpoint, mock_shutil_rmtree,
|
||||
mock_invoke_plan_env_wf, mock_get_horizon_url,
|
||||
mock_list_plans, mock_config_download,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_tarball, mock_postconfig, mock_shutil_rmtree,
|
||||
mock_invoke_plan_env_wf,
|
||||
mock_list_plans):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
|
||||
arglist = ['--templates', '-p', 'the-plan-environment.yaml']
|
||||
verifylist = [
|
||||
@ -481,14 +459,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
clients.tripleoclient.object_store.put_object.assert_called()
|
||||
self.assertTrue(mock_invoke_plan_env_wf.called)
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch(
|
||||
'tripleoclient.workflows.plan_management.list_deployment_plans',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.parameters.'
|
||||
'check_deprecated_parameters', autospec=True)
|
||||
@mock.patch('tripleoclient.utils.get_overcloud_endpoint', autospec=True)
|
||||
@ -522,10 +495,10 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_create_parameters_env, mock_validate_args,
|
||||
mock_breakpoints_cleanup, mock_tarball,
|
||||
mock_postconfig, mock_get_overcloud_endpoint,
|
||||
mock_deprecated_params, mock_get_horizon_url,
|
||||
mock_list_plans, mock_config_downlad,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_deprecated_params,
|
||||
mock_list_plans):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
|
||||
arglist = ['--templates', '--skip-deploy-identifier']
|
||||
verifylist = [
|
||||
@ -583,14 +556,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
deploy_plan_call_input = deploy_plan_call[1]['workflow_input']
|
||||
self.assertTrue(deploy_plan_call_input['skip_deploy_identifier'])
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch(
|
||||
'tripleoclient.workflows.plan_management.list_deployment_plans',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.plan_management.tarball',
|
||||
autospec=True)
|
||||
@mock.patch("heatclient.common.event_utils.get_events", autospec=True)
|
||||
@ -614,11 +582,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_deploy_postconfig,
|
||||
mock_breakpoints_cleanup,
|
||||
mock_events, mock_tarball,
|
||||
mock_get_horizon_url,
|
||||
mock_list_plans,
|
||||
mock_config_download,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_list_plans):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
|
||||
arglist = ['--templates', '/home/stack/tripleo-heat-templates']
|
||||
verifylist = [
|
||||
@ -703,14 +669,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
self.cmd.take_action, parsed_args)
|
||||
self.assertFalse(mock_deploy_tht.called)
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch(
|
||||
'tripleoclient.workflows.plan_management.list_deployment_plans',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.plan_management.tarball',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.utils.create_tempest_deployer_input',
|
||||
@ -727,10 +688,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_update_parameters, mock_post_config,
|
||||
mock_utils_endpoint, mock_utils_createrc,
|
||||
mock_utils_tempest, mock_tarball,
|
||||
mock_get_horizon_url, mock_list_plans,
|
||||
mock_config_download,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_list_plans):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
|
||||
clients = self.app.client_manager
|
||||
mock_list_plans.return_value = []
|
||||
@ -945,11 +905,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
parsed_args)
|
||||
self.assertIn('/tmp/notthere', str(error))
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.utils.create_tempest_deployer_input',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.utils.write_overcloudrc', autospec=True)
|
||||
@ -959,11 +914,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
def test_rhel_reg_params_provided(self, mock_deploy_tht,
|
||||
mock_oc_endpoint,
|
||||
mock_create_ocrc,
|
||||
mock_create_tempest_deployer_input,
|
||||
mock_get_horizon_url,
|
||||
mock_config_download,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_create_tempest_deployer_input):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
|
||||
clients = self.app.client_manager
|
||||
workflow_client = clients.workflow_engine
|
||||
@ -990,14 +943,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
|
||||
mock_create_tempest_deployer_input.assert_called_with()
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch(
|
||||
'tripleoclient.workflows.plan_management.list_deployment_plans',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.plan_management.tarball',
|
||||
autospec=True)
|
||||
@mock.patch("heatclient.common.event_utils.get_events", autospec=True)
|
||||
@ -1025,11 +973,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_deploy_postconfig,
|
||||
mock_breakpoints_cleanup,
|
||||
mock_events, mock_tarball,
|
||||
mock_get_horizon_url,
|
||||
mock_list_plans,
|
||||
mock_config_download,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_list_plans):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
|
||||
arglist = ['--templates', '--rhel-reg',
|
||||
'--reg-sat-url', 'https://example.com',
|
||||
@ -1239,14 +1185,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
self.assertFalse(mock_create_ocrc.called)
|
||||
self.assertFalse(mock_create_tempest_deployer_input.called)
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch(
|
||||
'tripleoclient.workflows.plan_management.list_deployment_plans',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.plan_management.tarball',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.utils.create_tempest_deployer_input',
|
||||
@ -1262,11 +1203,10 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_oc_endpoint,
|
||||
mock_create_ocrc,
|
||||
mock_create_tempest_deployer_input,
|
||||
mock_tarball, mock_get_horizon_url,
|
||||
mock_list_plans,
|
||||
mock_config_download,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_tarball,
|
||||
mock_list_plans):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
clients = self.app.client_manager
|
||||
|
||||
mock_list_plans.return_value = []
|
||||
@ -1424,14 +1364,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
self.cmd.take_action,
|
||||
parsed_args)
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch(
|
||||
'tripleoclient.workflows.plan_management.list_deployment_plans',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.'
|
||||
'_deploy_postconfig', autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.plan_management.tarball',
|
||||
@ -1462,11 +1397,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
mock_breakpoints_cleanup,
|
||||
mock_tarball,
|
||||
mock_deploy_post_config,
|
||||
mock_get_horizon_url,
|
||||
mock_list_plans,
|
||||
mock_config_download,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_list_plans):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
|
||||
arglist = ['--templates', '--ceph-storage-scale', '3',
|
||||
'--control-scale', '3', '--ntp-server', 'ntp']
|
||||
@ -1616,11 +1549,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
self.assertRaises(exceptions.StackInProgress,
|
||||
self.cmd.take_action, parsed_args)
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.utils.create_tempest_deployer_input',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.utils.wait_for_provision_state')
|
||||
@ -1633,11 +1561,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
def test_deployed_server(self, mock_deploy_tmpdir, mock_overcloudrc,
|
||||
mock_write_overcloudrc,
|
||||
mock_get_overcloud_endpoint,
|
||||
mock_provision, mock_tempest_deploy_input,
|
||||
mock_get_horizon_url,
|
||||
mock_config_download,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_provision, mock_tempest_deploy_input):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
arglist = ['--templates', '--deployed-server', '--disable-validations']
|
||||
verifylist = [
|
||||
('templates', '/usr/share/openstack-tripleo-heat-templates/'),
|
||||
@ -1674,11 +1600,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
parsed_args)
|
||||
self.assertFalse(mock_deploy_tmpdir.called)
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch('tripleoclient.utils.create_tempest_deployer_input',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.utils.get_overcloud_endpoint', autospec=True)
|
||||
@ -1691,10 +1612,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
self, mock_deploy_tmpdir,
|
||||
mock_overcloudrc, mock_write_overcloudrc,
|
||||
mock_overcloud_endpoint,
|
||||
mock_create_tempest_deployer_input,
|
||||
mock_config_download, mock_get_horizon_url,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_create_tempest_deployer_input):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
clients = self.app.client_manager
|
||||
orchestration_client = clients.orchestration
|
||||
orchestration_client.stacks.get.return_value = mock.Mock()
|
||||
@ -1708,15 +1628,10 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
self.assertTrue(mock_deploy_tmpdir.called)
|
||||
self.assertTrue(mock_enable_ssh_admin.called)
|
||||
self.assertTrue(mock_get_overcloud_hosts.called)
|
||||
self.assertTrue(mock_config_download.called)
|
||||
self.assertTrue(fixture.mock_enable_ssh_admin.called)
|
||||
self.assertTrue(fixture.mock_get_overcloud_hosts.called)
|
||||
self.assertTrue(fixture.mock_config_download.called)
|
||||
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_overcloud_hosts')
|
||||
@mock.patch('tripleoclient.workflows.deployment.enable_ssh_admin')
|
||||
@mock.patch('tripleoclient.workflows.deployment.get_horizon_url',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.workflows.deployment.config_download')
|
||||
@mock.patch('tripleoclient.utils.create_tempest_deployer_input',
|
||||
autospec=True)
|
||||
@mock.patch('tripleoclient.utils.get_overcloud_endpoint', autospec=True)
|
||||
@ -1729,10 +1644,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
self, mock_deploy_tmpdir,
|
||||
mock_overcloudrc, mock_write_overcloudrc,
|
||||
mock_overcloud_endpoint,
|
||||
mock_create_tempest_deployer_input,
|
||||
mock_config_download, mock_get_horizon_url,
|
||||
mock_enable_ssh_admin,
|
||||
mock_get_overcloud_hosts):
|
||||
mock_create_tempest_deployer_input):
|
||||
fixture = deployment.DeploymentWorkflowFixture()
|
||||
self.useFixture(fixture)
|
||||
clients = self.app.client_manager
|
||||
orchestration_client = clients.orchestration
|
||||
orchestration_client.stacks.get.return_value = mock.Mock()
|
||||
@ -1746,9 +1660,9 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
||||
|
||||
self.cmd.take_action(parsed_args)
|
||||
self.assertFalse(mock_deploy_tmpdir.called)
|
||||
self.assertTrue(mock_enable_ssh_admin.called)
|
||||
self.assertTrue(mock_get_overcloud_hosts.called)
|
||||
self.assertTrue(mock_config_download.called)
|
||||
self.assertTrue(fixture.mock_enable_ssh_admin.called)
|
||||
self.assertTrue(fixture.mock_get_overcloud_hosts.called)
|
||||
self.assertTrue(fixture.mock_config_download.called)
|
||||
|
||||
def test_download_missing_files_from_plan(self):
|
||||
# Restore the real function so we don't accidentally call the mock
|
||||
|
Loading…
Reference in New Issue
Block a user