'``metadata`` supplied when creating a volume is included when that
volume is subsequently listed.'

def test_create_metadata_is_listed(self):

    expected_metadata = {random_name(self): 'bar'}
    new_volume = self.cinder_volumes.create(size=int(Byte(get_minimum_allocatable_size()).to_GiB().value), metadata=expected_metadata)
    CINDER_VOLUME(id=new_volume.id).write()
    self.addCleanup(self.cinder_volumes.delete, new_volume)
    listed_volume = wait_for_volume_state(volume_manager=self.cinder_volumes, expected_volume=new_volume, desired_state=u'available', transient_states=(u'creating',))
    expected_items = set(expected_metadata.items())
    actual_items = set(listed_volume.metadata.items())
    missing_items = (expected_items - actual_items)
    self.assertEqual(set(), missing_items, 'Metadata    {!r}    does    not    contain    the    expected    items    {!r}'.format(actual_items, expected_items))
