'After attaching the volume, if a new device path is discovered that\'s
not related to the path given by the ``device`` parameter in the
expected way, ``AttachedUnexpectedDevice`` is raised giving details
about the expected and received paths.'

@given(device=device_path)
def test_unexpected_device_discovered(self, device):

    unexpected_device = []
    blockdevices = _get_blockdevices()
    for wrong_device in blockdevices:
        if wrong_device.basename().endswith(device[(-1)]):
            continue
        if wrong_device.basename().startswith(('sd', 'xvd')):
            size = _get_device_size(wrong_device.basename())
            volume = self.volume.set('size', size)
            blockdevices.remove(wrong_device)
            unexpected_device.append(wrong_device)
            break
    else:
        raise self.skipTest('Could    not    find    a    suitable    device    to    use    as    a    bad    device.')
    exception = self.assertRaises(AttachedUnexpectedDevice, _attach_volume_and_wait_for_device, volume=volume, attach_to=self.compute_id, attach_volume=(lambda *a, **kw: None), detach_volume=(lambda *a, **kw: None), device=device, blockdevices=blockdevices)
    self.assertEqual(AttachedUnexpectedDevice(requested=FilePath(device), discovered=FilePath('/dev/').child(unexpected_device.pop().basename())), exception)
