Remove deprecated attrs usage in tempest plugin

Closes-Bug:#1689479
Change-Id: I94c92d4498f2259a0ac4e32d21cc553d045788d9
This commit is contained in:
Anusha Ramineni 2017-05-09 12:01:45 +05:30
parent 8babdb5dc9
commit 5a431a5c23
14 changed files with 45 additions and 42 deletions

View File

@ -16,8 +16,8 @@
from tempest import clients from tempest import clients
from tempest import config from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from congress_tempest_tests.tests.scenario import manager_congress from congress_tempest_tests.tests.scenario import manager_congress
@ -46,7 +46,7 @@ class TestKeystoneV2Driver(manager_congress.ScenarioPolicyBase):
cls.datasource_id = manager_congress.get_datasource_id( cls.datasource_id = manager_congress.get_datasource_id(
cls.admin_manager.congress_client, 'keystone') cls.admin_manager.congress_client, 'keystone')
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_keystone_users_table(self): def test_keystone_users_table(self):
user_schema = ( user_schema = (
self.admin_manager.congress_client.show_datasource_table_schema( self.admin_manager.congress_client.show_datasource_table_schema(
@ -89,7 +89,7 @@ class TestKeystoneV2Driver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_keystone_roles_table(self): def test_keystone_roles_table(self):
role_schema = ( role_schema = (
self.admin_manager.congress_client.show_datasource_table_schema( self.admin_manager.congress_client.show_datasource_table_schema(
@ -125,7 +125,7 @@ class TestKeystoneV2Driver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_keystone_tenants_table(self): def test_keystone_tenants_table(self):
tenant_schema = ( tenant_schema = (
self.admin_manager.congress_client.show_datasource_table_schema( self.admin_manager.congress_client.show_datasource_table_schema(
@ -161,7 +161,7 @@ class TestKeystoneV2Driver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_update_no_error(self): def test_update_no_error(self):
if not test_utils.call_until_true( if not test_utils.call_until_true(
func=lambda: self.check_datasource_no_error('keystone'), func=lambda: self.check_datasource_no_error('keystone'),

View File

@ -15,8 +15,8 @@
from tempest import config from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from congress_tempest_tests.tests.scenario import manager_congress from congress_tempest_tests.tests.scenario import manager_congress
@ -40,7 +40,7 @@ class TestAodhDriver(manager_congress.ScenarioPolicyBase):
cls.datasource_id = manager_congress.get_datasource_id( cls.datasource_id = manager_congress.get_datasource_id(
cls.admin_manager.congress_client, 'aodh') cls.admin_manager.congress_client, 'aodh')
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_aodh_alarms_table(self): def test_aodh_alarms_table(self):
# Add test alarm # Add test alarm
rule = {'meter_name': 'cpu_util', rule = {'meter_name': 'cpu_util',
@ -97,7 +97,7 @@ class TestAodhDriver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_update_no_error(self): def test_update_no_error(self):
if not test_utils.call_until_true( if not test_utils.call_until_true(
func=lambda: self.check_datasource_no_error('aodh'), func=lambda: self.check_datasource_no_error('aodh'),

View File

@ -15,8 +15,8 @@
from tempest import config from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from congress_tempest_tests.tests.scenario import manager_congress from congress_tempest_tests.tests.scenario import manager_congress
@ -40,7 +40,7 @@ class TestCeilometerDriver(manager_congress.ScenarioPolicyBase):
cls.datasource_id = manager_congress.get_datasource_id( cls.datasource_id = manager_congress.get_datasource_id(
cls.admin_manager.congress_client, 'ceilometer') cls.admin_manager.congress_client, 'ceilometer')
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_ceilometer_meters_table(self): def test_ceilometer_meters_table(self):
meter_schema = ( meter_schema = (
self.admin_manager.congress_client.show_datasource_table_schema( self.admin_manager.congress_client.show_datasource_table_schema(
@ -76,7 +76,7 @@ class TestCeilometerDriver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_update_no_error(self): def test_update_no_error(self):
if not test_utils.call_until_true( if not test_utils.call_until_true(
func=lambda: self.check_datasource_no_error('ceilometer'), func=lambda: self.check_datasource_no_error('ceilometer'),

View File

@ -17,8 +17,8 @@ from oslo_log import log as logging
from tempest import clients from tempest import clients
from tempest import config from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from congress_tempest_tests.tests.scenario import manager_congress from congress_tempest_tests.tests.scenario import manager_congress
@ -53,7 +53,7 @@ class TestCinderDriver(manager_congress.ScenarioPolicyBase):
consistencygroup_id=None, metadata={}) consistencygroup_id=None, metadata={})
LOG.debug('result of creating new volume: %s', res) LOG.debug('result of creating new volume: %s', res)
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_cinder_volumes_table(self): def test_cinder_volumes_table(self):
volume_schema = ( volume_schema = (
self.admin_manager.congress_client.show_datasource_table_schema( self.admin_manager.congress_client.show_datasource_table_schema(
@ -106,7 +106,7 @@ class TestCinderDriver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_update_no_error(self): def test_update_no_error(self):
if not test_utils.call_until_true( if not test_utils.call_until_true(
func=lambda: self.check_datasource_no_error('cinder'), func=lambda: self.check_datasource_no_error('cinder'),

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from congress_tempest_tests.tests.scenario import helper from congress_tempest_tests.tests.scenario import helper
from congress_tempest_tests.tests.scenario import manager_congress from congress_tempest_tests.tests.scenario import manager_congress
@ -40,7 +40,7 @@ class TestDoctorDriver(manager_congress.ScenarioPolicyBase):
def _list_datasource_rows(self, datasource, table): def _list_datasource_rows(self, datasource, table):
return self.client.list_datasource_rows(datasource, table) return self.client.list_datasource_rows(datasource, table)
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_doctor_event_tables(self): def test_doctor_event_tables(self):
rows = [ rows = [
{ {

View File

@ -16,6 +16,7 @@
from tempest import clients from tempest import clients
from tempest import config from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test from tempest import test
@ -47,7 +48,7 @@ class TestGlanceV2Driver(manager_congress.ScenarioPolicyBase):
cls.datasource_id = manager_congress.get_datasource_id( cls.datasource_id = manager_congress.get_datasource_id(
cls.admin_manager.congress_client, 'glancev2') cls.admin_manager.congress_client, 'glancev2')
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('image') @test.services('image')
def test_glancev2_images_table(self): def test_glancev2_images_table(self):
image_schema = ( image_schema = (
@ -94,7 +95,7 @@ class TestGlanceV2Driver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('image') @test.services('image')
def test_glancev2_tags_table(self): def test_glancev2_tags_table(self):
def _check_data_table_glance_images(): def _check_data_table_glance_images():
@ -125,7 +126,7 @@ class TestGlanceV2Driver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_update_no_error(self): def test_update_no_error(self):
if not test_utils.call_until_true( if not test_utils.call_until_true(
func=lambda: self.check_datasource_no_error('glancev2'), func=lambda: self.check_datasource_no_error('glancev2'),

View File

@ -15,8 +15,8 @@
from tempest import config from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from congress_tempest_tests.tests.scenario import manager_congress from congress_tempest_tests.tests.scenario import manager_congress
@ -36,7 +36,7 @@ class TestHeatDriver(manager_congress.ScenarioPolicyBase):
# TODO(testing): checks on correctness of data in updates # TODO(testing): checks on correctness of data in updates
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_update_no_error(self): def test_update_no_error(self):
if not test_utils.call_until_true( if not test_utils.call_until_true(
func=lambda: self.check_datasource_no_error('heat'), func=lambda: self.check_datasource_no_error('heat'),

View File

@ -15,8 +15,8 @@
from tempest import config from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test
from congress_tempest_tests.tests.scenario import manager_congress from congress_tempest_tests.tests.scenario import manager_congress
@ -36,7 +36,7 @@ class TestIronicDriver(manager_congress.ScenarioPolicyBase):
# TODO(testing): checks on correctness of data in updates # TODO(testing): checks on correctness of data in updates
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_update_no_error(self): def test_update_no_error(self):
if not test_utils.call_until_true( if not test_utils.call_until_true(
func=lambda: self.check_datasource_no_error('ironic'), func=lambda: self.check_datasource_no_error('ironic'),

View File

@ -16,6 +16,7 @@ import string
from tempest import config from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test from tempest import test
@ -47,7 +48,7 @@ class TestMuranoDriver(manager_congress.ScenarioPolicyBase):
self.congress_client = ( self.congress_client = (
self.admin_manager.congress_client) self.admin_manager.congress_client)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('compute') @test.services('compute')
def test_murano_predeployment(self): def test_murano_predeployment(self):
@ -198,7 +199,7 @@ class TestMuranoDriver(manager_congress.ScenarioPolicyBase):
result = _simulate_policy(policy_name, sim_query2) result = _simulate_policy(policy_name, sim_query2)
self.assertEqual('predeploy_error("env_uuid")', result[0]) self.assertEqual('predeploy_error("env_uuid")', result[0])
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_update_no_error(self): def test_update_no_error(self):
if not test_utils.call_until_true( if not test_utils.call_until_true(
func=lambda: self.check_datasource_no_error('murano'), func=lambda: self.check_datasource_no_error('murano'),

View File

@ -17,6 +17,7 @@ import time
from tempest import clients from tempest import clients
from tempest import config from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test from tempest import test
@ -54,7 +55,7 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
cls.datasource_id = manager_congress.get_datasource_id( cls.datasource_id = manager_congress.get_datasource_id(
cls.admin_manager.congress_client, 'neutronv2') cls.admin_manager.congress_client, 'neutronv2')
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('network') @test.services('network')
def test_neutronv2_networks_table(self): def test_neutronv2_networks_table(self):
@ -87,7 +88,7 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('network') @test.services('network')
def test_neutronv2_ports_tables(self): def test_neutronv2_ports_tables(self):
port_schema = ( port_schema = (
@ -164,7 +165,7 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('network') @test.services('network')
def test_neutronv2_subnets_tables(self): def test_neutronv2_subnets_tables(self):
subnet_schema = ( subnet_schema = (
@ -259,7 +260,7 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('network') @test.services('network')
def test_neutronv2_routers_tables(self): def test_neutronv2_routers_tables(self):
router_schema = ( router_schema = (
@ -313,7 +314,7 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('network') @test.services('network')
def test_neutronv2_security_groups_table(self): def test_neutronv2_security_groups_table(self):
sg_schema = ( sg_schema = (
@ -350,7 +351,7 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('network') @test.services('network')
def test_neutronv2_security_group_rules_table(self): def test_neutronv2_security_group_rules_table(self):
sgrs_schema = ( sgrs_schema = (
@ -388,7 +389,7 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_update_no_error(self): def test_update_no_error(self):
if not test_utils.call_until_true( if not test_utils.call_until_true(
func=lambda: self.check_datasource_no_error('neutronv2'), func=lambda: self.check_datasource_no_error('neutronv2'),

View File

@ -15,6 +15,7 @@
from tempest import config from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test from tempest import test
@ -47,7 +48,7 @@ class TestNovaDriver(manager_congress.ScenarioPolicyBase):
self.datasource_id = manager_congress.get_datasource_id( self.datasource_id = manager_congress.get_datasource_id(
self.admin_manager.congress_client, 'nova') self.admin_manager.congress_client, 'nova')
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('compute', 'network') @test.services('compute', 'network')
def test_nova_datasource_driver_servers(self): def test_nova_datasource_driver_servers(self):
self._setup_network_and_servers() self._setup_network_and_servers()
@ -103,7 +104,7 @@ class TestNovaDriver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('compute', 'network') @test.services('compute', 'network')
def test_nova_datasource_driver_flavors(self): def test_nova_datasource_driver_flavors(self):
@ -142,7 +143,7 @@ class TestNovaDriver(manager_congress.ScenarioPolicyBase):
raise exceptions.TimeoutException("Data did not converge in time " raise exceptions.TimeoutException("Data did not converge in time "
"or failure in server") "or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_update_no_error(self): def test_update_no_error(self):
if not test_utils.call_until_true( if not test_utils.call_until_true(
func=lambda: self.check_datasource_no_error('nova'), func=lambda: self.check_datasource_no_error('nova'),

View File

@ -17,7 +17,6 @@ from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
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 congress_tempest_tests.tests.scenario import manager_congress from congress_tempest_tests.tests.scenario import manager_congress
@ -39,7 +38,7 @@ class TestSwiftDriver(manager_congress.ScenarioPolicyBase):
# swift driver experiences auth error in test # swift driver experiences auth error in test
@decorators.skip_because(bug="980688") @decorators.skip_because(bug="980688")
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_update_no_error(self): def test_update_no_error(self):
if not test_utils.call_until_true( if not test_utils.call_until_true(
func=lambda: self.check_datasource_no_error('swift'), func=lambda: self.check_datasource_no_error('swift'),

View File

@ -25,7 +25,6 @@ from tempest.lib.common.utils import test_utils
from tempest.lib import decorators from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import manager as tempestmanager from tempest import manager as tempestmanager
from tempest import test
from urllib3 import exceptions as urllib3_exceptions from urllib3 import exceptions as urllib3_exceptions
from congress_tempest_tests.services.policy import policy_client from congress_tempest_tests.services.policy import policy_client
@ -205,7 +204,7 @@ class TestHA(manager_congress.ScenarioPolicyBase):
return ret['id'] return ret['id']
@decorators.skip_because(bug="1689220") @decorators.skip_because(bug="1689220")
@test.attr(type='smoke') @decorators.attr(type='smoke')
def test_datasource_db_sync_add_remove(self): def test_datasource_db_sync_add_remove(self):
# Verify that a replica adds a datasource when a datasource # Verify that a replica adds a datasource when a datasource
# appears in the database. # appears in the database.

View File

@ -16,6 +16,7 @@
from tempest import config from tempest import config
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest import test from tempest import test
@ -88,7 +89,7 @@ class TestPolicyBasicOps(manager_congress.ScenarioPolicyBase):
**create_kwargs) **create_kwargs)
return instance return instance
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('compute', 'network') @test.services('compute', 'network')
def test_execution_action(self): def test_execution_action(self):
metadata = {'testkey1': 'value3'} metadata = {'testkey1': 'value3'}
@ -117,7 +118,7 @@ class TestPolicyBasicOps(manager_congress.ScenarioPolicyBase):
False, body) False, body)
helper.retry_check_function_return_value(f, res) helper.retry_check_function_return_value(f, res)
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('compute', 'network') @test.services('compute', 'network')
def test_policy_basic_op(self): def test_policy_basic_op(self):
self._setup_network_and_servers() self._setup_network_and_servers()
@ -159,7 +160,7 @@ class TestPolicyBasicOps(manager_congress.ScenarioPolicyBase):
self.assertTrue(check_data(), self.assertTrue(check_data(),
"Data did not converge in time or failure in server") "Data did not converge in time or failure in server")
@test.attr(type='smoke') @decorators.attr(type='smoke')
@test.services('compute', 'network') @test.services('compute', 'network')
def test_reactive_enforcement(self): def test_reactive_enforcement(self):
servers_client = self.admin_manager.servers_client servers_client = self.admin_manager.servers_client