コード例 #1
0
 def test_post_config(self, mock_post_config_mistral, mock_ensure_flavor,
                      mock_configure_ssh_keys, mock_get_auth_values,
                      mock_copy_stackrc, mock_delete, mock_mistral_client,
                      mock_nova_client):
     instack_env = {
         'UNDERCLOUD_ENDPOINT_MISTRAL_PUBLIC': 'http://192.0.2.1:8989/v2',
     }
     mock_get_auth_values.return_value = ('aturing', '3nigma', 'hut8',
                                          'http://bletchley:5000/v2.0')
     mock_instance = mock.Mock()
     mock_nova_client.return_value = mock_instance
     mock_instance_mistral = mock.Mock()
     mock_mistral_client.return_value = mock_instance_mistral
     undercloud._post_config(instack_env)
     mock_nova_client.assert_called_with(2, 'aturing', '3nigma', 'hut8',
                                         'http://bletchley:5000/v2.0')
     self.assertTrue(mock_copy_stackrc.called)
     mock_configure_ssh_keys.assert_called_with(mock_instance)
     calls = [mock.call(mock_instance, 'baremetal'),
              mock.call(mock_instance, 'control', 'control'),
              mock.call(mock_instance, 'compute', 'compute'),
              mock.call(mock_instance, 'ceph-storage', 'ceph-storage'),
              mock.call(mock_instance, 'block-storage', 'block-storage'),
              mock.call(mock_instance, 'swift-storage', 'swift-storage'),
              ]
     mock_ensure_flavor.assert_has_calls(calls)
     mock_post_config_mistral.assert_called_once_with(mock_instance_mistral)
コード例 #2
0
 def test_post_config(self, mock_post_config_mistral, mock_ensure_flavor,
                      mock_configure_ssh_keys, mock_get_auth_values,
                      mock_copy_stackrc, mock_delete, mock_mistral_client,
                      mock_nova_client):
     instack_env = {
         'UNDERCLOUD_ENDPOINT_MISTRAL_PUBLIC': 'http://192.0.2.1:8989/v2',
     }
     mock_get_auth_values.return_value = ('aturing', '3nigma', 'hut8',
                                          'http://bletchley:5000/v2.0')
     mock_instance = mock.Mock()
     mock_nova_client.return_value = mock_instance
     mock_instance_mistral = mock.Mock()
     mock_mistral_client.return_value = mock_instance_mistral
     undercloud._post_config(instack_env)
     mock_nova_client.assert_called_with(2, 'aturing', '3nigma', 'hut8',
                                         'http://bletchley:5000/v2.0')
     self.assertTrue(mock_copy_stackrc.called)
     mock_configure_ssh_keys.assert_called_with(mock_instance)
     calls = [
         mock.call(mock_instance, 'baremetal'),
         mock.call(mock_instance, 'control', 'control'),
         mock.call(mock_instance, 'compute', 'compute'),
         mock.call(mock_instance, 'ceph-storage', 'ceph-storage'),
         mock.call(mock_instance, 'block-storage', 'block-storage'),
         mock.call(mock_instance, 'swift-storage', 'swift-storage'),
     ]
     mock_ensure_flavor.assert_has_calls(calls)
     mock_post_config_mistral.assert_called_once_with(mock_instance_mistral)
コード例 #3
0
 def test_post_config(self, mock_ensure_flavor, mock_configure_ssh_keys,
                      mock_get_auth_values, mock_copy_stackrc, mock_delete,
                      mock_client):
     mock_get_auth_values.return_value = ('aturing', '3nigma', 'hut8',
                                          'http://bletchley:5000/v2.0')
     mock_instance = mock.Mock()
     mock_client.return_value = mock_instance
     undercloud._post_config()
     mock_client.assert_called_with(2, 'aturing', '3nigma', 'hut8',
                                    'http://bletchley:5000/v2.0')
     self.assertTrue(mock_copy_stackrc.called)
     mock_configure_ssh_keys.assert_called_with(mock_instance)
     calls = [mock.call(mock_instance, 'baremetal'),
              mock.call(mock_instance, 'control', 'control'),
              mock.call(mock_instance, 'compute', 'compute'),
              mock.call(mock_instance, 'ceph-storage', 'ceph-storage'),
              mock.call(mock_instance, 'block-storage', 'block-storage'),
              mock.call(mock_instance, 'swift-storage', 'swift-storage'),
              ]
     mock_ensure_flavor.assert_has_calls(calls)
コード例 #4
0
 def test_post_config(self, mock_ensure_flavor, mock_configure_ssh_keys,
                      mock_get_auth_values, mock_copy_stackrc, mock_delete,
                      mock_client):
     mock_get_auth_values.return_value = ('aturing', '3nigma', 'hut8',
                                          'http://bletchley:5000/v2.0')
     mock_instance = mock.Mock()
     mock_client.return_value = mock_instance
     undercloud._post_config()
     mock_client.assert_called_with(2, 'aturing', '3nigma', 'hut8',
                                    'http://bletchley:5000/v2.0')
     self.assertTrue(mock_copy_stackrc.called)
     mock_configure_ssh_keys.assert_called_with(mock_instance)
     calls = [
         mock.call(mock_instance, 'baremetal'),
         mock.call(mock_instance, 'control', 'control'),
         mock.call(mock_instance, 'compute', 'compute'),
         mock.call(mock_instance, 'ceph-storage', 'ceph-storage'),
         mock.call(mock_instance, 'block-storage', 'block-storage'),
         mock.call(mock_instance, 'swift-storage', 'swift-storage'),
     ]
     mock_ensure_flavor.assert_has_calls(calls)