tests: Add test for multiple blocks devices
The 'server create' command should support multiple '--block-device' parameters. Prove it. Change-Id: I1bd83287efdbbe11774053b694bae99b6a4ebdf5 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
parent
6cd72f6182
commit
e7bc68735f
@ -1445,6 +1445,7 @@ class TestServerCreate(TestServer):
|
|||||||
self.flavors_mock.get.return_value = self.flavor
|
self.flavors_mock.get.return_value = self.flavor
|
||||||
|
|
||||||
self.volume = volume_fakes.create_one_volume()
|
self.volume = volume_fakes.create_one_volume()
|
||||||
|
self.volume_alt = volume_fakes.create_one_volume()
|
||||||
self.volumes_mock.get.return_value = self.volume
|
self.volumes_mock.get.return_value = self.volume
|
||||||
|
|
||||||
self.snapshot = volume_fakes.create_one_snapshot()
|
self.snapshot = volume_fakes.create_one_snapshot()
|
||||||
@ -2563,11 +2564,13 @@ class TestServerCreate(TestServer):
|
|||||||
'key_name': None,
|
'key_name': None,
|
||||||
'availability_zone': None,
|
'availability_zone': None,
|
||||||
'admin_pass': None,
|
'admin_pass': None,
|
||||||
'block_device_mapping_v2': [{
|
'block_device_mapping_v2': [
|
||||||
'uuid': self.volume.id,
|
{
|
||||||
'source_type': 'volume',
|
'uuid': self.volume.id,
|
||||||
'destination_type': 'volume',
|
'source_type': 'volume',
|
||||||
}],
|
'destination_type': 'volume',
|
||||||
|
},
|
||||||
|
],
|
||||||
'nics': [],
|
'nics': [],
|
||||||
'scheduler_hints': {},
|
'scheduler_hints': {},
|
||||||
'config_drive': None,
|
'config_drive': None,
|
||||||
@ -2594,11 +2597,13 @@ class TestServerCreate(TestServer):
|
|||||||
f'volume_type=foo,boot_index=1,delete_on_termination=true,'
|
f'volume_type=foo,boot_index=1,delete_on_termination=true,'
|
||||||
f'tag=foo'
|
f'tag=foo'
|
||||||
)
|
)
|
||||||
|
block_device_alt = f'uuid={self.volume_alt.id},source_type=volume'
|
||||||
|
|
||||||
arglist = [
|
arglist = [
|
||||||
'--image', 'image1',
|
'--image', 'image1',
|
||||||
'--flavor', self.flavor.id,
|
'--flavor', self.flavor.id,
|
||||||
'--block-device', block_device,
|
'--block-device', block_device,
|
||||||
|
'--block-device', block_device_alt,
|
||||||
self.new_server.name,
|
self.new_server.name,
|
||||||
]
|
]
|
||||||
verifylist = [
|
verifylist = [
|
||||||
@ -2619,6 +2624,10 @@ class TestServerCreate(TestServer):
|
|||||||
'delete_on_termination': 'true',
|
'delete_on_termination': 'true',
|
||||||
'tag': 'foo',
|
'tag': 'foo',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'uuid': self.volume_alt.id,
|
||||||
|
'source_type': 'volume',
|
||||||
|
},
|
||||||
]),
|
]),
|
||||||
('server_name', self.new_server.name),
|
('server_name', self.new_server.name),
|
||||||
]
|
]
|
||||||
@ -2639,20 +2648,27 @@ class TestServerCreate(TestServer):
|
|||||||
'key_name': None,
|
'key_name': None,
|
||||||
'availability_zone': None,
|
'availability_zone': None,
|
||||||
'admin_pass': None,
|
'admin_pass': None,
|
||||||
'block_device_mapping_v2': [{
|
'block_device_mapping_v2': [
|
||||||
'uuid': self.volume.id,
|
{
|
||||||
'source_type': 'volume',
|
'uuid': self.volume.id,
|
||||||
'destination_type': 'volume',
|
'source_type': 'volume',
|
||||||
'disk_bus': 'ide',
|
'destination_type': 'volume',
|
||||||
'device_name': 'sdb',
|
'disk_bus': 'ide',
|
||||||
'volume_size': '64',
|
'device_name': 'sdb',
|
||||||
'guest_format': 'ext4',
|
'volume_size': '64',
|
||||||
'boot_index': 1,
|
'guest_format': 'ext4',
|
||||||
'device_type': 'disk',
|
'boot_index': 1,
|
||||||
'delete_on_termination': True,
|
'device_type': 'disk',
|
||||||
'tag': 'foo',
|
'delete_on_termination': True,
|
||||||
'volume_type': 'foo',
|
'tag': 'foo',
|
||||||
}],
|
'volume_type': 'foo',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'uuid': self.volume_alt.id,
|
||||||
|
'source_type': 'volume',
|
||||||
|
'destination_type': 'volume',
|
||||||
|
},
|
||||||
|
],
|
||||||
'nics': 'auto',
|
'nics': 'auto',
|
||||||
'scheduler_hints': {},
|
'scheduler_hints': {},
|
||||||
'config_drive': None,
|
'config_drive': None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user