'``AttachVolume.run`` attaches a volume to a host.'

@validate_logging(assertHasAction, ATTACH_VOLUME, True)
def test_run(self, logger):

    host = u'192.0.7.8'
    dataset_id = uuid4()
    deployer = create_blockdevicedeployer(self, hostname=host)
    api = deployer.block_device_api
    volume = api.create_volume(dataset_id=dataset_id, size=LOOPBACK_MINIMUM_ALLOCATABLE_SIZE)
    change = AttachVolume(dataset_id=dataset_id, blockdevice_id=volume.blockdevice_id)
    self.patch(blockdevice, '_logger', logger)
    self.successResultOf(run_state_change(change, deployer, InMemoryStatePersister()))
    expected_volume = volume.set(attached_to=api.compute_instance_id())
    self.assertEqual([expected_volume], api.list_volumes())
