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[1].
This patch replaces the 'tempest.test.attr()' with the 'tempest.lib
.decorators.attr().'

[1] Iaafbb112b6eee458089cc49918359a8a8d0485e2

Change-Id: I4796a1e10311cae2910e0d3ee5d0cb8368fbed1e
diff --git a/ironic_tempest_plugin/tests/api/admin/test_ports_negative.py b/ironic_tempest_plugin/tests/api/admin/test_ports_negative.py
index f9fa746..91ba7fd 100644
--- a/ironic_tempest_plugin/tests/api/admin/test_ports_negative.py
+++ b/ironic_tempest_plugin/tests/api/admin/test_ports_negative.py
@@ -13,7 +13,6 @@
 from tempest.lib.common.utils import data_utils
 from tempest.lib import decorators
 from tempest.lib import exceptions as lib_exc
-from tempest import test
 
 from ironic_tempest_plugin.tests.api.admin import base
 
@@ -27,7 +26,7 @@
         _, self.chassis = self.create_chassis()
         _, self.node = self.create_node(self.chassis['uuid'])
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('0a6ee1f7-d0d9-4069-8778-37f3aa07303a')
     def test_create_port_malformed_mac(self):
         node_id = self.node['uuid']
@@ -36,7 +35,7 @@
         self.assertRaises(lib_exc.BadRequest,
                           self.create_port, node_id=node_id, address=address)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('30277ee8-0c60-4f1d-b125-0e51c2f43369')
     def test_create_port_nonexsistent_node_id(self):
         node_id = str(data_utils.rand_uuid())
@@ -44,25 +43,25 @@
         self.assertRaises(lib_exc.BadRequest, self.create_port,
                           node_id=node_id, address=address)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('029190f6-43e1-40a3-b64a-65173ba653a3')
     def test_show_port_malformed_uuid(self):
         self.assertRaises(lib_exc.BadRequest, self.client.show_port,
                           'malformed:uuid')
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('0d00e13d-e2e0-45b1-bcbc-55a6d90ca793')
     def test_show_port_nonexistent_uuid(self):
         self.assertRaises(lib_exc.NotFound, self.client.show_port,
                           data_utils.rand_uuid())
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('4ad85266-31e9-4942-99ac-751897dc9e23')
     def test_show_port_by_mac_not_allowed(self):
         self.assertRaises(lib_exc.BadRequest, self.client.show_port,
                           data_utils.rand_mac_address())
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('89a34380-3c61-4c32-955c-2cd9ce94da21')
     def test_create_port_duplicated_port_uuid(self):
         node_id = self.node['uuid']
@@ -73,7 +72,7 @@
         self.assertRaises(lib_exc.Conflict, self.create_port, node_id=node_id,
                           address=address, uuid=uuid)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('65e84917-733c-40ae-ae4b-96a4adff931c')
     def test_create_port_no_mandatory_field_node_id(self):
         address = data_utils.rand_mac_address()
@@ -81,7 +80,7 @@
         self.assertRaises(lib_exc.BadRequest, self.create_port, node_id=None,
                           address=address)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('bcea3476-7033-4183-acfe-e56a30809b46')
     def test_create_port_no_mandatory_field_mac(self):
         node_id = self.node['uuid']
@@ -89,7 +88,7 @@
         self.assertRaises(lib_exc.BadRequest, self.create_port,
                           node_id=node_id, address=None)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('2b51cd18-fb95-458b-9780-e6257787b649')
     def test_create_port_malformed_port_uuid(self):
         node_id = self.node['uuid']
@@ -99,14 +98,14 @@
         self.assertRaises(lib_exc.BadRequest, self.create_port,
                           node_id=node_id, address=address, uuid=uuid)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('583a6856-6a30-4ac4-889f-14e2adff8105')
     def test_create_port_malformed_node_id(self):
         address = data_utils.rand_mac_address()
         self.assertRaises(lib_exc.BadRequest, self.create_port,
                           node_id='malformed:nodeid', address=address)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('e27f8b2e-42c6-4a43-a3cd-accff716bc5c')
     def test_create_port_duplicated_mac(self):
         node_id = self.node['uuid']
@@ -116,7 +115,7 @@
                           self.create_port, node_id=node_id,
                           address=address)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('8907082d-ac5e-4be3-b05f-d072ede82020')
     def test_update_port_by_mac_not_allowed(self):
         node_id = self.node['uuid']
