From 40a756c7b3bb8e94ee4b008543181c2e4cb69627 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Thu, 2 Sep 2021 15:16:14 +0200 Subject: [PATCH] Reproduce 404 when allocation queried with 1.38 If an allocation is created with older than 1.38 then it is without consumer_type then querying that allocation with 1.38 results in HTTP 404 "No such consumer type: None." error. This patch reproduces the error in the functional test environment. Story: 2009167 Task: 43184 Change-Id: Ib65b79485780789463954aa7cc19ea7d1ed395a7 --- .../consumer-types-bug-story-2009167.yaml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 placement/tests/functional/gabbits/consumer-types-bug-story-2009167.yaml diff --git a/placement/tests/functional/gabbits/consumer-types-bug-story-2009167.yaml b/placement/tests/functional/gabbits/consumer-types-bug-story-2009167.yaml new file mode 100644 index 000000000..b7051ed73 --- /dev/null +++ b/placement/tests/functional/gabbits/consumer-types-bug-story-2009167.yaml @@ -0,0 +1,39 @@ +fixtures: + - AllocationFixture + +defaults: + request_headers: + x-auth-token: admin + accept: application/json + content-type: application/json + +tests: +- name: put an allocation with older than 1.38 so no consumer_type is provided + PUT: /allocations/44444444-4444-4444-4444-444444444444 + request_headers: + openstack-api-version: placement 1.37 + data: + allocations: + $ENVIRON['RP_UUID']: + resources: + DISK_GB: 10 + project_id: $ENVIRON['PROJECT_ID'] + user_id: $ENVIRON['USER_ID'] + consumer_generation: null + status: 204 + +- name: get allocation with 1.38 expected "unknown" consumer_type + GET: /allocations/44444444-4444-4444-4444-444444444444 + request_headers: + openstack-api-version: placement 1.38 + # FIXME(gibi): this is bug https://storyboard.openstack.org/#!/story/2009167 + # as placement returns error + status: 404 + response_strings: + - "No such consumer type: None." + # This should be returned instead + # response_json_paths: + # $.allocations.`len`: 1 + # $.allocations['$ENVIRON["RP_UUID"]'].resources.DISK_GB: 10 + # $.consumer_type: unknown + # status: 200