'Confirm post_live_migration() works correctly as expected
for non shared storage migration.'

@mock.patch.object(fake.FakeDriver, 'unfilter_instance')
@mock.patch.object(compute_rpcapi.ComputeAPI, 'post_live_migration_at_destination')
@mock.patch.object(compute_manager.InstanceEvents, 'clear_events_for_instance')
def test_post_live_migration_no_shared_storage_working_correctly(self, mock_clear, mock_post, mock_unfilter):

    result = {}
    def fakecleanup(*args, **kwargs):
        result['cleanup'] = True
    self.stub_out('nova.virt.fake.FakeDriver.cleanup', fakecleanup)
    dest = 'desthost'
    srchost = self.compute.host
    c = context.get_admin_context()
    instance = self._create_fake_instance_obj({'host': srchost, 'state_description': 'migrating', 'state': power_state.PAUSED, 'task_state': task_states.MIGRATING, 'power_state': power_state.PAUSED})
    migration = {'source_compute': srchost, 'dest_compute': dest}
    migrate_data = objects.LibvirtLiveMigrateData(is_shared_instance_path=False, is_shared_block_storage=False, block_migration=False)
    with test.nested(mock.patch.object(self.compute.network_api, 'migrate_instance_start'), mock.patch.object(self.compute.network_api, 'setup_networks_on_host')) as (mock_migrate, mock_setup):
        self.compute._post_live_migration(c, instance, dest, migrate_data=migrate_data)
    self.assertIn('cleanup', result)
    self.assertTrue(result['cleanup'])
    mock_unfilter.assert_called_once_with(instance, [])
    mock_migrate.assert_called_once_with(c, instance, migration)
    mock_post.assert_called_once_with(c, instance, False, dest)
    mock_clear.assert_called_once_with(mock.ANY)
