Switch to use idempotent_id decorator from tempest.lib
Decorator idempotent_id() in tempest.test is deprecated and
tempest.lib.decorators.idempotent_id() should be used instead.
This patch switch all tempest tests to use new decorator.
Change-Id: I2df9c13fbb44b8807da6805761ad30bfd010dc55
diff --git a/neutron/tests/tempest/scenario/test_basic.py b/neutron/tests/tempest/scenario/test_basic.py
index 3fd1bc6..9006c44 100644
--- a/neutron/tests/tempest/scenario/test_basic.py
+++ b/neutron/tests/tempest/scenario/test_basic.py
@@ -12,7 +12,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-from tempest import test
+from tempest.lib import decorators
from neutron.tests.tempest import config
from neutron.tests.tempest.scenario import base
@@ -27,7 +27,7 @@
# Default to ipv4.
_ip_version = 4
- @test.idempotent_id('de07fe0a-e955-449e-b48b-8641c14cd52e')
+ @decorators.idempotent_id('de07fe0a-e955-449e-b48b-8641c14cd52e')
def test_basic_instance(self):
self.setup_network_and_server()
self.check_connectivity(self.fip['floating_ip_address'],
diff --git a/neutron/tests/tempest/scenario/test_dvr.py b/neutron/tests/tempest/scenario/test_dvr.py
index 9150c01..727bb5c 100644
--- a/neutron/tests/tempest/scenario/test_dvr.py
+++ b/neutron/tests/tempest/scenario/test_dvr.py
@@ -12,6 +12,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+from tempest.lib import decorators
from tempest import test
from neutron.tests.tempest import config
@@ -50,7 +51,7 @@
self.admin_manager.network_client.update_port(
port_id, admin_state_up=False)
- @test.idempotent_id('3d73ec1a-2ec6-45a9-b0f8-04a283d9d344')
+ @decorators.idempotent_id('3d73ec1a-2ec6-45a9-b0f8-04a283d9d344')
def test_vm_reachable_through_compute(self):
"""Check that the VM is reachable through compute node.
@@ -61,7 +62,7 @@
self.setup_network_and_server(router=router)
self._check_snat_port_connectivity()
- @test.idempotent_id('23724222-483a-4129-bc15-7a9278f3828b')
+ @decorators.idempotent_id('23724222-483a-4129-bc15-7a9278f3828b')
def test_update_centralized_router_to_dvr(self):
"""Check that updating centralized router to be distributed works.
"""
diff --git a/neutron/tests/tempest/scenario/test_floatingip.py b/neutron/tests/tempest/scenario/test_floatingip.py
index 4c2ebb1..06f495d 100644
--- a/neutron/tests/tempest/scenario/test_floatingip.py
+++ b/neutron/tests/tempest/scenario/test_floatingip.py
@@ -17,6 +17,7 @@
from tempest.common import waiters
from tempest.lib.common import ssh
from tempest.lib.common.utils import data_utils
+from tempest.lib import decorators
from tempest import test
import testscenarios
@@ -119,7 +120,7 @@
same_network = True
- @test.idempotent_id('05c4e3b3-7319-4052-90ad-e8916436c23b')
+ @decorators.idempotent_id('05c4e3b3-7319-4052-90ad-e8916436c23b')
def test_east_west(self):
self._test_east_west()
@@ -134,6 +135,6 @@
same_network = False
- @test.idempotent_id('f18f0090-3289-4783-b956-a0f8ac511e8b')
+ @decorators.idempotent_id('f18f0090-3289-4783-b956-a0f8ac511e8b')
def test_east_west(self):
self._test_east_west()
diff --git a/neutron/tests/tempest/scenario/test_qos.py b/neutron/tests/tempest/scenario/test_qos.py
index 70b962f..b79faf8 100644
--- a/neutron/tests/tempest/scenario/test_qos.py
+++ b/neutron/tests/tempest/scenario/test_qos.py
@@ -18,6 +18,7 @@
from oslo_log import log as logging
from tempest.lib.common import ssh
+from tempest.lib import decorators
from tempest.lib import exceptions
from tempest import test
import testtools
@@ -127,7 +128,7 @@
return bytes_per_second <= QoSTest.LIMIT_BYTES_SEC
- @test.idempotent_id('1f7ed39b-428f-410a-bd2b-db9f465680df')
+ @decorators.idempotent_id('1f7ed39b-428f-410a-bd2b-db9f465680df')
def test_qos(self):
"""This is a basic test that check that a QoS policy with
diff --git a/neutron/tests/tempest/scenario/test_trunk.py b/neutron/tests/tempest/scenario/test_trunk.py
index 195882d..fb3e947 100644
--- a/neutron/tests/tempest/scenario/test_trunk.py
+++ b/neutron/tests/tempest/scenario/test_trunk.py
@@ -16,6 +16,7 @@
from tempest.common.utils.linux import remote_client
from tempest.common import waiters
from tempest.lib.common.utils import data_utils
+from tempest.lib import decorators
from tempest import test
from neutron.common import utils
@@ -141,7 +142,7 @@
CONF.validation.image_ssh_user,
self.keypair['private_key'])
- @test.idempotent_id('bb13fe28-f152-4000-8131-37890a40c79e')
+ @decorators.idempotent_id('bb13fe28-f152-4000-8131-37890a40c79e')
def test_trunk_subport_lifecycle(self):
"""Test trunk creation and subport transition to ACTIVE status.
@@ -218,7 +219,7 @@
CONF.validation.image_ssh_user,
self.keypair['private_key'])
- @test.idempotent_id('a8a02c9b-b453-49b5-89a2-cce7da66aafb')
+ @decorators.idempotent_id('a8a02c9b-b453-49b5-89a2-cce7da66aafb')
def test_subport_connectivity(self):
vlan_tag = 10