Commit Graph

72 Commits

Author SHA1 Message Date
Zuul a259e8d43e Merge "Add volume dependency test coverage" 2024-03-13 23:32:41 +00:00
Zuul cb3937363f Merge "Cleanup: unneeded client definition, API override" 2024-03-13 17:08:14 +00:00
Zuul ec1b30b6e2 Merge "Deleting volumes which are consumed as a basis for others" 2024-03-08 21:14:21 +00:00
Eric Harney 08da44d79d Add volume dependency test coverage
These tests are handy for testing the current RBD
deletion work.

Change-Id: I281f881ad565e565839522ddf02057f7545c7146
2024-01-25 15:24:17 +00:00
Sofia Enriquez 861993b5e9 Deleting volumes which are consumed as a basis for others
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
2024-01-25 15:21:59 +00:00
Ghanshyam Mann 8992770bad Moving API microversion fixture in resource_setup
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
2023-12-14 23:33:21 +00:00
Zuul 52a75f4e3a Merge "Test srbac on backups" 2023-07-04 17:18:01 +00:00
Yosi Ben Shimon bbb3cd6124 Test srbac on backups
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
2023-06-07 11:30:54 +03:00
Zuul 09048aea04 Merge "test srbac on volume-types" 2023-06-06 12:15:43 +00:00
Zuul a8f4fde019 Merge "[srbac] Testing Volume Actions" 2023-05-30 20:03:05 +00:00
Zuul cba2416798 Merge "[srbac] Testing Volumes" 2023-05-30 16:10:03 +00:00
Zuul dc76e8d7d7 Merge "Test srbac on user_messages" 2023-05-29 20:33:44 +00:00
Evelina Shames de601aeb6b [srbac] Test srbac on snapshots
Adding Reader and Member srbac tests with snapshots operations

Change-Id: I838ba765851485e05df785740257caf89492e104
Signed-off-by: Yosi Ben Shimon <ybenshim@redhat.com>
2023-05-23 13:44:50 +03:00
Yosi Ben Shimon 5bd72415ff test srbac on volume-types
Change-Id: If2553946ba20f46a9e5d6fc73595dd7617098e78
Signed-off-by: Yosi Ben Shimon <ybenshim@redhat.com>
2023-05-23 13:36:00 +03:00
Yosi Ben Shimon b57a8dda9a Test srbac on user_messages
Test 'reader', 'member' and 'admin' roles for 'list', 'show' and 'delete'.

Signed-off-by: Yosi Ben Shimon <ybenshim@redhat.com>
Change-Id: I1273af9f12b6785fe2c648d53c66cf4d5a748243
2023-05-22 11:25:44 +03:00
Evelina 3367fdd997 [srbac] Testing Volume Actions
Adding Reader srbac tests with volume action operations

Depends-On: https://review.opendev.org/c/openstack/cinder-tempest-plugin/+/872986
Change-Id: Ic60eec73361dbdda68d4308140560be55102178e
2023-05-21 17:27:45 +03:00
Evelina 46910c6e48 [srbac] Testing Volumes
Adding Reader srbac tests with volume operations

Depends-On: https://review.opendev.org/c/openstack/cinder-tempest-plugin/+/872986

Change-Id: I08c39feadd5278ff79bb582d6c497b0ce169c206
2023-05-21 16:34:23 +03:00
Zuul fd4ad9ee4c Merge "Wait for servers to be SSHABLE" 2023-05-05 20:50:35 +00:00
Dan Smith 51c56f219e Wait for servers to be SSHABLE
This is necessary to make sure we don't miss an attach or detach
event in the instance.

Depends-On: https://review.opendev.org/c/openstack/tempest/+/882342
Change-Id: I4cb8af79d6d474b28e96d7b2c385ed8e5ba9c1d7
2023-05-05 06:46:16 -07:00
Yosi Ben Shimon 490c825713 Test capabilites for srbac feature
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>
2023-04-27 15:49:13 +03:00
Toheeb Oyekola d6989d3c1a Fix test_boot_cloned_encrypted_volume docstring
Updated the docstring description for test_boot_cloned_encrypted_volume
function to an accurate one.