@@ -133,7 +132,7 @@
                           self.client.update_port, address,
                           patch)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('df1ac70c-db9f-41d9-90f1-78cd6b905718')
     def test_update_port_nonexistent(self):
         node_id = self.node['uuid']
@@ -152,7 +151,7 @@
         self.assertRaises(lib_exc.NotFound,
                           self.client.update_port, port_id, patch)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('c701e315-aa52-41ea-817c-65c5ca8ca2a8')
     def test_update_port_malformed_port_uuid(self):
         node_id = self.node['uuid']
@@ -166,7 +165,7 @@
                           patch=[{'path': '/address', 'op': 'replace',
                                   'value': new_address}])
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('f8f15803-34d6-45dc-b06f-e5e04bf1b38b')
     def test_update_port_add_nonexistent_property(self):
         node_id = self.node['uuid']
@@ -179,7 +178,7 @@
                           [{'path': '/nonexistent', ' op': 'add',
                             'value': 'value'}])
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('898ec904-38b1-4fcb-9584-1187d4263a2a')
     def test_update_port_replace_node_id_with_malformed(self):
         node_id = self.node['uuid']
@@ -194,7 +193,7 @@
         self.assertRaises(lib_exc.BadRequest,
                           self.client.update_port, port_id, patch)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('2949f30f-5f59-43fa-a6d9-4eac578afab4')
     def test_update_port_replace_mac_with_duplicated(self):
         node_id = self.node['uuid']
@@ -212,7 +211,7 @@
         self.assertRaises(lib_exc.Conflict,
                           self.client.update_port, port_id, patch)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('97f6e048-6e4f-4eba-a09d-fbbc78b77a77')
     def test_update_port_replace_node_id_with_nonexistent(self):
         node_id = self.node['uuid']
@@ -227,7 +226,7 @@
         self.assertRaises(lib_exc.BadRequest,
                           self.client.update_port, port_id, patch)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('375022c5-9e9e-4b11-9ca4-656729c0c9b2')
     def test_update_port_replace_mac_with_malformed(self):
         node_id = self.node['uuid']
@@ -243,7 +242,7 @@
         self.assertRaises(lib_exc.BadRequest,
                           self.client.update_port, port_id, patch)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('5722b853-03fc-4854-8308-2036a1b67d85')
     def test_update_port_replace_nonexistent_property(self):
         node_id = self.node['uuid']
@@ -257,7 +256,7 @@
         self.assertRaises(lib_exc.BadRequest,
                           self.client.update_port, port_id, patch)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('ae2696ca-930a-4a7f-918f-30ae97c60f56')
     def test_update_port_remove_mandatory_field_mac(self):
         node_id = self.node['uuid']
@@ -269,7 +268,7 @@
         self.assertRaises(lib_exc.BadRequest, self.client.update_port, port_id,
                           [{'path': '/address', 'op': 'remove'}])
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('5392c1f0-2071-4697-9064-ec2d63019018')
     def test_update_port_remove_mandatory_field_port_uuid(self):
         node_id = self.node['uuid']
@@ -281,7 +280,7 @@
         self.assertRaises(lib_exc.BadRequest, self.client.update_port, port_id,
                           [{'path': '/uuid', 'op': 'remove'}])
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('06b50d82-802a-47ef-b079-0a3311cf85a2')
     def test_update_port_remove_nonexistent_property(self):
         node_id = self.node['uuid']
@@ -293,7 +292,7 @@
         self.assertRaises(lib_exc.BadRequest, self.client.update_port, port_id,
                           [{'path': '/nonexistent', 'op': 'remove'}])
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('03d42391-2145-4a6c-95bf-63fe55eb64fd')
     def test_delete_port_by_mac_not_allowed(self):
         node_id = self.node['uuid']
@@ -302,7 +301,7 @@
         self.create_port(node_id=node_id, address=address)
         self.assertRaises(lib_exc.BadRequest, self.client.delete_port, address)
 
-    @test.attr(type=['negative'])
+    @decorators.attr(type=['negative'])
     @decorators.idempotent_id('0629e002-818e-4763-b25b-ae5e07b1cb23')
     def test_update_port_mixed_ops_integrity(self):
         node_id = self.node['uuid']