Commit Graph

6 Commits

Author SHA1 Message Date
Chris Dent e1783b0087 Correctly limit provider summaries when nested
When making a GET /allocation_candidates request with the 'limit'
parameter, include all the providers in the same tree as the providers
mentioned in the allocation requests. That is, in a nested situation,
if we limit the allocation requests to 10, we would usually expect
considerably more than 10 providers in provider summaries, to include
any non-contributing providers in the same tree.

Accomplish this by filtering provider summaries on root_provider_uuid
instead of individual provider uuid.

A gabbi test is added which exercises this in a nested situation.

An existing test is updated to reflect the new filtering style. It
does not exercise the nested scenario.

A reno is added indicating the fix.

Change-Id: I136bd7cd89f1bd54f0d1691268545850af234f18
Story: 2005859
Task: 33654
2019-06-11 14:40:25 +01:00
Eric Fried d2448ccfc3 Test for multiple limit/group_policy qparams
Following up on [1], I tried to replace GET.getall() with GET.get() for
'limit' and 'group_policy' in the GET /allocation_candidates handler.
However, it turns out that this actually changes behavior, because
.get() picks up the *last* value, whereas we were previously picking up
the first.

Rather than spin a whole microversion to change this behavior (if we do
that, we should just change the schema to disallow multiples) this
change set just adds tests proving that we pick up the first value, so
that if future me decides to come along and make such a change again,
we'll catch it.

(NB: copied from the nova change set with the same Change-Id)

[1] https://review.openstack.org/#/c/517757/37/nova/api/openstack/placement/handlers/allocation_candidate.py@232

Change-Id: I3075e16fb33b2c7fd3be6bead492faf9114d18dc
2019-02-25 16:40:11 -06:00
Eric Fried fbc6940804 Add second shared provider to SharedStorageFixture
To help test the new ?in_tree<N> syntax, add a second shared storage
provider to the SharedStorageFixture used in the allocation-candidates
gabbits.

Change-Id: If6d6373d4068be047d81c6c75cdf1266c9ef08a2
2019-02-25 16:40:08 -06:00
Tetsuro Nakamura ce10de2a29 in_tree[N] alloc_cands with microversion 1.31
This patch adds microversion 1.31 supporting the `in_tree`/`in_tree<N>`
query parameters to the `GET /allocation_candidates` API. It accepts a
UUID for a resource provider. If this parameter is provided, the only
resource providers returned will be those with the same tree with the
given resource provider.

Change-Id: I24d333d1437168f27aaaac6d894a18271cb6ab91
Blueprint: alloc-candidates-in-tree
2019-02-25 13:00:30 -06:00
Tetsuro Nakamura dcb359055e Add DISK_GB to compute in SharedStorageFixture
To prepare for tests of the new ?in_tree<N> syntax, this patch adds
DISK_GB inventory to the second compute node provider in the
SharedStorageFixture used in the allocation-candidates gabbits.

Change-Id: I4eb504ad1f0ef8d5caa096460dbd990cc04a8b1f
2019-02-25 08:41:14 -06:00
EdLeafe 9b9073c4c3 Move the functional test directories
While in Nova, placement functional test code was relegated to the
'nova/tests/functional/api/openstack/placement/' directory. This commit
moves the contents of that directory to 'placement/tests/functional/',
and removes the unnecesary directories. It also removes the files
related to Nova aggregates that were preserved in the filter_history.sh
script.

Change-Id: I5af2e074f2e1bcb90f32589fce819bd4872b6871
2018-09-04 10:31:24 -05:00