From a57215e8b69ab3d9995151ff0b54d84b9eb5b7d8 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Mon, 7 Feb 2022 16:47:17 +0100 Subject: [PATCH] Fix perfload jobs after consumer_types Since consumer_types was added to the API in I24c2315093e07dbf25c4fb53152e6a4de7477a51 the two perfload jobs are getting errors from placement as they are using the latest microversion but does not specify the consumer_type when creating allocations. The server could not comply with the request since it is either malformed or otherwise incorrect.\n\n JSON does not validate: 'consumer_type' is a required property This patch changes the allocation request to specify TEST as consumer type. Change-Id: I31500e3e6df5717d6bdb6ed7ed43325653d49be5 --- gate/perfload-nested-runner.sh | 2 +- gate/perfload-runner.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gate/perfload-nested-runner.sh b/gate/perfload-nested-runner.sh index efd5934a2..869116b12 100755 --- a/gate/perfload-nested-runner.sh +++ b/gate/perfload-nested-runner.sh @@ -54,7 +54,7 @@ function ab_bench { function write_allocation { # Take the first allocation request and send it back as a well-formed allocation curl -s -H 'x-auth-token: admin' -H 'openstack-api-version: placement latest' "${PLACEMENT_URL}/allocation_candidates?${PLACEMENT_QUERY}&limit=5" \ - | jq --arg proj $(uuidgen) --arg user $(uuidgen) '.allocation_requests[0] + {consumer_generation: null, project_id: $proj, user_id: $user}' \ + | jq --arg proj $(uuidgen) --arg user $(uuidgen) '.allocation_requests[0] + {consumer_generation: null, project_id: $proj, user_id: $user, consumer_type: "TEST"}' \ | curl -s -H 'x-auth-token: admin' -H 'content-type: application/json' -H 'openstack-api-version: placement latest' \ -X PUT -d @- "${PLACEMENT_URL}/allocations/$(uuidgen)" } diff --git a/gate/perfload-runner.sh b/gate/perfload-runner.sh index ff1ca9a0e..33737c38b 100755 --- a/gate/perfload-runner.sh +++ b/gate/perfload-runner.sh @@ -68,7 +68,7 @@ function ab_bench { function write_allocation { # Take the first allocation request and send it back as a well-formed allocation curl -s -H 'x-auth-token: admin' -H 'openstack-api-version: placement latest' "${PLACEMENT_URL}/allocation_candidates?${PLACEMENT_QUERY}&limit=5" \ - | jq --arg proj $(uuidgen) --arg user $(uuidgen) '.allocation_requests[0] + {consumer_generation: null, project_id: $proj, user_id: $user}' \ + | jq --arg proj $(uuidgen) --arg user $(uuidgen) '.allocation_requests[0] + {consumer_generation: null, project_id: $proj, user_id: $user, consumer_type: "TEST"}' \ | curl -s -H 'x-auth-token: admin' -H 'content-type: application/json' -H 'openstack-api-version: placement latest' \ -X PUT -d @- "${PLACEMENT_URL}/allocations/$(uuidgen)" }