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
whoami-rajat
4 years ago
| 66 | 66 |
self.assertEqual(src_vol['id'], restore['volume_id'])
|
| 67 | 67 |
self.assertEqual(backup['id'], restore['backup_id'])
|
| 68 | 68 |
|
| 69 | |
@decorators.idempotent_id('b5d837b0-7066-455d-88fc-4a721a899306')
|
|
69 |
@decorators.idempotent_id('457359e2-a663-4758-8f76-06d392dfd7c7')
|
| 70 | 70 |
def test_incr_backup_create_and_restore_to_an_existing_volume(self):
|
| 71 | 71 |
"""Test incr backup create and restore to an existing volume."""
|
| 72 | 72 |
# Create volume
|
| 11 | 11 |
|
| 12 | 12 |
import abc
|
| 13 | 13 |
|
|
14 |
from tempest.lib import decorators
|
| 14 | 15 |
from tempest.lib import exceptions
|
| 15 | 16 |
|
| 16 | 17 |
from cinder_tempest_plugin.api.volume import base
|
|
| 55 | 56 |
|
| 56 | 57 |
credentials = ['project_admin', 'system_admin']
|
| 57 | 58 |
|
|
59 |
@decorators.idempotent_id('1fdbe493-e58f-48bf-bb38-52003eeef8cb')
|
| 58 | 60 |
def test_get_capabilities(self):
|
| 59 | 61 |
pools = self.admin_stats_client.list_pools()['pools']
|
| 60 | 62 |
host_name = pools[0]['name']
|
|
| 66 | 68 |
|
| 67 | 69 |
credentials = ['project_member', 'project_admin', 'system_admin']
|
| 68 | 70 |
|
|
71 |
@decorators.idempotent_id('dbaf51de-fafa-4f55-875f-7537524489ab')
|
| 69 | 72 |
def test_get_capabilities(self):
|
| 70 | 73 |
pools = self.admin_stats_client.list_pools()['pools']
|
| 71 | 74 |
host_name = pools[0]['name']
|
| 19 | 19 |
commands = stestr run --slowest {posargs}
|
| 20 | 20 |
|
| 21 | 21 |
[testenv:pep8]
|
| 22 | |
commands = flake8 {posargs}
|
|
22 |
commands =
|
|
23 |
flake8 {posargs}
|
|
24 |
check-uuid --package cinder_tempest_plugin
|
|
25 |
|
|
26 |
[testenv:uuidgen]
|
|
27 |
commands = check-uuid --fix --package cinder_tempest_plugin
|
| 23 | 28 |
|
| 24 | 29 |
[testenv:venv]
|
| 25 | 30 |
commands = {posargs}
|