Merge "Adding new test case for InforTrend driver"
This commit is contained in:
commit
a64a1bddb9
@ -1211,6 +1211,43 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCass):
|
||||
self.assertDictEqual(test_model_update, model_update)
|
||||
self.assertEqual(1, log_info.call_count)
|
||||
|
||||
@mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall',
|
||||
new=utils.ZeroIntervalLoopingCall)
|
||||
@mock.patch.object(common_cli.LOG, 'info')
|
||||
def test_create_volume_from_snapshot_with_different_size(self, log_info):
|
||||
|
||||
test_snapshot = self.cli_data.test_snapshot
|
||||
test_snapshot_id = self.cli_data.fake_snapshot_id[0]
|
||||
test_dst_volume = self.cli_data.test_dst_volume
|
||||
test_dst_volume['size'] = 10
|
||||
test_dst_volume_id = test_dst_volume['id'].replace('-', '')
|
||||
test_dst_part_id = self.cli_data.fake_partition_id[1]
|
||||
test_model_update = {
|
||||
'provider_location': 'partition_id^%s@system_id^%s' % (
|
||||
self.cli_data.fake_partition_id[1],
|
||||
int(self.cli_data.fake_system_id[0], 16))
|
||||
}
|
||||
mock_commands = {
|
||||
'ShowSnapshot':
|
||||
self.cli_data.get_test_show_snapshot_detail_filled_block(),
|
||||
'CreatePartition': SUCCEED,
|
||||
'ShowPartition': self.cli_data.get_test_show_partition(),
|
||||
'ShowDevice': self.cli_data.get_test_show_device(),
|
||||
'CreateReplica': SUCCEED,
|
||||
'ShowLV': self._mock_show_lv,
|
||||
'ShowReplica':
|
||||
self.cli_data.get_test_show_replica_detail_for_migrate(
|
||||
test_snapshot_id, test_dst_part_id, test_dst_volume_id),
|
||||
'DeleteReplica': SUCCEED,
|
||||
}
|
||||
self._driver_setup(mock_commands)
|
||||
|
||||
model_update = self.driver.create_volume_from_snapshot(
|
||||
test_dst_volume, test_snapshot)
|
||||
self.assertDictEqual(test_model_update, model_update)
|
||||
self.assertEqual(1, log_info.call_count)
|
||||
self.assertEqual(10, test_dst_volume['size'])
|
||||
|
||||
@mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall',
|
||||
new=utils.ZeroIntervalLoopingCall)
|
||||
@mock.patch.object(common_cli.LOG, 'info')
|
||||
|
Loading…
Reference in New Issue
Block a user