Closes-Bug:2006594
Change-Id: I5e6e5444388acccb85d74d8ab2a22c8d988cfb5b
2023-03-20 22:28:57 +00:00
Evelina Shames 101486341f Add unique ID for ProjectReaderTests.test_get_capabilities()
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
2023-02-06 11:18:51 +00:00
Alan Bishop 89823d9868 Avoid duplicate 'barbican' service_available option
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
2022-09-28 09:14:28 -07:00
Zuul e2fbcad776 Merge "Test the ability to transfer encrypted volumes" 2022-09-23 11:47:23 +00:00
Zuul 7ee02e8ed3 Merge "Add command to fix/generate idempotent IDs" 2022-09-21 16:36:37 +00:00
Alan Bishop 40104c78f8 Test the ability to transfer encrypted volumes
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
2022-08-17 21:33:56 +00:00
Zuul 5960fa4ed7 Merge "Add multiattach tests" 2022-06-29 16:41:29 +00:00
Zuul 141dace60e Merge "Add test to create multiple volume from resource" 2022-06-21 17:48:24 +00:00
Rajat Dhasmana f6b9cf6cf8 Add test to create multiple volume from resource
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
2022-06-07 22:39:09 +05:30
Zuul 401da84601 Merge "Improvements in snapshot data integrity tests" 2022-05-09 15:38:39 +00:00
Luigi Toscano 06201385c5 Cleanup: unneeded client definition, API override
- 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
2022-05-06 00:23:26 +02:00
whoami-rajat 668ce74e28 Add command to fix/generate idempotent IDs
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
2022-04-26 12:17:08 +05:30
whoami-rajat 56ace0a8b0 Modify path for APIMicroversionFixture
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
2022-04-22 14:34:54 +05:30
whoami-rajat 6dc9a2facc Add multiattach tests
This patch adds multiattach tests and also a gate job to run those tests.

Change-Id: Iaf4fc9ab84e5c45bd6f85d7186e2775bae107721
2022-03-30 11:34:21 +05:30
Zuul dd226c55f0 Merge "Remove all usage of six library" 2022-03-21 00:19:55 +00:00
tushargite96 a3b2272871 Dropping explicit unicode literal
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
2022-02-07 03:34:13 +00:00
Zuul 2cb36e636b Merge "Refactor test_volume_backup due to leftovers" 2022-01-10 15:21:53 +00:00
whoami-rajat 027295a69b Improvements in snapshot data integrity tests
This patch addresses the comments in the snapshot data integrity tests[1].

[1] https://review.opendev.org/c/openstack/cinder-tempest-plugin/+/790899

Change-Id: Icef31c07cf2a4e8c822a288edfc4463d592668ff
2021-12-28 09:25:32 +00:00
Rajat Dhasmana 638f2308a1 Import from tempest stable manager
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
2021-12-03 18:51:05 +00:00
Zuul 961bab0212 Merge "Improve snapshot data integrity test" 2021-12-03 18:21:12 +00:00
Benny Kopilov e9834cd872 Refactor test_volume_backup due to leftovers
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
2021-10-03 21:08:35 +03:00
Seena Fallah a30dd6ea33 volume: fix wrong snapshot_id for revert_to_snapshot_after_extended_negative
revert_to_snapshot receive snapshot_id not a snapshot object

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
Change-Id: Ibccc48c5afb402e899ebbb471e2fc2e90d4d8886
2021-10-01 01:26:30 +03:30
Rajat Dhasmana d9e5925bf6 Improve snapshot data integrity test
Currently the test require lot of resources i.e. 4 instance.
This patch uses recommendation from the comments of initial patch[1]
i.e. creates 1 instance, attach volumes to it, snapshot etc

[1] https://review.opendev.org/c/openstack/cinder-tempest-plugin/+/702495

Depends-On: https://review.opendev.org/c/openstack/barbican/+/796059

Change-Id: I151b034dd28834290ffeb3ce9c052a6c3bbfb7d8
2021-06-14 02:32:22 -04:00
Lance Bragstad d3fddec498 Implement basic protection testing jobs
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
2021-04-23 18:11:54 +02:00
Zuul 641d6a009e Merge "Use the embedded scenario manager instead of tempest one" 2021-03-03 20:00:18 +00:00
Zuul 19078934c8 Merge "Wait for CG to be available before creating volume in the CG" 2021-03-01 16:57:40 +00:00
Zuul 548a31afb7 Merge "Add Snapshot data integrity test" 2021-02-27 16:47:15 +00:00
Luigi Toscano 3c5c8a2364 Use the embedded scenario manager instead of tempest one
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
2021-02-23 10:24:01 +01:00
Luigi Toscano f220e45333 Add test idempotent IDs when missing
Each test should have one:
https://opendev.org/openstack/tempest/src/tag/26.0.0/HACKING.rst

Change-Id: Icd119d710376c0f5e4c6d2932ca39d55648cc9b7
2021-02-19 13:49:38 +01:00
Rajat Dhasmana 21d63a3ada Add Snapshot data integrity test
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
2021-01-29 19:52:01 +00:00