def test_unmap_volume_vol_already_unmapped(self, mock_is_warning_message):
     mock_is_warning_message.return_value = False
     self.svc.client.svctask.rmvdiskhostmap.side_effect = [
         svc_errors.CommandExecutionError('CMMVC5842E')
     ]
     with self.assertRaises(array_errors.VolumeAlreadyUnmappedError):
         self.svc.unmap_volume("vol", "host")
 def test_unmap_volume_raise_unmapped_error(self, mock_is_warning_message):
     mock_is_warning_message.return_value = False
     self.svc.client.svctask.rmvdiskhostmap.side_effect = [
         svc_errors.CommandExecutionError('Failed')
     ]
     with self.assertRaises(array_errors.UnMappingError):
         self.svc.unmap_volume("vol", "host")
    def test_get_volume_mappings_on_volume_not_found(self):
        self.svc.client.svcinfo.lsvdiskhostmap.side_effect = [
            svc_errors.CommandExecutionError('Failed')
        ]

        with self.assertRaises(array_errors.VolumeNotFoundError):
            self.svc.get_volume_mappings('vol')
 def test_unmap_volume_host_not_found(self, mock_is_warning_message):
     mock_is_warning_message.return_value = False
     self.svc.client.svctask.rmvdiskhostmap.side_effect = [
         svc_errors.CommandExecutionError('CMMVC5754E')
     ]
     with self.assertRaises(array_errors.HostNotFoundError):
         self.svc.unmap_volume("vol", "host")
示例#5
0
 def test_map_volume_raise_mapping_error(
         self, mock_get_first_free_lun, mock_is_warning_message):
     mock_is_warning_message.return_value = False
     mock_get_first_free_lun.return_value = '4'
     self.svc.client.svctask.mkvdiskhostmap.side_effect = [
         svc_errors.CommandExecutionError('Failed')]
     with self.assertRaises(array_errors.MappingError):
         self.svc.map_volume("vol", "host")
示例#6
0
 def test_map_volume_vol_already_in_use(self, mock_get_first_free_lun,
                                        mock_is_warning_message):
     mock_is_warning_message.return_value = False
     mock_get_first_free_lun.return_value = '3'
     self.svc.client.svctask.mkvdiskhostmap.side_effect = [
         svc_errors.CommandExecutionError('CMMVC5878E')]
     with self.assertRaises(array_errors.LunAlreadyInUseError):
         self.svc.map_volume("vol", "host")
示例#7
0
 def test_map_volume_vol_not_found(self, mock_get_first_free_lun,
                                   mock_is_warning_message):
     mock_is_warning_message.return_value = False
     mock_get_first_free_lun.return_value = '1'
     self.svc.client.svctask.mkvdiskhostmap.side_effect = [
         svc_errors.CommandExecutionError('CMMVC5804E')]
     with self.assertRaises(array_errors.VolumeNotFoundError):
         self.svc.map_volume("vol", "host")
 def test_get_array_fc_wwns_failed(self):
     self.svc.client.svcinfo.lsfabric.side_effect = [
         svc_errors.CommandExecutionError('Failed')
     ]
     with self.assertRaises(svc_errors.CommandExecutionError):
         self.svc.get_array_fc_wwns('host')
 def test_get_first_free_lun_raises_host_not_found_error(self):
     self.svc.client.svcinfo.lshostvdiskmap.side_effect = [
         svc_errors.CommandExecutionError('Failed')
     ]
     with self.assertRaises(array_errors.HostNotFoundError):
         self.svc.get_first_free_lun('host')
示例#10
0
 def test_get_iscsi_targets_cmd_error_raise_no_targets_error(self):
     self.svc.client.svcinfo.lsportip.side_effect = [
         svc_errors.CommandExecutionError('Failed')]
     with self.assertRaises(array_errors.NoIscsiTargetsFoundError):
         self.svc.get_iscsi_targets_by_iqn()