|
|
@@ -4529,6 +4529,22 @@ class _ComputeAPIUnitTestMixIn(object): |
|
|
|
bdms) |
|
|
|
mock_get_image.assert_called_once_with(self.context, image_id) |
|
|
|
|
|
|
|
@mock.patch('nova.compute.api.API._get_image') |
|
|
|
def test_validate_bdm_disk_bus(self, mock_get_image): |
|
|
|
"""Tests that _validate_bdm fail if an invalid disk_bus is provided |
|
|
|
""" |
|
|
|
instance = self._create_instance_obj() |
|
|
|
bdms = objects.BlockDeviceMappingList(objects=[ |
|
|
|
objects.BlockDeviceMapping( |
|
|
|
boot_index=0, image_id=instance.image_ref, |
|
|
|
source_type='image', destination_type='volume', |
|
|
|
volume_type=None, snapshot_id=None, volume_id=None, |
|
|
|
volume_size=1, disk_bus='virtio-scsi')]) |
|
|
|
self.assertRaises(exception.InvalidBDMDiskBus, |
|
|
|
self.compute_api._validate_bdm, |
|
|
|
self.context, instance, objects.Flavor(), |
|
|
|
bdms) |
|
|
|
|
|
|
|
@mock.patch.object(objects.service, 'get_minimum_version_all_cells', |
|
|
|
return_value=compute_api.MIN_COMPUTE_VOLUME_TYPE) |
|
|
|
def test_the_specified_volume_type_id_assignment_to_name( |
|
|
|