Commit Graph

9 Commits

Author SHA1 Message Date
Rajesh Tailor 4fff36d52b Fix typos
This change fixes typos in comments, log messages and tests.

Change-Id: Ic035853facfad866be5f99ac28247b2864ca5f8b
2022-07-08 21:46:57 +05:30
Chris Dent fb0f6f2608 Allow [a-zA-Z0-9_-]{1,64} for request group suffix
Add a 1.33 microversion to move from numeric suffixes to string
suffixes that can be 64 chars longs made from '-', '_', and
mixed-case alphanumeric. The format is shared between schema
and RequestGroup parsing.

Docs, api-ref, api history and microversion upper limit are updated
to indicate the new form in the new microversion.

A release note is added.

Story: 2005575
Task: 30781
Change-Id: Ia44b0922d151695d406883262e891bd932536f38
2019-05-21 11:07:38 +01:00
Zuul eae9e302e8 Merge "Fix a bad granular gabbi test" 2019-02-26 17:35:59 +00:00
Zuul 01246b0183 Merge "Test for multiple limit/group_policy qparams" 2019-02-26 13:26:33 +00: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 a3c3370fea Fix a bad granular gabbi test
A gabbi test for multiple member_of<N> was using the `query_parameters`
keyword to construct the querystring; but it was trying to test what
happens when member_of<N> is specified multiple times. In this test, N
was the same for both, but the query parameters were being entered as
separate dict keys; so the querystring was only being constructed with
the latter value, because yaml [1]. The test was passing spuriously
because it happens to be the case that the result would be the same if
only the latter value is specified. (If you reversed the order of the
two member_ofZ, the test failed.)

This change re-YAMLs the query_parameters to use list syntax for the
values of the member_of key, from which gabbi will dtrt in constructing
the querystring.

NB: It might be nice to find a test scenario where the false positive
wouldn't have been possible; but that would be a bigger effort that
could possibly entail reswizzling the GranularFixture and therefore the
whole gabbit. Done this way, we're at least sure that both values are
making it to the handler; and switching the order in the querystring has
no effect (though the order is apparently not guaranteed/deterministic
anyway [2]).

[1] https://github.com/yaml/pyyaml/issues/165
[2] https://gabbi.readthedocs.io/en/latest/example.html (search for
query_parameters)

Change-Id: I10f28d8c21643be69b67f25dcc043cd9640eac42
2019-02-25 12:26:11 -06:00
Tetsuro Nakamura ac57123344 Adds check for duplicate alloc_cands
This patch adds a check for duplicate allocation candidates in
granular requests scenarios. To check the duplication, the __eq__ and
and the __hash__ operators are added both to AllocationRequestResource
class and to AllocationRequest class.

Change-Id: I8b5b0212077ca930ee69d3f1c349f41433bae68e
Closes-Bug: #1817458
2019-02-25 02:51:32 +00:00
Tetsuro Nakamura e4f3c76fb4 Adds tests for granular single shared rp request
This patch adds a test for granular single shared resource provider
request, which turned out to be broken. Namely, we get duplicate
allocation requests when shared resource is requested alone.

Change-Id: Ia89e011fb51a41db9b7296ab357c36556d7c8fba
Related-Bug: #1817458
2019-02-24 11:38:25 +00: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