Implemented the changes for the review comments for PCQE-210 and PCQE-219

Change-Id: I3cec282edc17114cf974b31681186d3427233dc4
This commit is contained in:
Sourav Kumar Sanki 2018-08-08 16:30:23 +05:30
parent 76370c0410
commit f5b421bde7
3 changed files with 22 additions and 26 deletions

View File

@ -27,10 +27,7 @@ from cloudcafe.compute.common.exception_handler import ExceptionHandler
from cloudcafe.compute.common.clients.ping import PingClient
from cloudcafe.compute.common.exceptions import ServerUnreachable
from cloudcafe.objectstorage.composites import ObjectStorageComposite
#Added by SKS - 11-JUL-2018
from cloudcafe.blockstorage.volumes_api.common.config import VolumesAPIConfig
# AdditionEnd SKS
class ComputeFixture(BaseTestFixture):
@ -47,11 +44,7 @@ class ComputeFixture(BaseTestFixture):
cls.flavors_config = cls.compute.flavors.config
cls.images_config = cls.compute.images.config
cls.servers_config = cls.compute.servers.config
# Added by SKS 11-Jul-2018
cls.volumes_config = VolumesAPIConfig()
# AdditionEnd SKS
cls.compute_endpoint = ComputeEndpointConfig()
cls.marshalling = MarshallingConfig()
cls.config_drive_config = cls.compute.config_drive.config
@ -64,10 +57,7 @@ class ComputeFixture(BaseTestFixture):
cls.flavor_ref_alt = cls.flavors_config.secondary_flavor
cls.image_ref = cls.images_config.primary_image
cls.image_ref_alt = cls.images_config.secondary_image
# Added by SKS- 11-jul-2018
cls.bootable_volume_ref = cls.volumes_config.primary_bootable_volume
# AdditionEnd
cls.disk_path = cls.servers_config.instance_disk_path
cls.split_ephemeral_disk_enabled = \
@ -361,7 +351,7 @@ class ServerFromVolumeV2Fixture(BlockstorageIntegrationFixture):
the server domain object
@rtype: Request Response Object
"""
#Creating block device used for server creation
# Creating block device used for server creation
cls.block_device_matrix = [{
"boot_index": 0,
"uuid": cls.image_ref,

View File

@ -19,20 +19,26 @@ from cloudcafe.common.tools.datagen import rand_name
from cloudcafe.compute.common.exceptions import BadRequest
from cloudroast.compute.fixtures import ServerFromVolumeV1Fixture
class CreateVolumeV1ServerNegativeTest(ServerFromVolumeV1Fixture):
@tags(type='smoke', net='no')
def test_device_name_invalid(self):
"""Verify device type set to SSD throws bad request"""
def test_block_device_name_invalid(self):
"""
Verify device name in block device mapping set
to SSD throws bad request
"""
# Creating block device
# Attempted code for verification of VIRT-2837
self.block_data = self.server_behaviors.create_block_device_mapping_v1_virt2837(
device_name="SSD",
volume_id=self.bootable_volume_ref,
delete_on_termination=True)
# For verification of VIRT-2837
self.block_data = \
self.server_behaviors.create_block_device_mapping_v1_virt2837(
device_name="SSD",
volume_id=self.bootable_volume_ref,
delete_on_termination=True)
# Try Creating Instance from Volume V1
with self.assertRaises(BadRequest):
self.boot_from_volume_client.create_server_virt2837(
self.boot_from_volume_client.create_server_device_mapper_v1(
block_device_mapping_v1=self.block_data,
flavor_ref=self.flavors_config.primary_flavor,
name=rand_name("server"))
name=rand_name("server"))

View File

@ -98,12 +98,12 @@ class CreateVolumeServerNegativeTest(ServerFromVolumeV2Fixture):
"""Verify when destination type not provided throws bad request"""
# This is to verify VIRT-3099
# Creating block device with snapshot data inside
# Question: Will the existing logic support it if destination_type is omitted altogether?
# Question 2: uuid must be assigned a volume id or reference. How to provide that?
self.block_data = self.server_behaviors.create_block_device_mapping_v2_virt3099(
boot_index=0, uuid=self.bootable_volume_ref,
source_type='volume',
delete_on_termination=True)
self.block_data = \
self.server_behaviors.create_block_device_mapping_v2_virt3099(
boot_index=0, uuid=self.bootable_volume_ref,
source_type='volume',
delete_on_termination=True)
# Try Creating Instance from Volume V2
with self.assertRaises(BadRequest):
self.boot_from_volume_client.create_server(