Add idempotent_id decorator to tempest testcases

The idempotent_id decorator allows for tracking of tests even
after they have been renamed [1]. This patch adds idempotent_id
decorator to scenario related testcases for mistral_tempest_tests.

[1] https://github.com/openstack/tempest/blob/master/
    HACKING.rst#test-identification-with-idempotent-id

Change-Id: I955cd8b063b5a5d7d94cbd769b93521e35c9649b
Partial-Implements: blueprint add-idempotentid
This commit is contained in:
yushangbin 2017-03-03 17:21:37 +08:00
parent 0c4fa17425
commit 05862cb84a
3 changed files with 13 additions and 0 deletions

View File

@ -16,6 +16,7 @@ from urlparse import urlparse
from oslo_serialization import jsonutils
from oslo_utils import uuidutils
from tempest.lib import decorators
from tempest import test
from mistral_tempest_tests.tests import base
@ -29,6 +30,7 @@ class MultiVimActionsTests(base.TestCase):
super(MultiVimActionsTests, cls).resource_setup()
@test.attr(type='openstack')
@decorators.idempotent_id('dadc9960-9c03-41a9-9a9d-7e97d527e6dd')
def test_multi_vim_support_target_headers(self):
client_1 = self.alt_client
client_2 = self.client
@ -56,6 +58,7 @@ class MultiVimActionsTests(base.TestCase):
)
@test.attr(type='openstack')
@decorators.idempotent_id('bc0e9b99-62b0-4d96-95c9-016a3f69b02a')
def test_multi_vim_support_target_headers_and_service_catalog(self):
client_1 = self.alt_client
client_2 = self.client

View File

@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from tempest.lib import decorators
from tempest import test
from mistral_tempest_tests.tests import base
@ -32,6 +33,7 @@ class OpenStackActionsTestsV2(base.TestCase):
'openstack/action_collection_wb.yaml')
@test.attr(type='openstack')
@decorators.idempotent_id('9a999fc2-a089-4375-bc69-e1ed85b17a82')
def test_nova_actions(self):
wf_name = self.wb['name'] + '.nova'
_, execution = self.client.create_execution(wf_name)
@ -41,6 +43,7 @@ class OpenStackActionsTestsV2(base.TestCase):
self.assertEqual('SUCCESS', executed_task['state'])
@test.attr(type='openstack')
@decorators.idempotent_id('81bdc1c9-cd9a-4c97-b8ce-e44f5211eace')
def test_keystone_actions(self):
wf_name = self.wb['name'] + '.keystone'
_, execution = self.client.create_execution(wf_name)
@ -50,6 +53,7 @@ class OpenStackActionsTestsV2(base.TestCase):
self.assertEqual('SUCCESS', executed_task['state'])
@test.attr(type='openstack')
@decorators.idempotent_id('fde681b8-3e1b-4172-a4b8-2fcac1f070d9')
def test_heat_actions(self):
wf_name = self.wb['name'] + '.heat'
_, execution = self.client.create_execution(wf_name)
@ -59,6 +63,7 @@ class OpenStackActionsTestsV2(base.TestCase):
self.assertEqual('SUCCESS', executed_task['state'])
@test.attr(type='openstack')
@decorators.idempotent_id('5981360d-f336-45ca-9d38-799c7a8ade26')
def test_glance_actions(self):
wf_name = self.wb['name'] + '.glance'
_, execution = self.client.create_execution(wf_name)
@ -68,6 +73,7 @@ class OpenStackActionsTestsV2(base.TestCase):
self.assertEqual('SUCCESS', executed_task['state'])
@test.attr(type='openstack')
@decorators.idempotent_id('a1f71a72-3681-4d32-aad9-117068717b33')
def test_cinder_actions(self):
wf_name = self.wb['name'] + '.cinder'
_, execution = self.client.create_execution(wf_name)
@ -77,6 +83,7 @@ class OpenStackActionsTestsV2(base.TestCase):
self.assertEqual('SUCCESS', executed_task['state'])
@test.attr(type='openstack')
@decorators.idempotent_id('586dd973-fc65-40e2-9a85-31418b22473a')
def test_neutron_actions(self):
wf_name = self.wb['name'] + '.neutron'
_, execution = self.client.create_execution(wf_name)

View File

@ -20,6 +20,7 @@ import time
from oslo_log import log as logging
from paramiko import ssh_exception
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions
from tempest import test
@ -246,6 +247,7 @@ class SSHActionsTestsV2(base.TestCaseAdvanced):
super(SSHActionsTestsV2, cls).resource_cleanup()
@test.attr(type='sanity')
@decorators.idempotent_id('3e12a2ad-5b10-46b0-ae1f-ed34d3cc6ae2')
def test_run_ssh_action(self):
input_data = {
'cmd': 'hostname',
@ -268,6 +270,7 @@ class SSHActionsTestsV2(base.TestCaseAdvanced):
self.assertIn(self.public_vm['name'], output['result'])
@test.attr(type='sanity')
@decorators.idempotent_id('6c09fb04-70b4-43a6-b5f8-a53ca92e66e0')
def test_run_ssh_proxied_action(self):
guest_vm_ip = self.guest_vm['addresses'].popitem()[1][0]['addr']