Switch to decorators.idempotent_id

test.idempotent_id is being kept temporary to migrate
to new lib interface. Now idempotent_id is available as Tempest stable
interface decorators and all plugins tests using the old decorator
should be switched to new interface.

In future, Once all plugins are switched to new decorator Tempest
will remove the test.idempotent_id

Change-Id: I20ef363a008b1c01652015cc2ada69777b8859d9
Related-Bug: 1616913
This commit is contained in:
ghanshyam 2017-01-27 06:10:00 +00:00
parent 014319d662
commit 4109e31304
2 changed files with 7 additions and 7 deletions

View File

@ -13,7 +13,6 @@
from tempest.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
from aodh.tests.tempest.api import base
@ -30,7 +29,7 @@ class TelemetryAlarmingAPITest(base.BaseAlarmingTest):
for i in range(2):
cls.create_alarm(threshold_rule=cls.rule)
@test.idempotent_id('1c918e06-210b-41eb-bd45-14676dd77cd7')
@decorators.idempotent_id('1c918e06-210b-41eb-bd45-14676dd77cd7')
def test_alarm_list(self):
# List alarms
alarm_list = self.alarming_client.list_alarms()
@ -43,7 +42,7 @@ class TelemetryAlarmingAPITest(base.BaseAlarmingTest):
" in a fetched list: %s" %
', '.join(str(a) for a in missing_alarms))
@test.idempotent_id('1297b095-39c1-4e74-8a1f-4ae998cedd68')
@decorators.idempotent_id('1297b095-39c1-4e74-8a1f-4ae998cedd68')
def test_create_update_get_delete_alarm(self):
# Create an alarm
alarm_name = data_utils.rand_name('telemetry_alarm')
@ -80,7 +79,7 @@ class TelemetryAlarmingAPITest(base.BaseAlarmingTest):
self.assertRaises(lib_exc.NotFound,
self.alarming_client.show_alarm, alarm_id)
@test.idempotent_id('aca49486-70bb-4016-87e0-f6131374f742')
@decorators.idempotent_id('aca49486-70bb-4016-87e0-f6131374f742')
def test_set_get_alarm_state(self):
alarm_states = ['ok', 'alarm', 'insufficient data']
alarm = self.create_alarm(threshold_rule=self.rule)
@ -94,7 +93,7 @@ class TelemetryAlarmingAPITest(base.BaseAlarmingTest):
state = self.alarming_client.show_alarm_state(alarm['alarm_id'])
self.assertEqual(new_state, state.data)
@test.idempotent_id('08d7e45a-1344-4e5c-ba6f-f6cbb77f55ba')
@decorators.idempotent_id('08d7e45a-1344-4e5c-ba6f-f6cbb77f55ba')
@decorators.skip_because(bug='1585267')
def test_create_delete_alarm_with_combination_rule(self):
rule = {"alarm_ids": self.alarm_ids,

View File

@ -14,6 +14,7 @@
from oslo_utils import uuidutils
from tempest.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
@ -30,7 +31,7 @@ class TelemetryAlarmingNegativeTest(base.BaseAlarmingTest):
"""
@test.attr(type=['negative'])
@test.idempotent_id('668743d5-08ad-4480-b2b8-15da34f81e7e')
@decorators.idempotent_id('668743d5-08ad-4480-b2b8-15da34f81e7e')
def test_get_non_existent_alarm(self):
# get the non-existent alarm
non_existent_id = uuidutils.generate_uuid()
@ -38,7 +39,7 @@ class TelemetryAlarmingNegativeTest(base.BaseAlarmingTest):
non_existent_id)
@test.attr(type=['negative'])
@test.idempotent_id('ef45000d-0a72-4781-866d-4cb7bf2582ae')
@decorators.idempotent_id('ef45000d-0a72-4781-866d-4cb7bf2582ae')
def test_get_update_show_history_delete_deleted_alarm(self):
# get, update and delete the deleted alarm
alarm_name = data_utils.rand_name('telemetry_alarm')