ensure-consumer gabbi test uses invalid consumer id

Bug #1780238 reported by Balazs Gibizer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Balazs Gibizer

Bug Description

The consumer_id is stored in an UUIDField internally and as a String(36) in the database. But in the ensure-consumer gabbi test '*consumer_id' is used as a consumer_id[1]. It seems gabbi does not resolve the yaml ref in the URL but resolves it in the payload part as [2] seems to work.

There are two problems:
1) the consumer_id field of PUT: /allocations/{consumer_id} is not validated so the API allows passing in '*consumer_id' as a string
2) the test passes in a non UUID value for the consumer_id

[1]https://github.com/openstack/nova/blob/187f80a32c8b5cdfc115e9b90f4818f3d9d1f8fe/nova/tests/functional/api/openstack/placement/gabbits/ensure-consumer.yaml#L19
https://github.com/openstack/nova/blob/187f80a32c8b5cdfc115e9b90f4818f3d9d1f8fe/nova/tests/functional/api/openstack/placement/gabbits/ensure-consumer.yaml#L41[2]

Tags: placement
Changed in nova:
assignee: nobody → Balazs Gibizer (balazs-gibizer)
tags: added: placement
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/580357

Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/580373

Changed in nova:
status: New → In Progress
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.openstack.org/580357
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9012a09328077c5aca1992ff331b2011a095315a
Submitter: Zuul
Branch: master

commit 9012a09328077c5aca1992ff331b2011a095315a
Author: Balazs Gibizer <email address hidden>
Date: Thu Jul 5 14:00:34 2018 +0200

    Use valid UUID in the placement gabbits

    It seems gabbi does not resolve yaml refs in the URL part of a REST
    call. This causes that the tests in ensure-consumer.yaml uses invalid
    consumer id '*consumer_id'

    This patches replace the *consumer_id with a fixture ref that works.

    Change-Id: I0576f282b1801340db6827fb4c9520a0d48ad7f0
    Related-Bug: #1780238

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/580373
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=928746a7bbab829539e532119822e44a932adad8
Submitter: Zuul
Branch: master

commit 928746a7bbab829539e532119822e44a932adad8
Author: Balazs Gibizer <email address hidden>
Date: Thu Jul 5 14:55:43 2018 +0200

    Add UUID validation for consumer_uuid

    When an allocation is created with PUT /allocations/{consumer_uuid} the
    consumer_uuid is not validated as UUID in the API and the DB schema only
    checks that is fits into String(36). However the Consumer object stores
    this value in a UUIDField oslo only raises a warning today.

    This patch adds a UUID validation for that URL path.

    Change-Id: Idedd85ca9266f10ce09231c34cab7ca43029a56c
    Closes-Bug: #1780238

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 18.0.0.0b3

This issue was fixed in the openstack/nova 18.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.