'Creates and deletes a volume.'

def test_create_and_delete_volume(self):

    created_volume = self.api.post_volume({'volume': {'size': 1}})
    self.assertTrue(uuidutils.is_uuid_like(created_volume['id']))
    created_volume_id = created_volume['id']
    found_volume = self.api.get_volume(created_volume_id)
    self.assertEqual(created_volume_id, found_volume['id'])
    self.assertEqual(self._vol_type_name, found_volume['volume_type'])
    volumes = self.api.get_volumes()
    volume_names = [volume['id'] for volume in volumes]
    self.assertIn(created_volume_id, volume_names)
    found_volume = self._poll_volume_while(created_volume_id, ['creating'])
    self.assertEqual('available', found_volume['status'])
    self.api.delete_volume(created_volume_id)
    found_volume = self._poll_volume_while(created_volume_id, ['deleting'])
    self.assertFalse(found_volume)
