Made `centralized_db` cache driver as default driver so that we
can test it using tempest jobs in gate.
Implements blueprint centralized-cache-db
Depends-On: https://review.opendev.org/c/openstack/devstack/+/907110
Change-Id: Id94e93e3ba3fc207b39c7dbff92495805aa0f6f9
The following options set in functional tests do not exist.
[DEFAULT] send_identity_credentials
[DEFAULT] send_identity_headers
Change-Id: Ia739af13e0f88d0861e453a4d54ecc626e32b34b
The oslo.limit 2.3.0 release contains the validation to ensure
the [oslo_limit] endpoint_id option is set[1]. This fixes the test
failures caused by that validation by overriding the option in all
test cases where unified quota implementation is used.
[1] https://review.opendev.org/c/openstack/oslo.limit/+/897509
Closes-Bug: #2049064
Change-Id: I704393892799ee0d5edf45fabe07afe01473e38d
This patch extends the functionality of the API
``GET /v2/info/stores/detail`` to expose store details
of other stores. Currently the ``stores-detail`` API
exposes store details of RBD backend.
Implements: blueprint expanding-stores-detail
Change-Id: I0c7bbc315b56dc0e40397b4ed8a68d1668203c44
With change Ic79815972e654a8bfe2775f57c68cfa0bf115e2f, we started
using getaddrinfo method from socket lib to fetch the system
IP address (v4 or v6) and pass it to os-brick.
The test works for most systems since a valid IP is returned but
for some deployments, it fails with the following error.
raise socket.gaierror(socket.EAI_NONAME, 'No address found')
In any case, it is a good practice to mock it in tests.
This patch mocks getaddrinfo in the current cinder store tests.
Change-Id: Ib03fefbb6034a7e7d2ff1e16430d28962c2ca355
Till now glance was dependent on periodic job to get image
cached locally and also has dependency on ``cachemanage``
middleware for the same.
This patch removes the periodic job and dependency of
``cachemanage`` middleware and initiates immediate caching
of an image via ``PUT /cache/image_id`` API call.
Co-Author: Dan Smith <dms@danplanet.com>
Implements: blueprint instant-caching
Change-Id: I9ab3f1b7595e22dbb03af95168314352a44eb930
DELETE /v2/cache/{image_id} and /v2/cache returns HTTP 200 response
code to user but as per proposal it should be HTTP 204. This change
returns HTTP 204 response to user.
Closes-Bug: #1980049
Change-Id: I9d1c25638584fe346e3937d0536413d548d46e8e
This was already fixed in 4889dc1814 but
we did not enforce this rule and reintroduced "bad" string
interpolations. This patch adds a hacking rule to prevent us from doing
this again in the future.
Change-Id: I96d9a157d3887286542859d67138ffdae5a589f1
PUT /v2/cache/{image_id} returns HTTP 200 response code to user but as per
proposal it should be HTTP 202. This change returns HTTP 202 response to
user.
Closes-Bug: #1971521
Change-Id: I6a875a38bef5beafe352ab3320f3fd199db89aa1
to image
Glance API throws an Internal Server Exception when a non
active image is shared with another project and any member
from that project tries to stage data for the same.
This patch will cover the Functional Test Case for the same
Closes-Bug: #1939922
Change-Id: I065036cff6e107b3438007db40981459400ccb6b
It was observed that md-tag-create-multiple
(/v2/metadefs/namespaces/{namespace_name}/tags) API overwrites
existing tags for specified namespace rather than creating new one
in addition to the existing tags.
This patch resolves the issue by introducing a header 'X-Openstack-Append'
which on being True will append the new tags to existing ones and
if False will continue to overwrite the tags.
Implements: blueprint append-tags
Closes-Bug: #1939169
Change-Id: I29448746b14c542e5fbf0283011968ae1516642e
This adds a /v2/info/usage API endpoint which exposes to the user
their current limits and usage.
The discovery API does not (appear to) have existing tests, so this
adds a module for that, although only usage tests are added currently.
Implements: blueprint quota-api
Change-Id: I50c98bac50f815bdb9baae024e77afd388f74554
This is a rather beefy change due to the number of usages of this
import. The changes are trivial though.
Change-Id: I7badeeaca438b0291f4ed86670e7f217e6372c61
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This is the same as the 'range' keyword in Python 3
Change-Id: If3aa008522c24e870b7bf13de32b8ed1b27cb519
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
We also remove hacking tests for this, along with those for iterkeys and
itervalues (no usage of these).
Change-Id: If5b46580078eb756651ac6118f502eccdc693646
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
While logging connection info in the glance cinder store driver, we
need to mask passwords for which we use oslo_utils's mask_dict_password
method.
Since this is not mocked in the glance functional tests, we encounter a failure
in cross-glance-tox-functional job in the change[1].
This patch adds the required mocking to pass the tests.
[1] https://review.opendev.org/c/openstack/glance_store/+/818722
Change-Id: Ibd9563fb854f888b4a2f5a5dcf6abce0cfab0f04
In glance cinder functional tests, we currently use FakeObject class
to create mock objects which has limited functionality.
Replacing it with mock.MagicMock will prevent failures like in change
I129181b2338e09d094ee552a62500c6e460ee621 and other features as well.
Change-Id: I5afa2541bc28970191ea9fd76bf44eb9aaaa1081
Legacy attachment API calls were removed/replaced from the code with
new attachment API support in glance store with change[1]
This patch removes the same methods mocked in the tests.
[1] https://review.opendev.org/c/openstack/glance_store/+/782200
Change-Id: I111fc36dcf3bc203f21377a3095a2170d00bb9bf
qemu-img package for Centos 8 doesn't support qcow disk format anymore,
due to this, tests using qcow are failing with
`Unknown file format 'qcow'`.
This patch updates the qcow tests for qcow2 instead.
Closes-Bug: #1946457
Change-Id: If488ae4299a6cab521eec9c5e9ce4f29f94057e1
The metadef functional test classes all had their own _header()
implementation and none of them varied. This commit moves the _header()
implementation to a common layer and removes the duplication.
Change-Id: I40942a5dde3cd50a64a5f36fbcb6d9240af25b5e
Most of the functional tests contain a version of _url(). The
implementations don't really differ, outside of one that accepts a
protocol and another that is specific to IPV6 for a single test case.
This commit moves the common method to the functional base class and
removes the duplicated logic across the functional test implementations.
Change-Id: I0b161ad404bdb53e3c1cfe878f78a71c239cf40e
Each metadef test module has its own constants for TENANT1 and TENANT2,
bu they all point to the same underlying value from oslo. This commit
moves the constants to the setUp() method of the base metadef functional
test class and removes the duplication across the metadef tests.
Change-Id: I21e32a34c05b6f091e14c41b4e5a50ccaa294365
We're in the process of adding test coverage for the metadef API, which
is sorely needed. This commit introduces two different base classes that
help consolidate some duplication that's grown across the metadef tests.
Since the metadef API contains a whole bunch of nest resources, the
first class is a set of utilities that are handy for creating
metadef resources. This is nice because almost every resources in the
metadef API needs a namespace.
The second class is a subclass of the functional test case, but provides
a layer for metadef-specific test utilities, like assertions. We can
continue using this layer to consolidate test utilities without bloating
the base functional test class.
Change-Id: Ic469ee50b9a3f162fd75a8290766d1e0bb4b26f5
This fixes the bug related to cinder store migration being unable to
complete if a non-owner, non-admin user GETs the image before one of
the authorized users has triggered the lazy migration.
Change-Id: I187f626816ef1bc7303251165d2282bf6985cfd1
Closes-Bug: #1932337
This reproduces the behavior described in bug 1932337, where a post-
upgrade GET by a non-owning user will return an error for a valid image
because the cinder store migration cannot complete.
This asserts the broken behavior to reproduce the problem, and the
rest of the test will be enabled when the bug is fixed.
Note that the test for this was duplicating code from the base class,
and since some changes were needed to those methods, this removes the
duplication and modifies only the base.
Change-Id: I741e6377b3aa40c14d637f0fbdf396dc468f6ebd
This commit updates the policies for metadef properties
to use default roles available from keystone.
Implements: blueprint secure-rbac
Change-Id: Ic93c2a8a7017e6eac16d23fb5a9224d2c11e7211
This commit updates the policies for metadef resource types
to use default roles available from keystone.
Implements: blueprint secure-rbac
Change-Id: Ia0809b2b27ac8cf9325e264b3298149feea07eb4
This commit updates the policies for metadef objects to
use default roles available from keystone.
Implements: blueprint secure-rbac
Change-Id: If2001ef652e21f54048db0fc67893337681a2b6f
This commit updates the policies for metadef namespaces
to use default roles available from keystone.
Co-Authored-By: Abhishek Kekane <akekane@redhat.com>
Implements: blueprint secure-rbac
Change-Id: I7bc678b1f61b204574f3a59b6c686fd771af5f54