'migrate volume and try pool in opposite rank.'

@mock.patch.object(helper.DS8KCommonHelper, 'get_flashcopy')
@mock.patch.object(eventlet, 'sleep')
def test_migrate_and_try_pools_in_opposite_rank(self, mock_sleep, mock_get_flashcopy):

    self.driver = FakeDS8KProxy(self.storage_info, self.logger, self.exception, self)
    self.driver.setup(self.ctxt)
    self.driver._update_stats()
    vol_type = volume_types.create(self.ctxt, 'VOL_TYPE', {})
    location = six.text_type({'vol_hex_id': TEST_VOLUME_ID})
    volume = self._create_volume(volume_type_id=vol_type.id, provider_location=location)
    backend = {'host': 'host@backend#pool_id', 'capabilities': {'extent_pools': TEST_POOL_ID_2, 'serial_number': TEST_SOURCE_SYSTEM_UNIT, 'vendor_name': 'IBM', 'storage_protocol': 'fibre_channel'}}
    mock_get_flashcopy.side_effect = [[TEST_FLASHCOPY], {}]
    with mock.patch.object(helper.DS8KCommonHelper, '_get_pools') as get_pools:
        get_pools.return_value = FAKE_GET_POOL_RESPONSE_2['data']['pools']
        (moved, model_update) = self.driver.migrate_volume(self.ctxt, volume, backend)
        self.assertTrue(moved)
