Replace test.attr with decorators.attr

Function 'tempest.test.attr()' has moved to 'tempest.lib.decorators
.attr()' in Pike and will be removed in a future version.
This patch replaces the 'tempest.test.attr()' with the 'tempest.lib
.decorators.attr().'

Change-Id: Iba7361382ff3b3d2b055a0507af9a8a88cd4a4ce
This commit is contained in:
Luong Anh Tuan 2017-07-18 18:12:15 +07:00
parent 8d24a8bad7
commit dd8399a0db
11 changed files with 123 additions and 133 deletions

View File

@ -54,7 +54,7 @@ class ActionExecutionTestsV2(base.TestCase):
super(ActionExecutionTestsV2, cls).resource_cleanup() super(ActionExecutionTestsV2, cls).resource_cleanup()
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('a72603bd-5d49-4d92-9747-8da6322e867d') @decorators.idempotent_id('a72603bd-5d49-4d92-9747-8da6322e867d')
def test_run_action_execution(self): def test_run_action_execution(self):
resp, body = self.client.create_action_execution( resp, body = self.client.create_action_execution(
@ -71,14 +71,14 @@ class ActionExecutionTestsV2(base.TestCase):
output output
) )
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('0623cb62-b20a-45c8-afd9-8da46e1bb3cb') @decorators.idempotent_id('0623cb62-b20a-45c8-afd9-8da46e1bb3cb')
def test_list_action_executions(self): def test_list_action_executions(self):
resp, body = self.client.get_list_obj('action_executions') resp, body = self.client.get_list_obj('action_executions')
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('cd36ea00-7e22-4c3d-90c3-fb441b93cf12') @decorators.idempotent_id('cd36ea00-7e22-4c3d-90c3-fb441b93cf12')
def test_output_appear_in_response_only_when_needed(self): def test_output_appear_in_response_only_when_needed(self):
resp, body = self.client.get_list_obj('action_executions') resp, body = self.client.get_list_obj('action_executions')
@ -127,7 +127,7 @@ class ActionExecutionTestsV2(base.TestCase):
action_execution = body['action_executions'][0] action_execution = body['action_executions'][0]
self.assertNotIn("output", action_execution) self.assertNotIn("output", action_execution)
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('dc76aeda-9243-45cf-bfd2-141d3af8b28b') @decorators.idempotent_id('dc76aeda-9243-45cf-bfd2-141d3af8b28b')
def test_run_action_std_http(self): def test_run_action_std_http(self):
resp, body = self.client.create_action_execution( resp, body = self.client.create_action_execution(
@ -141,7 +141,7 @@ class ActionExecutionTestsV2(base.TestCase):
output = json.loads(body['output']) output = json.loads(body['output'])
self.assertTrue(output['result']['status'] in range(200, 307)) self.assertTrue(output['result']['status'] in range(200, 307))
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('befa9b1c-01a4-41bc-b060-88cb1b147dfb') @decorators.idempotent_id('befa9b1c-01a4-41bc-b060-88cb1b147dfb')
def test_run_action_std_http_error(self): def test_run_action_std_http_error(self):
resp, body = self.client.create_action_execution( resp, body = self.client.create_action_execution(
@ -155,7 +155,7 @@ class ActionExecutionTestsV2(base.TestCase):
output = json.loads(body['output']) output = json.loads(body['output'])
self.assertEqual(404, output['result']['status']) self.assertEqual(404, output['result']['status'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@test.related_bug('1667415') @test.related_bug('1667415')
@decorators.idempotent_id('3c73de7a-4af0-4657-90d6-d7ebd3c7da18') @decorators.idempotent_id('3c73de7a-4af0-4657-90d6-d7ebd3c7da18')
def test_run_action_std_http_non_utf8_response(self): def test_run_action_std_http_non_utf8_response(self):
@ -171,7 +171,7 @@ class ActionExecutionTestsV2(base.TestCase):
output = json.loads(body['output']) output = json.loads(body['output'])
self.assertEqual(200, output['result']['status']) self.assertEqual(200, output['result']['status'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('d98586bf-fdc4-44f6-9837-700d35b5f889') @decorators.idempotent_id('d98586bf-fdc4-44f6-9837-700d35b5f889')
def test_create_action_execution(self): def test_create_action_execution(self):
resp, body = self.client.create_action_execution( resp, body = self.client.create_action_execution(
@ -199,7 +199,7 @@ class ActionExecutionTestsV2(base.TestCase):
output output
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('99f22c17-6fb4-4480-96d3-4a82672916b7') @decorators.idempotent_id('99f22c17-6fb4-4480-96d3-4a82672916b7')
def test_delete_nonexistent_action_execution(self): def test_delete_nonexistent_action_execution(self):
self.assertRaises( self.assertRaises(
@ -209,7 +209,7 @@ class ActionExecutionTestsV2(base.TestCase):
'nonexist' 'nonexist'
) )
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('2dbd74ba-4950-4c52-8bd3-070d634dcd05') @decorators.idempotent_id('2dbd74ba-4950-4c52-8bd3-070d634dcd05')
def test_create_action_execution_sync(self): def test_create_action_execution_sync(self):
token = self.client.auth_provider.get_token() token = self.client.auth_provider.get_token()

View File

@ -15,7 +15,6 @@
import datetime import datetime
from tempest.lib import decorators from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from mistral import utils from mistral import utils
from mistral_tempest_tests.tests import base from mistral_tempest_tests.tests import base
@ -37,7 +36,7 @@ class ActionTestsV2(base.TestCase):
super(ActionTestsV2, self).tearDown() super(ActionTestsV2, self).tearDown()
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('2e1a578a-1c27-409a-96be-84b5c41498cd') @decorators.idempotent_id('2e1a578a-1c27-409a-96be-84b5c41498cd')
def test_get_list_actions(self): def test_get_list_actions(self):
resp, body = self.client.get_list_obj('actions') resp, body = self.client.get_list_obj('actions')
@ -46,7 +45,7 @@ class ActionTestsV2(base.TestCase):
self.assertNotEmpty(body['actions']) self.assertNotEmpty(body['actions'])
self.assertNotIn('next', body) self.assertNotIn('next', body)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('786ee85c-c32d-4ac9-8f45-79ab6bc47ef1') @decorators.idempotent_id('786ee85c-c32d-4ac9-8f45-79ab6bc47ef1')
def test_get_list_actions_with_pagination(self): def test_get_list_actions_with_pagination(self):
resp, body = self.client.get_list_obj( resp, body = self.client.get_list_obj(
@ -86,7 +85,7 @@ class ActionTestsV2(base.TestCase):
self.assertGreater(name_1, name_2) self.assertGreater(name_1, name_2)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('5148358e-200f-49c7-8e88-1ddeec61c6a9') @decorators.idempotent_id('5148358e-200f-49c7-8e88-1ddeec61c6a9')
def test_get_list_actions_nonexist_sort_dirs(self): def test_get_list_actions_nonexist_sort_dirs(self):
context = self.assertRaises( context = self.assertRaises(
@ -100,7 +99,7 @@ class ActionTestsV2(base.TestCase):
context.resp_body.get('faultstring') context.resp_body.get('faultstring')
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('85482ce8-70f4-47a6-9e80-de1ac22b6412') @decorators.idempotent_id('85482ce8-70f4-47a6-9e80-de1ac22b6412')
def test_get_list_actions_invalid_limit(self): def test_get_list_actions_invalid_limit(self):
context = self.assertRaises( context = self.assertRaises(
@ -114,7 +113,7 @@ class ActionTestsV2(base.TestCase):
context.resp_body.get('faultstring') context.resp_body.get('faultstring')
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('a203e75b-2013-422f-b9eb-da4375041058') @decorators.idempotent_id('a203e75b-2013-422f-b9eb-da4375041058')
def test_get_list_actions_duplicate_sort_keys(self): def test_get_list_actions_duplicate_sort_keys(self):
context = self.assertRaises( context = self.assertRaises(
@ -128,7 +127,7 @@ class ActionTestsV2(base.TestCase):
context.resp_body.get('faultstring') context.resp_body.get('faultstring')
) )
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('9a53af71-8f1e-4ad5-b572-2c4c621715c0') @decorators.idempotent_id('9a53af71-8f1e-4ad5-b572-2c4c621715c0')
def test_get_list_actions_equal_to_filter(self): def test_get_list_actions_equal_to_filter(self):
resp, body = self.client.create_action('action_v2.yaml') resp, body = self.client.create_action('action_v2.yaml')
@ -144,7 +143,7 @@ class ActionTestsV2(base.TestCase):
for act in body['actions']: for act in body['actions']:
self.assertFalse(act['is_system']) self.assertFalse(act['is_system'])
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('3c3d28ce-9490-41ae-a918-c28f843841e1') @decorators.idempotent_id('3c3d28ce-9490-41ae-a918-c28f843841e1')
def test_get_list_actions_not_equal_to_filter(self): def test_get_list_actions_not_equal_to_filter(self):
resp, body = self.client.create_action('action_v2.yaml') resp, body = self.client.create_action('action_v2.yaml')
@ -160,7 +159,7 @@ class ActionTestsV2(base.TestCase):
for act in body['actions']: for act in body['actions']:
self.assertTrue(act['is_system']) self.assertTrue(act['is_system'])
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('84823a84-5caa-427d-8a2c-622a1d1893b1') @decorators.idempotent_id('84823a84-5caa-427d-8a2c-622a1d1893b1')
def test_get_list_actions_in_list_filter(self): def test_get_list_actions_in_list_filter(self):
resp, body = self.client.create_action('action_v2.yaml') resp, body = self.client.create_action('action_v2.yaml')
@ -177,7 +176,7 @@ class ActionTestsV2(base.TestCase):
action_names = [action['name'] for action in body['actions']] action_names = [action['name'] for action in body['actions']]
self.assertListEqual(created_acts, action_names) self.assertListEqual(created_acts, action_names)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('4b05dfcf-ef39-4032-9528-c8422c7329dd') @decorators.idempotent_id('4b05dfcf-ef39-4032-9528-c8422c7329dd')
def test_get_list_actions_not_in_list_filter(self): def test_get_list_actions_not_in_list_filter(self):
resp, body = self.client.create_action('action_v2.yaml') resp, body = self.client.create_action('action_v2.yaml')
@ -195,7 +194,7 @@ class ActionTestsV2(base.TestCase):
for act in created_acts: for act in created_acts:
self.assertNotIn(act, action_names) self.assertNotIn(act, action_names)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('20b3d527-447d-492b-8cb7-ac5e3757d7d5') @decorators.idempotent_id('20b3d527-447d-492b-8cb7-ac5e3757d7d5')
def test_get_list_actions_greater_than_filter(self): def test_get_list_actions_greater_than_filter(self):
time = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") time = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")
@ -206,7 +205,7 @@ class ActionTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEmpty(body['actions']) self.assertEmpty(body['actions'])
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('7f598dba-f169-47ec-a487-f0ed31484aff') @decorators.idempotent_id('7f598dba-f169-47ec-a487-f0ed31484aff')
def test_get_list_actions_greater_than_equal_to_filter(self): def test_get_list_actions_greater_than_equal_to_filter(self):
resp, body = self.client.create_action('action_v2.yaml') resp, body = self.client.create_action('action_v2.yaml')
@ -223,7 +222,7 @@ class ActionTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertIn(created_acts[0], actions) self.assertIn(created_acts[0], actions)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('874fb57d-a762-4dc3-841d-396657510d23') @decorators.idempotent_id('874fb57d-a762-4dc3-841d-396657510d23')
def test_get_list_actions_less_than_filter(self): def test_get_list_actions_less_than_filter(self):
resp, body = self.client.create_action('action_v2.yaml') resp, body = self.client.create_action('action_v2.yaml')
@ -240,7 +239,7 @@ class ActionTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertNotIn(created_acts[0], actions) self.assertNotIn(created_acts[0], actions)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('1fda6c31-b0c3-4b78-9f67-b920e1f6c973') @decorators.idempotent_id('1fda6c31-b0c3-4b78-9f67-b920e1f6c973')
def test_get_list_actions_less_than_equal_to_filter(self): def test_get_list_actions_less_than_equal_to_filter(self):
resp, body = self.client.create_action('action_v2.yaml') resp, body = self.client.create_action('action_v2.yaml')
@ -257,7 +256,7 @@ class ActionTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertIn(created_acts[0], actions) self.assertIn(created_acts[0], actions)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('cbb716f1-7fc7-4884-8fa9-6ff2bc35ee29') @decorators.idempotent_id('cbb716f1-7fc7-4884-8fa9-6ff2bc35ee29')
def test_get_list_actions_multiple_filter(self): def test_get_list_actions_multiple_filter(self):
resp, body = self.client.create_action('action_v2.yaml') resp, body = self.client.create_action('action_v2.yaml')
@ -275,7 +274,7 @@ class ActionTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertIn(created_acts[0], actions) self.assertIn(created_acts[0], actions)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('45fdc1f3-4d89-4035-9b76-08ef94c92628') @decorators.idempotent_id('45fdc1f3-4d89-4035-9b76-08ef94c92628')
def test_get_list_actions_invalid_filter(self): def test_get_list_actions_invalid_filter(self):
self.assertRaises( self.assertRaises(
@ -294,7 +293,7 @@ class ActionTestsV2(base.TestCase):
'actions?created_at>2016-02-23%2008:51:26' 'actions?created_at>2016-02-23%2008:51:26'
) )
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('5dbceaf3-6a32-4a4f-9427-1bbdb6f3c574') @decorators.idempotent_id('5dbceaf3-6a32-4a4f-9427-1bbdb6f3c574')
def test_create_and_delete_few_actions(self): def test_create_and_delete_few_actions(self):
resp, body = self.client.create_action('action_v2.yaml') resp, body = self.client.create_action('action_v2.yaml')
@ -318,7 +317,7 @@ class ActionTestsV2(base.TestCase):
self.assertNotIn(act, actions) self.assertNotIn(act, actions)
self.client.actions.remove(act) self.client.actions.remove(act)
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('d7dad5de-6b1f-4813-b789-78f075252639') @decorators.idempotent_id('d7dad5de-6b1f-4813-b789-78f075252639')
def test_get_action(self): def test_get_action(self):
_, body = self.client.create_action('action_v2.yaml') _, body = self.client.create_action('action_v2.yaml')
@ -328,7 +327,7 @@ class ActionTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEqual(action_name, body['name']) self.assertEqual(action_name, body['name'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('21a031c8-8e2d-421f-8dfe-71a3b5e44381') @decorators.idempotent_id('21a031c8-8e2d-421f-8dfe-71a3b5e44381')
def test_update_action(self): def test_update_action(self):
_, body = self.client.create_action('action_v2.yaml') _, body = self.client.create_action('action_v2.yaml')
@ -352,7 +351,7 @@ class ActionTestsV2(base.TestCase):
self.assertTrue(all(['updated_at' in item self.assertTrue(all(['updated_at' in item
for item in body['actions']])) for item in body['actions']]))
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('329b1030-c55c-45f0-8129-cc892bc23dcc') @decorators.idempotent_id('329b1030-c55c-45f0-8129-cc892bc23dcc')
def test_get_action_definition(self): def test_get_action_definition(self):
_, body = self.client.create_action('action_v2.yaml') _, body = self.client.create_action('action_v2.yaml')
@ -363,7 +362,7 @@ class ActionTestsV2(base.TestCase):
self.assertIsNotNone(body) self.assertIsNotNone(body)
self.assertIn(act_name, body) self.assertIn(act_name, body)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('c2b5be88-571a-4855-922f-9a338dba6adb') @decorators.idempotent_id('c2b5be88-571a-4855-922f-9a338dba6adb')
def test_get_nonexistent_action(self): def test_get_nonexistent_action(self):
self.assertRaises( self.assertRaises(
@ -372,7 +371,7 @@ class ActionTestsV2(base.TestCase):
'actions', 'nonexist' 'actions', 'nonexist'
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('fc2fafcb-9bb4-4a18-a507-3f9964f4a08a') @decorators.idempotent_id('fc2fafcb-9bb4-4a18-a507-3f9964f4a08a')
def test_double_creation(self): def test_double_creation(self):
self.client.create_action('action_v2.yaml') self.client.create_action('action_v2.yaml')
@ -383,7 +382,7 @@ class ActionTestsV2(base.TestCase):
'action_v2.yaml' 'action_v2.yaml'
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('0c456a73-9c39-4aeb-b3ca-3ea4338bc9ab') @decorators.idempotent_id('0c456a73-9c39-4aeb-b3ca-3ea4338bc9ab')
def test_create_action_invalid_def(self): def test_create_action_invalid_def(self):
self.assertRaises( self.assertRaises(
@ -392,7 +391,7 @@ class ActionTestsV2(base.TestCase):
'wb_v2.yaml' 'wb_v2.yaml'
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('469677b5-22ab-4e2a-aee6-5bcc9dac93de') @decorators.idempotent_id('469677b5-22ab-4e2a-aee6-5bcc9dac93de')
def test_update_action_invalid_def(self): def test_update_action_invalid_def(self):
self.assertRaises( self.assertRaises(
@ -401,7 +400,7 @@ class ActionTestsV2(base.TestCase):
'actions', 'wb_v2.yaml' 'actions', 'wb_v2.yaml'
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('ab444607-40fc-47cb-982f-83762d5b64c9') @decorators.idempotent_id('ab444607-40fc-47cb-982f-83762d5b64c9')
def test_delete_nonexistent_action(self): def test_delete_nonexistent_action(self):
self.assertRaises( self.assertRaises(
@ -410,7 +409,7 @@ class ActionTestsV2(base.TestCase):
'actions', 'nonexist' 'actions', 'nonexist'
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('74d0d480-793a-46ca-b88a-8336c1897f3a') @decorators.idempotent_id('74d0d480-793a-46ca-b88a-8336c1897f3a')
def test_delete_standard_action(self): def test_delete_standard_action(self):
self.assertRaises( self.assertRaises(

View File

@ -15,7 +15,6 @@
from oslo_concurrency.fixture import lockutils from oslo_concurrency.fixture import lockutils
from tempest.lib import decorators from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from mistral_tempest_tests.tests import base from mistral_tempest_tests.tests import base
@ -42,7 +41,7 @@ class CronTriggerTestsV2(base.TestCase):
super(CronTriggerTestsV2, self).tearDown() super(CronTriggerTestsV2, self).tearDown()
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('c53b44dd-59b3-4a4b-b22a-21abb4cecea0') @decorators.idempotent_id('c53b44dd-59b3-4a4b-b22a-21abb4cecea0')
def test_get_list_cron_triggers(self): def test_get_list_cron_triggers(self):
resp, body = self.client.get_list_obj('cron_triggers') resp, body = self.client.get_list_obj('cron_triggers')
@ -50,7 +49,7 @@ class CronTriggerTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEmpty(body['cron_triggers']) self.assertEmpty(body['cron_triggers'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('fbc641fa-8704-45b3-b259-136eb956394c') @decorators.idempotent_id('fbc641fa-8704-45b3-b259-136eb956394c')
def test_create_and_delete_cron_triggers(self): def test_create_and_delete_cron_triggers(self):
tr_name = 'trigger' tr_name = 'trigger'
@ -74,7 +73,7 @@ class CronTriggerTestsV2(base.TestCase):
trs_names = [tr['name'] for tr in body['cron_triggers']] trs_names = [tr['name'] for tr in body['cron_triggers']]
self.assertNotIn(tr_name, trs_names) self.assertNotIn(tr_name, trs_names)
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('b8b9102e-b323-492f-af41-4f5368971e36') @decorators.idempotent_id('b8b9102e-b323-492f-af41-4f5368971e36')
def test_create_and_delete_oneshot_cron_triggers(self): def test_create_and_delete_oneshot_cron_triggers(self):
tr_name = 'trigger' tr_name = 'trigger'
@ -99,7 +98,7 @@ class CronTriggerTestsV2(base.TestCase):
trs_names = [tr['name'] for tr in body['cron_triggers']] trs_names = [tr['name'] for tr in body['cron_triggers']]
self.assertNotIn(tr_name, trs_names) self.assertNotIn(tr_name, trs_names)
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('5224359b-3c31-4fe7-a4eb-dc9da843137e') @decorators.idempotent_id('5224359b-3c31-4fe7-a4eb-dc9da843137e')
def test_create_two_cron_triggers_for_one_wf(self): def test_create_two_cron_triggers_for_one_wf(self):
tr_name_1 = 'trigger1' tr_name_1 = 'trigger1'
@ -122,7 +121,7 @@ class CronTriggerTestsV2(base.TestCase):
self.assertIn(tr_name_1, trs_names) self.assertIn(tr_name_1, trs_names)
self.assertIn(tr_name_2, trs_names) self.assertIn(tr_name_2, trs_names)
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('967da6e3-f9a2-430a-9390-0d73f2143aba') @decorators.idempotent_id('967da6e3-f9a2-430a-9390-0d73f2143aba')
def test_get_cron_trigger(self): def test_get_cron_trigger(self):
tr_name = 'trigger' tr_name = 'trigger'
@ -134,42 +133,42 @@ class CronTriggerTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEqual(tr_name, body['name']) self.assertEqual(tr_name, body['name'])
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('d0e4d894-9a50-4919-a008-a9f255b6b6a3') @decorators.idempotent_id('d0e4d894-9a50-4919-a008-a9f255b6b6a3')
def test_create_cron_trigger_nonexistent_wf(self): def test_create_cron_trigger_nonexistent_wf(self):
self.assertRaises(exceptions.NotFound, self.assertRaises(exceptions.NotFound,
self.client.create_cron_trigger, self.client.create_cron_trigger,
'trigger', 'nonexist', None, '5 * * * *') 'trigger', 'nonexist', None, '5 * * * *')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('83f0d420-fd3c-4e75-87b1-854cefb28bda') @decorators.idempotent_id('83f0d420-fd3c-4e75-87b1-854cefb28bda')
def test_create_cron_trigger_invalid_count(self): def test_create_cron_trigger_invalid_count(self):
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
self.client.create_cron_trigger, self.client.create_cron_trigger,
'trigger', 'nonexist', None, '5 * * * *', None, "q") 'trigger', 'nonexist', None, '5 * * * *', None, "q")
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('4190e0af-3c64-4f57-a0b8-d9d3d41fd323') @decorators.idempotent_id('4190e0af-3c64-4f57-a0b8-d9d3d41fd323')
def test_create_cron_trigger_negative_count(self): def test_create_cron_trigger_negative_count(self):
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
self.client.create_cron_trigger, self.client.create_cron_trigger,
'trigger', 'nonexist', None, '5 * * * *', None, -1) 'trigger', 'nonexist', None, '5 * * * *', None, -1)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('210c37e8-990e-4260-b3b3-93f254e6a4d7') @decorators.idempotent_id('210c37e8-990e-4260-b3b3-93f254e6a4d7')
def test_create_cron_trigger_invalid_first_date(self): def test_create_cron_trigger_invalid_first_date(self):
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
self.client.create_cron_trigger, self.client.create_cron_trigger,
'trigger', 'nonexist', None, '5 * * * *', "q") 'trigger', 'nonexist', None, '5 * * * *', "q")
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('17990a39-8f66-4748-8ba5-ca87befbb198') @decorators.idempotent_id('17990a39-8f66-4748-8ba5-ca87befbb198')
def test_create_cron_trigger_count_only(self): def test_create_cron_trigger_count_only(self):
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
self.client.create_cron_trigger, self.client.create_cron_trigger,
'trigger', 'nonexist', None, None, None, "42") 'trigger', 'nonexist', None, None, None, "42")
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('029e0a1e-2252-4a37-b9bd-cfbe407c6ade') @decorators.idempotent_id('029e0a1e-2252-4a37-b9bd-cfbe407c6ade')
def test_create_cron_trigger_date_and_count_without_pattern(self): def test_create_cron_trigger_date_and_count_without_pattern(self):
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
@ -177,21 +176,21 @@ class CronTriggerTestsV2(base.TestCase):
'trigger', 'nonexist', None, None, 'trigger', 'nonexist', None, None,
"4242-12-25 13:37", "42") "4242-12-25 13:37", "42")
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('54650d60-ec17-44b7-8732-2183852789ae') @decorators.idempotent_id('54650d60-ec17-44b7-8732-2183852789ae')
def test_get_nonexistent_cron_trigger(self): def test_get_nonexistent_cron_trigger(self):
self.assertRaises(exceptions.NotFound, self.assertRaises(exceptions.NotFound,
self.client.get_object, self.client.get_object,
'cron_triggers', 'trigger') 'cron_triggers', 'trigger')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('c663599e-5cd7-49ff-9c0f-f82a5bcc5fdb') @decorators.idempotent_id('c663599e-5cd7-49ff-9c0f-f82a5bcc5fdb')
def test_delete_nonexistent_trigger(self): def test_delete_nonexistent_trigger(self):
self.assertRaises(exceptions.NotFound, self.assertRaises(exceptions.NotFound,
self.client.delete_obj, self.client.delete_obj,
'cron_triggers', 'trigger') 'cron_triggers', 'trigger')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('d1328d2b-5dc2-4521-93ec-d734d5fb4df7') @decorators.idempotent_id('d1328d2b-5dc2-4521-93ec-d734d5fb4df7')
def test_create_two_cron_triggers_with_same_name(self): def test_create_two_cron_triggers_with_same_name(self):
tr_name = 'trigger' tr_name = 'trigger'
@ -201,7 +200,7 @@ class CronTriggerTestsV2(base.TestCase):
self.client.create_cron_trigger, self.client.create_cron_trigger,
tr_name, self.wf_name, None, '5 * * * *') tr_name, self.wf_name, None, '5 * * * *')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('3e51fc44-ce38-4653-9e4e-08b077a1dbc5') @decorators.idempotent_id('3e51fc44-ce38-4653-9e4e-08b077a1dbc5')
def test_create_two_cron_triggers_with_same_pattern(self): def test_create_two_cron_triggers_with_same_pattern(self):
self.client.create_cron_trigger( self.client.create_cron_trigger(
@ -223,14 +222,14 @@ class CronTriggerTestsV2(base.TestCase):
"42" "42"
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('6f3c08f3-9498-410e-a44b-4f9c6c971405') @decorators.idempotent_id('6f3c08f3-9498-410e-a44b-4f9c6c971405')
def test_invalid_cron_pattern_not_enough_params(self): def test_invalid_cron_pattern_not_enough_params(self):
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
self.client.create_cron_trigger, self.client.create_cron_trigger,
'trigger', self.wf_name, None, '5 *') 'trigger', self.wf_name, None, '5 *')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('26cb52e7-1ef3-45a2-a870-1baec2382c55') @decorators.idempotent_id('26cb52e7-1ef3-45a2-a870-1baec2382c55')
def test_invalid_cron_pattern_out_of_range(self): def test_invalid_cron_pattern_out_of_range(self):
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,

View File

@ -14,7 +14,6 @@
from tempest.lib import decorators from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from mistral_tempest_tests.tests import base from mistral_tempest_tests.tests import base
@ -52,7 +51,7 @@ class EventTriggerTestsV2(base.TestCase):
super(EventTriggerTestsV2, self).tearDown() super(EventTriggerTestsV2, self).tearDown()
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('cfdf9aee-09ce-49bf-af05-97c5542bc131') @decorators.idempotent_id('cfdf9aee-09ce-49bf-af05-97c5542bc131')
def test_create_get_delete_event_trigger(self): def test_create_get_delete_event_trigger(self):
name = 'my_event_trigger' name = 'my_event_trigger'
@ -79,21 +78,21 @@ class EventTriggerTestsV2(base.TestCase):
trs_names = [tr['name'] for tr in body['event_triggers']] trs_names = [tr['name'] for tr in body['event_triggers']]
self.assertNotIn(name, trs_names) self.assertNotIn(name, trs_names)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('20e547d6-9a16-4cac-9b1a-f3520c58cdd7') @decorators.idempotent_id('20e547d6-9a16-4cac-9b1a-f3520c58cdd7')
def test_create_event_trigger_without_necessary_param(self): def test_create_event_trigger_without_necessary_param(self):
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
self.client.create_event_trigger, self.client.create_event_trigger,
self.wf_id, EXCHANGE, EVENT_ENGINE_TOPIC, '') self.wf_id, EXCHANGE, EVENT_ENGINE_TOPIC, '')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('ed02f500-9436-4a7b-a135-f210e1c32b22') @decorators.idempotent_id('ed02f500-9436-4a7b-a135-f210e1c32b22')
def test_create_event_trigger_with_nonexist_wf(self): def test_create_event_trigger_with_nonexist_wf(self):
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
self.client.create_event_trigger, self.client.create_event_trigger,
'nonexist', EXCHANGE, EVENT_ENGINE_TOPIC, EVENT) 'nonexist', EXCHANGE, EVENT_ENGINE_TOPIC, EVENT)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('0ab556b6-ab76-492e-8eef-c79955003a93') @decorators.idempotent_id('0ab556b6-ab76-492e-8eef-c79955003a93')
def test_create_event_trigger_duplicate(self): def test_create_event_trigger_duplicate(self):
name = 'my_event_trigger' name = 'my_event_trigger'
@ -105,7 +104,7 @@ class EventTriggerTestsV2(base.TestCase):
self.client.create_event_trigger, self.client.create_event_trigger,
self.wf_id, EXCHANGE, EVENT_ENGINE_TOPIC, EVENT) self.wf_id, EXCHANGE, EVENT_ENGINE_TOPIC, EVENT)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('56b90a90-9ff3-42f8-a9eb-04a77198710e') @decorators.idempotent_id('56b90a90-9ff3-42f8-a9eb-04a77198710e')
def test_get_nonexistent_event_trigger(self): def test_get_nonexistent_event_trigger(self):
fake_id = '123e4567-e89b-12d3-a456-426655440000' fake_id = '123e4567-e89b-12d3-a456-426655440000'

View File

@ -15,7 +15,6 @@
from oslo_concurrency.fixture import lockutils from oslo_concurrency.fixture import lockutils
from tempest.lib import decorators from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from mistral import utils from mistral import utils
from mistral_tempest_tests.tests import base from mistral_tempest_tests.tests import base
@ -47,14 +46,14 @@ class ExecutionTestsV2(base.TestCase):
super(ExecutionTestsV2, self).tearDown() super(ExecutionTestsV2, self).tearDown()
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('c0b4b658-6f01-4680-b402-2f683b3d78b6') @decorators.idempotent_id('c0b4b658-6f01-4680-b402-2f683b3d78b6')
def test_get_list_executions(self): def test_get_list_executions(self):
resp, body = self.client.get_list_obj('executions') resp, body = self.client.get_list_obj('executions')
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertNotIn('next', body) self.assertNotIn('next', body)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('0bfcb4b0-b1e4-4499-b81b-0e86c8a2a841') @decorators.idempotent_id('0bfcb4b0-b1e4-4499-b81b-0e86c8a2a841')
def test_get_list_executions_with_pagination(self): def test_get_list_executions_with_pagination(self):
resp, body = self.client.create_execution(self.direct_wf_name) resp, body = self.client.create_execution(self.direct_wf_name)
@ -110,7 +109,7 @@ class ExecutionTestsV2(base.TestCase):
self.assertGreater(workflow_name_2, workflow_name_1) self.assertGreater(workflow_name_2, workflow_name_1)
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('5d8ebe04-8de6-414d-908f-213af59e4c6a') @decorators.idempotent_id('5d8ebe04-8de6-414d-908f-213af59e4c6a')
def test_create_execution_for_direct_wf(self): def test_create_execution_for_direct_wf(self):
resp, body = self.client.create_execution(self.direct_wf_name) resp, body = self.client.create_execution(self.direct_wf_name)
@ -123,7 +122,7 @@ class ExecutionTestsV2(base.TestCase):
self.assertIn(exec_id, self.assertIn(exec_id,
[ex_id['id'] for ex_id in body['executions']]) [ex_id['id'] for ex_id in body['executions']])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('101bfdff-8309-4add-9504-544b15f13d95') @decorators.idempotent_id('101bfdff-8309-4add-9504-544b15f13d95')
def test_create_execution_for_reverse_wf(self): def test_create_execution_for_reverse_wf(self):
resp, body = self.client.create_execution( resp, body = self.client.create_execution(
@ -147,7 +146,7 @@ class ExecutionTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEqual('SUCCESS', body['state']) self.assertEqual('SUCCESS', body['state'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('2df30966-9c45-4a2e-942d-e74bd92cb5aa') @decorators.idempotent_id('2df30966-9c45-4a2e-942d-e74bd92cb5aa')
def test_create_execution_by_wf_id(self): def test_create_execution_by_wf_id(self):
resp, body = self.client.create_execution(self.direct_wf_id) resp, body = self.client.create_execution(self.direct_wf_id)
@ -162,7 +161,7 @@ class ExecutionTestsV2(base.TestCase):
[ex_id['id'] for ex_id in body['executions']] [ex_id['id'] for ex_id in body['executions']]
) )
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('f7f50198-2dbd-4ca1-af51-d0eadc1108ac') @decorators.idempotent_id('f7f50198-2dbd-4ca1-af51-d0eadc1108ac')
def test_get_execution(self): def test_get_execution(self):
_, execution = self.client.create_execution(self.direct_wf_name) _, execution = self.client.create_execution(self.direct_wf_name)
@ -175,7 +174,7 @@ class ExecutionTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEqual(execution['id'], body['id']) self.assertEqual(execution['id'], body['id'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('2f142ba0-6b88-4d63-8544-05c3dbfe13cc') @decorators.idempotent_id('2f142ba0-6b88-4d63-8544-05c3dbfe13cc')
def test_update_execution_pause(self): def test_update_execution_pause(self):
_, execution = self.client.create_execution(self.direct_wf_name) _, execution = self.client.create_execution(self.direct_wf_name)
@ -185,7 +184,7 @@ class ExecutionTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEqual('PAUSED', body['state']) self.assertEqual('PAUSED', body['state'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('f0557236-55ab-457d-9197-05bc2ae53e21') @decorators.idempotent_id('f0557236-55ab-457d-9197-05bc2ae53e21')
def test_update_execution_description(self): def test_update_execution_description(self):
_, execution = self.client.create_execution(self.direct_wf_name) _, execution = self.client.create_execution(self.direct_wf_name)
@ -195,7 +194,7 @@ class ExecutionTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEqual('description', body['description']) self.assertEqual('description', body['description'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('c54b4d68-b179-4339-bdab-a91cd6e819b7') @decorators.idempotent_id('c54b4d68-b179-4339-bdab-a91cd6e819b7')
def test_update_execution_fail(self): def test_update_execution_fail(self):
_, execution = self.client.create_execution(self.direct_wf_name) _, execution = self.client.create_execution(self.direct_wf_name)
@ -206,7 +205,7 @@ class ExecutionTestsV2(base.TestCase):
self.assertEqual('ERROR', body['state']) self.assertEqual('ERROR', body['state'])
self.assertEqual('Forced', body['state_info']) self.assertEqual('Forced', body['state_info'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('b5ce0d18-7d78-45bb-813e-ed94cea65fd0') @decorators.idempotent_id('b5ce0d18-7d78-45bb-813e-ed94cea65fd0')
def test_update_execution_by_admin(self): def test_update_execution_by_admin(self):
_, execution = self.client.create_execution(self.direct_wf_name) _, execution = self.client.create_execution(self.direct_wf_name)
@ -221,7 +220,7 @@ class ExecutionTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEqual("description set by admin", body['description']) self.assertEqual("description set by admin", body['description'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('c6247362-a082-49ad-a2c3-aaf12419a477') @decorators.idempotent_id('c6247362-a082-49ad-a2c3-aaf12419a477')
def test_update_execution_by_other_fail(self): def test_update_execution_by_other_fail(self):
_, execution = self.client.create_execution(self.direct_wf_name) _, execution = self.client.create_execution(self.direct_wf_name)
@ -233,13 +232,13 @@ class ExecutionTestsV2(base.TestCase):
'{"description": "description set by admin"}' '{"description": "description set by admin"}'
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('d8bde271-6785-4ace-9173-a8a3a01d5eaa') @decorators.idempotent_id('d8bde271-6785-4ace-9173-a8a3a01d5eaa')
def test_get_nonexistent_execution(self): def test_get_nonexistent_execution(self):
self.assertRaises(exceptions.NotFound, self.client.get_object, self.assertRaises(exceptions.NotFound, self.client.get_object,
'executions', '1a2b3c') 'executions', '1a2b3c')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('e26e31ba-88cf-4b90-8b3a-fd4ecc612252') @decorators.idempotent_id('e26e31ba-88cf-4b90-8b3a-fd4ecc612252')
def test_update_nonexistent_execution(self): def test_update_nonexistent_execution(self):
put_body = '{"state": "STOPPED"}' put_body = '{"state": "STOPPED"}'
@ -248,21 +247,21 @@ class ExecutionTestsV2(base.TestCase):
self.client.update_execution, self.client.update_execution,
'1a2b3c', put_body) '1a2b3c', put_body)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('b337e270-b3b6-41e2-8de2-05030b06fc37') @decorators.idempotent_id('b337e270-b3b6-41e2-8de2-05030b06fc37')
def test_delete_nonexistent_execution(self): def test_delete_nonexistent_execution(self):
self.assertRaises(exceptions.NotFound, self.assertRaises(exceptions.NotFound,
self.client.delete_obj, self.client.delete_obj,
'executions', 'nonexist') 'executions', 'nonexist')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('46f7b4b0-7d4a-4bdc-b2b6-46343cdd6f3a') @decorators.idempotent_id('46f7b4b0-7d4a-4bdc-b2b6-46343cdd6f3a')
def test_create_ex_for_nonexistent_wf(self): def test_create_ex_for_nonexistent_wf(self):
self.assertRaises(exceptions.NotFound, self.assertRaises(exceptions.NotFound,
self.client.create_execution, self.client.create_execution,
'nonexist') 'nonexist')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('9d27247e-b4d4-40ab-9181-9986655a6be4') @decorators.idempotent_id('9d27247e-b4d4-40ab-9181-9986655a6be4')
def test_create_execution_for_reverse_wf_invalid_start_task(self): def test_create_execution_for_reverse_wf_invalid_start_task(self):
self.assertRaises( self.assertRaises(
@ -273,7 +272,7 @@ class ExecutionTestsV2(base.TestCase):
{"task_name": "nonexist"} {"task_name": "nonexist"}
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('0d6ac42b-4059-40ef-99d0-a65b3cd1837c') @decorators.idempotent_id('0d6ac42b-4059-40ef-99d0-a65b3cd1837c')
def test_create_execution_forgot_input_params(self): def test_create_execution_forgot_input_params(self):
self.assertRaises( self.assertRaises(
@ -283,7 +282,7 @@ class ExecutionTestsV2(base.TestCase):
params={"task_name": "nonexist"} params={"task_name": "nonexist"}
) )
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('52779c73-7563-47b2-8231-a24d6bf531a7') @decorators.idempotent_id('52779c73-7563-47b2-8231-a24d6bf531a7')
def test_action_ex_concurrency(self): def test_action_ex_concurrency(self):
resp, wf = self.client.create_workflow("wf_action_ex_concurrency.yaml") resp, wf = self.client.create_workflow("wf_action_ex_concurrency.yaml")
@ -297,7 +296,7 @@ class ExecutionTestsV2(base.TestCase):
self.client.wait_execution_success(execution) self.client.wait_execution_success(execution)
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('eb061c4d-2892-47f0-81e6-37ba15c376bb') @decorators.idempotent_id('eb061c4d-2892-47f0-81e6-37ba15c376bb')
def test_task_ex_concurrency(self): def test_task_ex_concurrency(self):
resp, wf = self.client.create_workflow("wf_task_ex_concurrency.yaml") resp, wf = self.client.create_workflow("wf_task_ex_concurrency.yaml")
@ -311,7 +310,7 @@ class ExecutionTestsV2(base.TestCase):
self.client.wait_execution(execution, target_state='ERROR') self.client.wait_execution(execution, target_state='ERROR')
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('acc8e401-2b26-4c41-9e79-8da791da85c0') @decorators.idempotent_id('acc8e401-2b26-4c41-9e79-8da791da85c0')
def test_delete_execution_by_admin(self): def test_delete_execution_by_admin(self):
_, body = self.client.create_execution(self.direct_wf_id) _, body = self.client.create_execution(self.direct_wf_id)

View File

@ -14,7 +14,6 @@
from oslo_concurrency.fixture import lockutils from oslo_concurrency.fixture import lockutils
from tempest.lib import decorators from tempest.lib import decorators
from tempest import test
from mistral_tempest_tests.tests import base from mistral_tempest_tests.tests import base
@ -42,7 +41,7 @@ class TasksTestsV2(base.TestCase):
super(TasksTestsV2, self).tearDown() super(TasksTestsV2, self).tearDown()
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('81159dce-3802-44ee-a8d4-5ddca106fd91') @decorators.idempotent_id('81159dce-3802-44ee-a8d4-5ddca106fd91')
def test_get_tasks_list(self): def test_get_tasks_list(self):
resp, body = self.client.get_list_obj('tasks') resp, body = self.client.get_list_obj('tasks')
@ -50,7 +49,7 @@ class TasksTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertNotEmpty(body['tasks']) self.assertNotEmpty(body['tasks'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('f62664de-bd2b-4153-8d0f-5a76d78abbad') @decorators.idempotent_id('f62664de-bd2b-4153-8d0f-5a76d78abbad')
def test_get_task(self): def test_get_task(self):
resp, body = self.client.get_list_obj('tasks') resp, body = self.client.get_list_obj('tasks')
@ -60,7 +59,7 @@ class TasksTestsV2(base.TestCase):
self.direct_wf_name, body['tasks'][-1]['workflow_name'] self.direct_wf_name, body['tasks'][-1]['workflow_name']
) )
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('3230d694-40fd-4094-ad12-024f40a21b94') @decorators.idempotent_id('3230d694-40fd-4094-ad12-024f40a21b94')
def test_get_tasks_of_execution(self): def test_get_tasks_of_execution(self):
resp, body = self.client.get_list_obj( resp, body = self.client.get_list_obj(
@ -86,7 +85,7 @@ class TaskTypesTestsV2(base.TestCase):
self.nested_wf_name = 'wb_with_nested_wf.wrapping_wf' self.nested_wf_name = 'wb_with_nested_wf.wrapping_wf'
_, execution = self.client.create_execution(self.nested_wf_name) _, execution = self.client.create_execution(self.nested_wf_name)
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('1ac726eb-b945-4b82-8755-a2fb2dc009bc') @decorators.idempotent_id('1ac726eb-b945-4b82-8755-a2fb2dc009bc')
def test_task_type(self): def test_task_type(self):
resp, body = self.client.get_list_obj('tasks') resp, body = self.client.get_list_obj('tasks')

View File

@ -15,7 +15,6 @@
from oslo_concurrency.fixture import lockutils from oslo_concurrency.fixture import lockutils
from tempest.lib import decorators from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from mistral_tempest_tests.tests import base from mistral_tempest_tests.tests import base
@ -31,7 +30,7 @@ class WorkbookTestsV2(base.TestCase):
super(WorkbookTestsV2, self).tearDown() super(WorkbookTestsV2, self).tearDown()
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('4d8752b9-8d69-4d81-8710-5dd8ef699b95') @decorators.idempotent_id('4d8752b9-8d69-4d81-8710-5dd8ef699b95')
def test_get_list_workbooks(self): def test_get_list_workbooks(self):
resp, body = self.client.get_list_obj('workbooks') resp, body = self.client.get_list_obj('workbooks')
@ -39,7 +38,7 @@ class WorkbookTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEmpty(body['workbooks']) self.assertEmpty(body['workbooks'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('1a078ca2-bcf9-4eb9-8ed5-e3545038aa76') @decorators.idempotent_id('1a078ca2-bcf9-4eb9-8ed5-e3545038aa76')
def test_create_and_delete_workbook(self): def test_create_and_delete_workbook(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -57,7 +56,7 @@ class WorkbookTestsV2(base.TestCase):
_, body = self.client.get_list_obj('workbooks') _, body = self.client.get_list_obj('workbooks')
self.assertEmpty(body['workbooks']) self.assertEmpty(body['workbooks'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('80f7d7a6-2821-4ab0-b090-ca45c98258ba') @decorators.idempotent_id('80f7d7a6-2821-4ab0-b090-ca45c98258ba')
def test_get_workbook(self): def test_get_workbook(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -68,7 +67,7 @@ class WorkbookTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEqual(name, body['name']) self.assertEqual(name, body['name'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('4d3b1e43-a493-41be-9c8a-389511675403') @decorators.idempotent_id('4d3b1e43-a493-41be-9c8a-389511675403')
def test_update_workbook(self): def test_update_workbook(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -79,7 +78,7 @@ class WorkbookTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEqual(name, body['name']) self.assertEqual(name, body['name'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('506cdcc2-082f-4e1f-9ab2-717acd7f0eb5') @decorators.idempotent_id('506cdcc2-082f-4e1f-9ab2-717acd7f0eb5')
def test_get_workbook_definition(self): def test_get_workbook_definition(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -90,20 +89,20 @@ class WorkbookTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertIsNotNone(body) self.assertIsNotNone(body)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('d99f11c1-05a3-4d90-89c6-8d85558d3708') @decorators.idempotent_id('d99f11c1-05a3-4d90-89c6-8d85558d3708')
def test_get_nonexistent_workbook_definition(self): def test_get_nonexistent_workbook_definition(self):
self.assertRaises(exceptions.NotFound, self.assertRaises(exceptions.NotFound,
self.client.get_definition, self.client.get_definition,
'workbooks', 'nonexist') 'workbooks', 'nonexist')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('61ed021e-ec56-42cb-ad05-eb6979aa00fd') @decorators.idempotent_id('61ed021e-ec56-42cb-ad05-eb6979aa00fd')
def test_get_nonexistent_workbook(self): def test_get_nonexistent_workbook(self):
self.assertRaises(exceptions.NotFound, self.client.get_object, self.assertRaises(exceptions.NotFound, self.client.get_object,
'workbooks', 'nonexist') 'workbooks', 'nonexist')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('e3d76f8b-220d-4250-8238-0ba27fda6de9') @decorators.idempotent_id('e3d76f8b-220d-4250-8238-0ba27fda6de9')
def test_double_create_workbook(self): def test_double_create_workbook(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -119,7 +118,7 @@ class WorkbookTestsV2(base.TestCase):
self.assertEmpty(body['workbooks']) self.assertEmpty(body['workbooks'])
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('1cd6f6f7-b166-454e-96d2-bf1f95c23015') @decorators.idempotent_id('1cd6f6f7-b166-454e-96d2-bf1f95c23015')
def test_create_wb_with_invalid_def(self): def test_create_wb_with_invalid_def(self):
self.assertRaises( self.assertRaises(
@ -128,7 +127,7 @@ class WorkbookTestsV2(base.TestCase):
'wb_v1.yaml' 'wb_v1.yaml'
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('ac9a05d3-e285-4d88-91eb-fb9ad694a89a') @decorators.idempotent_id('ac9a05d3-e285-4d88-91eb-fb9ad694a89a')
def test_update_wb_with_invalid_def(self): def test_update_wb_with_invalid_def(self):
self.assertRaises( self.assertRaises(

View File

@ -16,7 +16,6 @@ import json
from oslo_concurrency.fixture import lockutils from oslo_concurrency.fixture import lockutils
from tempest.lib import decorators from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from mistral import utils from mistral import utils
from mistral_tempest_tests.tests import base from mistral_tempest_tests.tests import base
@ -33,7 +32,7 @@ class WorkflowTestsV2(base.TestCase):
super(WorkflowTestsV2, self).tearDown() super(WorkflowTestsV2, self).tearDown()
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('e9cd6817-e8d1-4604-ba76-b0e17219f4c5') @decorators.idempotent_id('e9cd6817-e8d1-4604-ba76-b0e17219f4c5')
def test_get_list_workflows(self): def test_get_list_workflows(self):
resp, body = self.client.get_list_obj('workflows') resp, body = self.client.get_list_obj('workflows')
@ -45,7 +44,7 @@ class WorkflowTestsV2(base.TestCase):
self.assertNotIn('next', body) self.assertNotIn('next', body)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('be8a4a44-eeb3-48e3-b11d-b83ba14dbf2c') @decorators.idempotent_id('be8a4a44-eeb3-48e3-b11d-b83ba14dbf2c')
def test_get_list_workflows_by_admin(self): def test_get_list_workflows_by_admin(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -62,7 +61,7 @@ class WorkflowTestsV2(base.TestCase):
self.assertIn(name, names) self.assertIn(name, names)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('c9e2ebbc-02aa-4c33-b244-e471c8266aa7') @decorators.idempotent_id('c9e2ebbc-02aa-4c33-b244-e471c8266aa7')
def test_get_list_workflows_with_project_by_admin(self): def test_get_list_workflows_with_project_by_admin(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -83,7 +82,7 @@ class WorkflowTestsV2(base.TestCase):
self.assertIn(name, names) self.assertIn(name, names)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('b8dc1b02-8509-45e2-9df7-4630cdcfa1ab') @decorators.idempotent_id('b8dc1b02-8509-45e2-9df7-4630cdcfa1ab')
def test_get_list_other_project_private_workflows(self): def test_get_list_other_project_private_workflows(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -104,7 +103,7 @@ class WorkflowTestsV2(base.TestCase):
self.assertNotIn(name, names) self.assertNotIn(name, names)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('2063143b-ced8-4037-9383-e2504be581e6') @decorators.idempotent_id('2063143b-ced8-4037-9383-e2504be581e6')
def test_get_list_workflows_with_fields(self): def test_get_list_workflows_with_fields(self):
resp, body = self.client.get_list_obj('workflows?fields=name') resp, body = self.client.get_list_obj('workflows?fields=name')
@ -114,7 +113,7 @@ class WorkflowTestsV2(base.TestCase):
for wf in body['workflows']: for wf in body['workflows']:
self.assertListEqual(sorted(['id', 'name']), sorted(list(wf))) self.assertListEqual(sorted(['id', 'name']), sorted(list(wf)))
@test.attr(type='smoke') @decorators.attr(type='smoke')
@decorators.idempotent_id('81f28735-e74e-4dc1-8b94-b548f8a80556') @decorators.idempotent_id('81f28735-e74e-4dc1-8b94-b548f8a80556')
def test_get_list_workflows_with_pagination(self): def test_get_list_workflows_with_pagination(self):
resp, body = self.client.get_list_obj( resp, body = self.client.get_list_obj(
@ -154,7 +153,7 @@ class WorkflowTestsV2(base.TestCase):
self.assertGreater(name_1, name_2) self.assertGreater(name_1, name_2)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('cdb5586f-a72f-4371-88d1-1472675915c3') @decorators.idempotent_id('cdb5586f-a72f-4371-88d1-1472675915c3')
def test_get_list_workflows_nonexist_sort_dirs(self): def test_get_list_workflows_nonexist_sort_dirs(self):
context = self.assertRaises( context = self.assertRaises(
@ -168,7 +167,7 @@ class WorkflowTestsV2(base.TestCase):
context.resp_body.get('faultstring') context.resp_body.get('faultstring')
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('ac41a0ea-2be6-4307-9003-6b8dd52b0bf9') @decorators.idempotent_id('ac41a0ea-2be6-4307-9003-6b8dd52b0bf9')
def test_get_list_workflows_invalid_limit(self): def test_get_list_workflows_invalid_limit(self):
context = self.assertRaises( context = self.assertRaises(
@ -182,7 +181,7 @@ class WorkflowTestsV2(base.TestCase):
context.resp_body.get('faultstring') context.resp_body.get('faultstring')
) )
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('55759713-a8d7-44c2-aff1-2383f51136bd') @decorators.idempotent_id('55759713-a8d7-44c2-aff1-2383f51136bd')
def test_get_list_workflows_duplicate_sort_keys(self): def test_get_list_workflows_duplicate_sort_keys(self):
context = self.assertRaises( context = self.assertRaises(
@ -196,7 +195,7 @@ class WorkflowTestsV2(base.TestCase):
context.resp_body.get('faultstring') context.resp_body.get('faultstring')
) )
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('e26b30b9-6699-4020-93a0-e25c2daca59a') @decorators.idempotent_id('e26b30b9-6699-4020-93a0-e25c2daca59a')
def test_create_and_delete_workflow(self): def test_create_and_delete_workflow(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -219,7 +218,7 @@ class WorkflowTestsV2(base.TestCase):
names = [wf['name'] for wf in body['workflows']] names = [wf['name'] for wf in body['workflows']]
self.assertNotIn(name, names) self.assertNotIn(name, names)
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('f5a4a771-79b2-4f28-bfac-940aa83990a4') @decorators.idempotent_id('f5a4a771-79b2-4f28-bfac-940aa83990a4')
def test_get_workflow(self): def test_get_workflow(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -231,7 +230,7 @@ class WorkflowTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEqual(name, body['name']) self.assertEqual(name, body['name'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('f516aad0-9a50-4ace-a217-fa1931fd9335') @decorators.idempotent_id('f516aad0-9a50-4ace-a217-fa1931fd9335')
def test_update_workflow(self): def test_update_workflow(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -243,7 +242,7 @@ class WorkflowTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertEqual(name, body['workflows'][0]['name']) self.assertEqual(name, body['workflows'][0]['name'])
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('02bc1fc3-c31a-4e37-bb3d-eda46818505c') @decorators.idempotent_id('02bc1fc3-c31a-4e37-bb3d-eda46818505c')
def test_get_workflow_definition(self): def test_get_workflow_definition(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -255,7 +254,7 @@ class WorkflowTestsV2(base.TestCase):
self.assertEqual(200, resp.status) self.assertEqual(200, resp.status)
self.assertIsNotNone(body) self.assertIsNotNone(body)
@test.attr(type='sanity') @decorators.attr(type='sanity')
@decorators.idempotent_id('04fbd003-0e52-4034-858e-6634d4f84b29') @decorators.idempotent_id('04fbd003-0e52-4034-858e-6634d4f84b29')
def test_get_workflow_uploaded_in_wb(self): def test_get_workflow_uploaded_in_wb(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -268,20 +267,20 @@ class WorkflowTestsV2(base.TestCase):
self.assertNotEmpty(wf_names) self.assertNotEmpty(wf_names)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('5e5f0403-fb2c-41ae-bf6f-25c181515358') @decorators.idempotent_id('5e5f0403-fb2c-41ae-bf6f-25c181515358')
def test_get_nonexistent_workflow_definition(self): def test_get_nonexistent_workflow_definition(self):
self.assertRaises(exceptions.NotFound, self.assertRaises(exceptions.NotFound,
self.client.get_definition, self.client.get_definition,
'workflows', 'nonexist') 'workflows', 'nonexist')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('23c72d01-c3bb-43d6-ba15-9b49c15f800c') @decorators.idempotent_id('23c72d01-c3bb-43d6-ba15-9b49c15f800c')
def test_get_nonexistent_workflow(self): def test_get_nonexistent_workflow(self):
self.assertRaises(exceptions.NotFound, self.client.get_object, self.assertRaises(exceptions.NotFound, self.client.get_object,
'workflows', 'nonexist') 'workflows', 'nonexist')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('6b917213-7f11-423a-8fe0-55795dcf0fb2') @decorators.idempotent_id('6b917213-7f11-423a-8fe0-55795dcf0fb2')
def test_double_create_workflows(self): def test_double_create_workflows(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -290,21 +289,21 @@ class WorkflowTestsV2(base.TestCase):
self.client.create_workflow, self.client.create_workflow,
'wf_v2.yaml') 'wf_v2.yaml')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('ffcd63d2-1104-4320-a67b-fadc4e2a0631') @decorators.idempotent_id('ffcd63d2-1104-4320-a67b-fadc4e2a0631')
def test_create_wf_with_invalid_def(self): def test_create_wf_with_invalid_def(self):
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
self.client.create_workflow, self.client.create_workflow,
'wb_v1.yaml') 'wb_v1.yaml')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('eed46931-5485-436c-810f-1f63362223b9') @decorators.idempotent_id('eed46931-5485-436c-810f-1f63362223b9')
def test_update_wf_with_invalid_def(self): def test_update_wf_with_invalid_def(self):
self.assertRaises(exceptions.BadRequest, self.assertRaises(exceptions.BadRequest,
self.client.update_request, self.client.update_request,
'workflows', 'wb_v1.yaml') 'workflows', 'wb_v1.yaml')
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('9b7f5b5a-cacd-4f98-a35a-decf065b8234') @decorators.idempotent_id('9b7f5b5a-cacd-4f98-a35a-decf065b8234')
def test_delete_wf_with_trigger_associate(self): def test_delete_wf_with_trigger_associate(self):
tr_name = 'trigger' tr_name = 'trigger'
@ -324,7 +323,7 @@ class WorkflowTestsV2(base.TestCase):
self.client.delete_obj('cron_triggers', tr_name) self.client.delete_obj('cron_triggers', tr_name)
self.client.triggers.remove(tr_name) self.client.triggers.remove(tr_name)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('46325022-cbd2-48f3-95f3-e587aab3b655') @decorators.idempotent_id('46325022-cbd2-48f3-95f3-e587aab3b655')
def test_delete_wf_with_event_trigger_associate(self): def test_delete_wf_with_event_trigger_associate(self):
_, body = self.client.create_workflow('wf_v2.yaml') _, body = self.client.create_workflow('wf_v2.yaml')
@ -344,7 +343,7 @@ class WorkflowTestsV2(base.TestCase):
self.client.delete_obj('event_triggers', body['id']) self.client.delete_obj('event_triggers', body['id'])
self.client.event_triggers.remove(body['id']) self.client.event_triggers.remove(body['id'])
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('1cb929e6-d375-4dcb-ab7c-73aa205af896') @decorators.idempotent_id('1cb929e6-d375-4dcb-ab7c-73aa205af896')
def test_delete_wf_with_trigger_associate_in_other_tenant(self): def test_delete_wf_with_trigger_associate_in_other_tenant(self):
self.useFixture(lockutils.LockFixture('mistral-workflow')) self.useFixture(lockutils.LockFixture('mistral-workflow'))
@ -374,7 +373,7 @@ class WorkflowTestsV2(base.TestCase):
self.alt_client.delete_obj('cron_triggers', tr_name) self.alt_client.delete_obj('cron_triggers', tr_name)
self.alt_client.triggers.remove(tr_name) self.alt_client.triggers.remove(tr_name)
@test.attr(type='negative') @decorators.attr(type='negative')
@decorators.idempotent_id('f575713b-27fd-4ec8-b84f-468a7adf5ed2') @decorators.idempotent_id('f575713b-27fd-4ec8-b84f-468a7adf5ed2')
def test_delete_nonexistent_wf(self): def test_delete_nonexistent_wf(self):
self.assertRaises(exceptions.NotFound, self.assertRaises(exceptions.NotFound,

View File

@ -18,7 +18,6 @@ from keystoneclient import service_catalog as ks_service_catalog
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslo_utils import uuidutils from oslo_utils import uuidutils
from tempest.lib import decorators from tempest.lib import decorators
from tempest import test
from mistral_tempest_tests.tests import base from mistral_tempest_tests.tests import base
@ -30,7 +29,7 @@ class MultiVimActionsTests(base.TestCase):
def resource_setup(cls): def resource_setup(cls):
super(MultiVimActionsTests, cls).resource_setup() super(MultiVimActionsTests, cls).resource_setup()
@test.attr(type='openstack') @decorators.attr(type='openstack')
@decorators.idempotent_id('dadc9960-9c03-41a9-9a9d-7e97d527e6dd') @decorators.idempotent_id('dadc9960-9c03-41a9-9a9d-7e97d527e6dd')
def test_multi_vim_support_target_headers(self): def test_multi_vim_support_target_headers(self):
client_1 = self.alt_client client_1 = self.alt_client
@ -58,7 +57,7 @@ class MultiVimActionsTests(base.TestCase):
str(jsonutils.loads(result['output'])['result'][0]['id']) str(jsonutils.loads(result['output'])['result'][0]['id'])
) )
@test.attr(type='openstack') @decorators.attr(type='openstack')
@decorators.idempotent_id('bc0e9b99-62b0-4d96-95c9-016a3f69b02a') @decorators.idempotent_id('bc0e9b99-62b0-4d96-95c9-016a3f69b02a')
def test_multi_vim_support_target_headers_and_service_catalog(self): def test_multi_vim_support_target_headers_and_service_catalog(self):
client_1 = self.alt_client client_1 = self.alt_client

View File

@ -13,7 +13,6 @@
# limitations under the License. # limitations under the License.
from tempest.lib import decorators from tempest.lib import decorators
from tempest import test
from mistral_tempest_tests.tests import base from mistral_tempest_tests.tests import base
@ -32,7 +31,7 @@ class OpenStackActionsTestsV2(base.TestCase):
_, cls.wb = cls.client.create_workbook( _, cls.wb = cls.client.create_workbook(
'openstack/action_collection_wb.yaml') 'openstack/action_collection_wb.yaml')
@test.attr(type='openstack') @decorators.attr(type='openstack')
@decorators.idempotent_id('9a999fc2-a089-4375-bc69-e1ed85b17a82') @decorators.idempotent_id('9a999fc2-a089-4375-bc69-e1ed85b17a82')
def test_nova_actions(self): def test_nova_actions(self):
wf_name = self.wb['name'] + '.nova' wf_name = self.wb['name'] + '.nova'
@ -42,7 +41,7 @@ class OpenStackActionsTestsV2(base.TestCase):
self.assertEqual('SUCCESS', executed_task['state']) self.assertEqual('SUCCESS', executed_task['state'])
@test.attr(type='openstack') @decorators.attr(type='openstack')
@decorators.idempotent_id('81bdc1c9-cd9a-4c97-b8ce-e44f5211eace') @decorators.idempotent_id('81bdc1c9-cd9a-4c97-b8ce-e44f5211eace')
def test_keystone_actions(self): def test_keystone_actions(self):
wf_name = self.wb['name'] + '.keystone' wf_name = self.wb['name'] + '.keystone'
@ -52,7 +51,7 @@ class OpenStackActionsTestsV2(base.TestCase):
self.assertEqual('SUCCESS', executed_task['state']) self.assertEqual('SUCCESS', executed_task['state'])
@test.attr(type='openstack') @decorators.attr(type='openstack')
@decorators.idempotent_id('fde681b8-3e1b-4172-a4b8-2fcac1f070d9') @decorators.idempotent_id('fde681b8-3e1b-4172-a4b8-2fcac1f070d9')
def test_heat_actions(self): def test_heat_actions(self):
wf_name = self.wb['name'] + '.heat' wf_name = self.wb['name'] + '.heat'
@ -62,7 +61,7 @@ class OpenStackActionsTestsV2(base.TestCase):
self.assertEqual('SUCCESS', executed_task['state']) self.assertEqual('SUCCESS', executed_task['state'])
@test.attr(type='openstack') @decorators.attr(type='openstack')
@decorators.idempotent_id('5981360d-f336-45ca-9d38-799c7a8ade26') @decorators.idempotent_id('5981360d-f336-45ca-9d38-799c7a8ade26')
def test_glance_actions(self): def test_glance_actions(self):
wf_name = self.wb['name'] + '.glance' wf_name = self.wb['name'] + '.glance'
@ -72,7 +71,7 @@ class OpenStackActionsTestsV2(base.TestCase):
self.assertEqual('SUCCESS', executed_task['state']) self.assertEqual('SUCCESS', executed_task['state'])
@test.attr(type='openstack') @decorators.attr(type='openstack')
@decorators.idempotent_id('a1f71a72-3681-4d32-aad9-117068717b33') @decorators.idempotent_id('a1f71a72-3681-4d32-aad9-117068717b33')
def test_cinder_actions(self): def test_cinder_actions(self):
wf_name = self.wb['name'] + '.cinder' wf_name = self.wb['name'] + '.cinder'
@ -82,7 +81,7 @@ class OpenStackActionsTestsV2(base.TestCase):
self.assertEqual('SUCCESS', executed_task['state']) self.assertEqual('SUCCESS', executed_task['state'])
@test.attr(type='openstack') @decorators.attr(type='openstack')
@decorators.idempotent_id('586dd973-fc65-40e2-9a85-31418b22473a') @decorators.idempotent_id('586dd973-fc65-40e2-9a85-31418b22473a')
def test_neutron_actions(self): def test_neutron_actions(self):
wf_name = self.wb['name'] + '.neutron' wf_name = self.wb['name'] + '.neutron'

View File

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