Conditionallly skip manage snapshot tests
The cinder manage snapshots commands are not supported by all drivers,
so the RBAC tests should be conditional to the driver supporting it.
The unmanage snapshot RBAC tests can still be run, because the failure
should happen at the API level, so it doesn't matter if the driver
supports it or not.
Change-Id: I2a65f8655a7418a9099e8d7593bd7d7009f22d9d
Gorka Eguileor authored 1 year, 10 months ago
Brian Rosmaita committed 1 year, 10 months ago
| 16 | 16 | from tempest.lib import decorators |
| 17 | 17 | from tempest.lib import exceptions |
| 18 | 18 | |
| 19 | import testtools | |
| 20 | ||
| 19 | 21 | from cinder_tempest_plugin.rbac.v3 import base as rbac_base |
| 20 | 22 | |
| 21 | 23 | CONF = config.CONF |
| 308 | 310 | def test_force_delete_snapshot(self): |
| 309 | 311 | self._force_delete_snapshot(expected_status=exceptions.Forbidden) |
| 310 | 312 | |
| 313 | # We don't need to skip the unmanage because the failure should happen at | |
| 314 | # the API level, so it should fail regardless of the driver support for | |
| 315 | # unmanaging snapshots. | |
| 311 | 316 | @decorators.idempotent_id('35495666-b663-4c68-ba44-0695e30a6838') |
| 312 | 317 | def test_unmanage_snapshot(self): |
| 313 | 318 | self._unmanage_snapshot(expected_status=exceptions.Forbidden) |
| 314 | 319 | |
| 320 | @testtools.skipUnless(CONF.volume_feature_enabled.manage_snapshot, | |
| 321 | 'manage snapshots are disabled') | |
| 315 | 322 | @decorators.idempotent_id('d2d1326d-fb47-4448-a1e1-2d1219d30fd5') |
| 316 | 323 | def test_manage_snapshot(self): |
| 317 | 324 | self._manage_snapshot( |
| 361 | 368 | def test_force_delete_snapshot(self): |
| 362 | 369 | self._force_delete_snapshot(expected_status=exceptions.Forbidden) |
| 363 | 370 | |
| 371 | # We don't need to skip the unmanage because the failure should happen at | |
| 372 | # the API level, so it should fail regardless of the driver support for | |
| 373 | # unmanaging snapshots. | |
| 364 | 374 | @decorators.idempotent_id('dd7da3da-68ef-42f5-af1d-29803a4a04fd') |
| 365 | 375 | def test_unmanage_snapshot(self): |
| 366 | 376 | self._unmanage_snapshot(expected_status=exceptions.Forbidden) |
| 367 | 377 | |
| 378 | @testtools.skipUnless(CONF.volume_feature_enabled.manage_snapshot, | |
| 379 | 'manage snapshots are disabled') | |
| 368 | 380 | @decorators.idempotent_id('c2501d05-9bca-42d7-9ab5-c0d9133e762f') |
| 369 | 381 | def test_manage_snapshot(self): |
| 370 | 382 | self._manage_snapshot( |