'If there are volumes in the ``LoopbackBlockDeviceAPI``\ \'s "attached"
directory that do not have a corresponding loopback device, one is
created for them.'

def test_stale_attachments(self):

    this_node = self.api.compute_instance_id()
    volume = self.api.create_volume(dataset_id=uuid4(), size=self.minimum_allocatable_size)
    unattached = self.api._root_path.descendant(['unattached', _backing_file_name(volume)])
    attached = self.api._root_path.descendant(['attached', this_node.encode('utf-8'), _backing_file_name(volume)])
    attached.parent().makedirs()
    unattached.moveTo(attached)
    self.assertNotEqual(None, self.api.get_device_path(volume.blockdevice_id))
