This patch includes two test scenarios:
- Create a cloned volume from another volume. Cinder should
be able to delete the source volume.
- Create a volume from a snapshot. Cinder should be able to
delete the source volumes while the new volume still exists.
Related-Bug: #1969643
Depends-On: https://review.opendev.org/c/openstack/cinder/+/848013
Change-Id: I8daed0824f5ac60877e839265c09217dcce6dd21
API microversion fixture is used to set the API
microversion on service client and reset it back
after test execution. That is done in setUp()
method and due to that API microversion is not
set on service client during resource_setup()
method and any API call will be requested on base
version.
To sync the complete test execution of test class
with requested API microversion, this commit moves
the API microversion setting in resource_setup()
method.
Related-Bug: #1881863
Change-Id: Id26c73e4f0554770cd13d2b8840fe430448cc87f
Testing reader, member and admin roles.
This file contains test 2 classes for API version 3.3 and 3.9
Signed-off-by: Yosi Ben Shimon <ybenshim@redhat.com>
Change-Id: I9e6ea838fa7a93fcfc3d4ef7f807224aadee187b
Adding Reader and Member srbac tests with snapshots operations
Change-Id: I838ba765851485e05df785740257caf89492e104
Signed-off-by: Yosi Ben Shimon <ybenshim@redhat.com>
Test 'reader', 'member' and 'admin' roles for 'list', 'show' and 'delete'.
Signed-off-by: Yosi Ben Shimon <ybenshim@redhat.com>
Change-Id: I1273af9f12b6785fe2c648d53c66cf4d5a748243
Changed the test to keep convention without abstract methods
Also remvoed base.BaseVolumeTest inheritance, to isolate RBAC tests from
the normal tests while they are developed, even though this could be
revisited in the future the base classes for API tests in
cinder-tempest-plugin could be unified.
Change-Id: I7020487fcdb0a8e34be92a2b0f110b885cbeb339
Signed-off-by: Yosi Ben Shimon <ybenshim@redhat.com>
Updated the docstring description for test_boot_cloned_encrypted_volume
function to an accurate one.
Closes-Bug:2006594
Change-Id: I5e6e5444388acccb85d74d8ab2a22c8d988cfb5b
ProjectReaderTests.test_get_capabilities() used the same ID as
ProjectMemberTests.test_get_capabilities(), so to differentiate
between the two tests, I added another ID.
Change-Id: I416a21489c2a9096257bb3dc4465574435e10672
The cinder and barbican tempest plugins both need the 'barbican'
service_available option to be defined, but they both can't register
the option. This patch ensures the cinder plugin registers the option
only when the barbican plugin isn't present.
Closes-Bug: #1991068
Change-Id: I51a22afae4fc98e2c2b8c1e82e8211a27649022c
Add tempest tests that transfer an encrypted volume to a user in
another project, and one that verifies the ability to cancel (delete)
a transfer. The purpose is to test the ability to transfer the
barbican secret (i.e. the encryption key) to another user.
The tests create an encrypted volume from an image, and launch an
instance to write a timestamp. After the volume is transferred (or
the transfer is deleted), another instance is booted and the timestamp
read back. The tests also verify the process results in the volume
having a new encrytion_key_id.
Implements: blueprint transfer-encrypted-volume
Depends-On: I459f06504e90025c9c0b539981d3d56a2a9394c7
Depends-On: I11072d6d8a185037c7f4cdd52c45933b0cccaf05
Depends-On: I4ad7fe336c5193604d95fca5a72695d82adaa9f0
Depends-On: Ia3f414c4b9b0829f60841a6dd63c97a893fdde4d
Depends-On: I216f78e8a300ab3f79bbcbb38110adf2bbec2196
Change-Id: I30d02c81dd1cf8509585fe3b7a0f3256f17939b5
This patch adds tests for creating multiple volumes from resources
like snapshot, source volume, backup etc.
It also moves creating multiple volumes from image test to the same
file as other resource tests.
Change-Id: Iddc4c40854a5a301ccfbdcf93e03886cc4ee9709
- do not redefine a few variables for volume(admin and not) and backup clients
when already defined in the base classes;
- define cls.admin_volume_client (same name as in tempest) rather then
admin_volumes_client in the base class for admin volume tests;
- remove any usage and override of _api_version, which is not really used
in the plugin, and it was also removed in tempest (see
I6e05fbe21b29efa128fb59d16bf521d551b00304 )
Even if unused, _api_version still pointed to the deprecated version 2
for consistency group tests.
Change-Id: I3164662932a302b87ae2f346c0005bf7d0ab2927
This patch adds a "uuidgen" command that will fix all issues
related to idempotent IDs in our tests. Also modifies pep8 to
detect these issues.
This command already exists in tempest and is required for cinder
tempest plugin as we had undetected issues in our tests that
got merged which are also fixed in this patch. The issues are as
follows:
1) Missing idempotent IDs in test_capabilities
2) Duplicate idempotent IDs in the following backup tests
a) test_backup_create_and_restore_to_an_existing_volume
b) test_incr_backup_create_and_restore_to_an_existing_volume
Change-Id: I6b34fd67af4c302ff17244143506d8c8a8247eb6
The path 'tempest.api.volume.api_microversion_fixture.APIMicroversionFixture'
is deprecated and produces a deprecation warning[1] when running tests.
The deprecated path will be removed in Zed and we should use the
path 'tempest.lib.common.api_microversion_fixture.APIMicroversionFixture'
instead.
[1] 2022-04-22 14:00:28,241 843455 WARNING
[tempest.api.volume.api_microversion_fixture]
APIMicroversionFixture class is deprecated and moved to
tempest.lib.common.api_microversion_fixture.APIMicroversionFixture.
It will be removed in Z cycle.
Change-Id: Ie7f16f9671e3c2392a9f2ae1071d84915b48a85e
In python 3, all strings are considered as unicode string.
This patch drops the explicit unicode literal (u'...')
or (u"..") appearances from the unicode strings.
Change-Id: Ied40f6e4fefc66f847fed7e934d53ccb64be8dd4
This patch removes the copy of tempest scenario manager
and directly imports the manager from tempest which has been
marked stable in tempest 27.0.0 release.
Change-Id: I403d5bc2eef464e6071e466aeab8e040b9055568
Current test class does not clean volume / backup resources.
Change the create for volume and backups from base and not from client.
The base create contains waiters and run cleanup resources.
Change-Id: I8a6a7945870d30f180bd41940b8ee8b82e2f87b7
This commit lays down a basic structure for protection tests. These are
useful for testing various secure RBAC personas, but leveraging all the
dynamic credential work in tempest's authentication libraries to
provision clients for testing. We're also adding a non-voting protection
test job so that we can integrate protection testing into the cinder
gate as we work through policy changes.
This commit also adds some basic tests exercising the capabilities
admin-only API. These tests ensure that only operators (e.g.,
system-administrators) or formally known as project-administrators, can
access the capabilities API. Assertions and functionality in these tests
may expand in the future to accomodate system-scope when cinder can
properly consume system-scoped tokens from keystone.
For now, the tests assume project-administrators are deployment
operators, which is the legacy way of denoting "admin-ness" in OpenStack
deployments.
Depends-On: https://review.opendev.org/c/openstack/tempest/+/778753
Change-Id: I6d4ae6d516f4c2dda4dcb6b974857b34f2ef2254
While waiting for tempest scenario manager to stabilize its API,
a copy of it has been imported, so make sure to use it and to not
rely on tempest's one (whose API is changing during the stabilization
process, so it may break anytime).
Just one file needs to change its imports.
At the same time, fix the import order for another file.
Change-Id: I29c4784d59151948778cad57b7db56a368ed821d
This patch adds data integrity tests for snapshot with the following
procedure :
1) create a volume from image
2) Boot an instance from the volume
3) create file on vm and write data into it
4) create first snapshot
5) repeat 3
5) create second snapshot
6) repeat 3
7) create third snapshot
Now restore the snapshots one by one into volume, create instances
from it and check the number of files and file content at each
point snapshot was created.
We are also temporarily making a copy of tempest scenario manager until
the actual manager is available for import in tempest plugins.
Change-Id: I5c5ff6f996dd39b52fada82f3938b628e58b0a2c