def test__query_raid_config_fgi_status_without_node(self, report_mock): mock_manager = mock.Mock() node_list = [] mock_manager.iter_nodes.return_value = node_list raid_object = irmc_raid.IRMCRAID() raid_object._query_raid_config_fgi_status(mock_manager, None) self.assertEqual(0, report_mock.call_count)
def test_fail_create_raid_without_target_raid_config(self): with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: task.node.target_raid_config = {} raid_configuration = raid.IRMCRAID() self.assertRaises(exception.MissingParameterValue, raid_configuration.create_configuration, task)
def test__query_raid_config_fgi_status_without_raid_object( self, mock_acquire, report_mock): mock_manager = mock.Mock() raid_config = self.raid_config task = mock.Mock(node=self.node, driver=self.driver) mock_acquire.return_value = mock.MagicMock(__enter__=mock.MagicMock( return_value=task)) node_list = [(self.node.uuid, 'irmc', '', raid_config)] mock_manager.iter_nodes.return_value = node_list task.driver.raid = noop.NoRAID() raid_object = irmc_raid.IRMCRAID() raid_object._query_raid_config_fgi_status(mock_manager, self.context) self.assertEqual(0, report_mock.call_count)
def setUp(self): super(iRMCPeriodicTaskTestCase, self).setUp() self.node_2 = obj_utils.create_test_node( self.context, driver='fake-hardware', uuid=uuidutils.generate_uuid()) self.driver = mock.Mock(raid=irmc_raid.IRMCRAID()) self.raid_config = { 'logical_disks': [{ 'controller': 'RAIDAdapter0' }, { 'irmc_raid_info': { ' size': { '#text': 465, '@Unit': 'GB' }, 'logical_drive_number': 0, 'name': 'LogicalDrive_0', 'raid_level': '1' } }] } self.target_raid_config = {'logical_disks': [{'key': 'value'}]}