|
|
|
@ -131,8 +131,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
@mock.patch('tripleoclient.utils.get_ctlplane_attrs', autospec=True, |
|
|
|
|
return_value={}) |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.utils.check_stack_network_matches_env_files') |
|
|
|
|
@mock.patch('tripleoclient.utils.check_ceph_fsid_matches_env_files') |
|
|
|
@ -251,8 +250,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
@mock.patch('tripleoclient.workflows.deployment.create_overcloudrc', |
|
|
|
|
autospec=True) |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.workflows.parameters.invoke_plan_env_workflows', |
|
|
|
|
autospec=True) |
|
|
|
@ -354,8 +352,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
'process_environment_and_files', autospec=True) |
|
|
|
|
@mock.patch('os.chdir') |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.utils.check_stack_network_matches_env_files') |
|
|
|
|
@mock.patch('tripleoclient.utils.check_ceph_fsid_matches_env_files') |
|
|
|
@ -442,8 +439,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
'process_environment_and_files', autospec=True) |
|
|
|
|
@mock.patch('tripleoclient.utils.check_nic_config_with_ansible') |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.utils.check_stack_network_matches_env_files') |
|
|
|
|
@mock.patch('tripleoclient.utils.check_ceph_fsid_matches_env_files') |
|
|
|
@ -717,8 +713,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
except ValueError as value_error: |
|
|
|
|
self.assertIn('/fake/path', str(value_error)) |
|
|
|
|
|
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'create_env_files', autospec=True) |
|
|
|
@ -757,8 +752,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
autospec=True, return_value={}) |
|
|
|
|
@mock.patch('tripleoclient.utils.check_nic_config_with_ansible') |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.utils.check_stack_network_matches_env_files') |
|
|
|
|
@mock.patch('tripleoclient.utils.check_ceph_fsid_matches_env_files') |
|
|
|
@ -866,8 +860,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
@mock.patch('tripleoclient.utils.get_ctlplane_attrs', autospec=True, |
|
|
|
|
return_value={}) |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.utils.check_stack_network_matches_env_files') |
|
|
|
|
@mock.patch('tripleoclient.utils.check_ceph_fsid_matches_env_files') |
|
|
|
@ -984,8 +977,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
|
|
|
|
|
@mock.patch('tripleoclient.utils.get_rc_params', autospec=True) |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'create_env_files', autospec=True) |
|
|
|
@ -1023,8 +1015,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
|
|
|
|
|
@mock.patch('tripleoclient.utils.get_rc_params', autospec=True) |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'create_env_files', autospec=True) |
|
|
|
@ -1064,8 +1055,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
|
|
|
|
|
@mock.patch('tripleoclient.utils.get_rc_params', autospec=True) |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'create_env_files', autospec=True) |
|
|
|
@ -1106,8 +1096,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
'create_env_files', autospec=True) |
|
|
|
|
@mock.patch('tripleoclient.utils.get_rc_params', autospec=True) |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'deploy_tripleo_heat_templates', autospec=True) |
|
|
|
@ -1148,8 +1137,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
'create_env_files', autospec=True) |
|
|
|
|
@mock.patch('tripleoclient.utils.get_rc_params', autospec=True) |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.utils.create_tempest_deployer_input', |
|
|
|
|
autospec=True) |
|
|
|
@ -1194,8 +1182,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
|
|
|
|
|
@mock.patch('tripleoclient.utils.get_rc_params', autospec=True) |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'create_env_files', autospec=True) |
|
|
|
@ -1248,8 +1235,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
@mock.patch('tripleoclient.utils.get_ctlplane_attrs', autospec=True, |
|
|
|
|
return_value={}) |
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_heat_deploy', autospec=True) |
|
|
|
@ -1317,8 +1303,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
@mock.patch('tripleoclient.utils.copy_clouds_yaml') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_update_parameters') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'_get_undercloud_host_entry', autospec=True, |
|
|
|
|
@mock.patch('tripleoclient.utils.get_undercloud_host_entry', autospec=True, |
|
|
|
|
return_value='192.168.0.1 uc.ctlplane.localhost uc.ctlplane') |
|
|
|
|
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.' |
|
|
|
|
'create_env_files', autospec=True) |
|
|
|
@ -1485,24 +1470,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|
|
|
|
verbosity=3, |
|
|
|
|
workdir=mock.ANY) |
|
|
|
|
|
|
|
|
|
@mock.patch('subprocess.Popen', autospec=True) |
|
|
|
|
def test__get_undercloud_host_entry(self, mock_popen): |
|
|
|
|
mock_process = mock.Mock() |
|
|
|
|
mock_hosts = { |
|
|
|
|
'fd12::1 uc.ctlplane.localdomain uc.ctlplane': |
|
|
|
|
'fd12::1 uc.ctlplane.localdomain uc.ctlplane', |
|
|
|
|
'fd12::1 uc.ctlplane.localdomain uc.ctlplane\n' |
|
|
|
|
'fd12::1 uc.ctlplane.localdomain uc.ctlplane': |
|
|
|
|
'fd12::1 uc.ctlplane.localdomain uc.ctlplane', |
|
|
|
|
'1.2.3.4 uc.ctlplane foo uc.ctlplane bar uc.ctlplane': |
|
|
|
|
'1.2.3.4 uc.ctlplane foo bar' |
|
|
|
|
} |
|
|
|
|
for value, expected in mock_hosts.items(): |
|
|
|
|
mock_process.communicate.return_value = (value, '') |
|
|
|
|
mock_process.returncode = 0 |
|
|
|
|
mock_popen.return_value = mock_process |
|
|
|
|
self.assertEqual(expected, self.cmd._get_undercloud_host_entry()) |
|
|
|
|
|
|
|
|
|
def test_check_limit_warning(self): |
|
|
|
|
mock_warning = mock.MagicMock() |
|
|
|
|
mock_log = mock.MagicMock() |
|
|
|
|