diff --git a/congress_tempest_tests/tests/scenario/congress_datasources/test_aodh.py b/congress_tempest_tests/tests/scenario/congress_datasources/test_aodh.py index c625822dc..c12d662d8 100644 --- a/congress_tempest_tests/tests/scenario/congress_datasources/test_aodh.py +++ b/congress_tempest_tests/tests/scenario/congress_datasources/test_aodh.py @@ -98,3 +98,11 @@ class TestAodhDriver(manager_congress.ScenarioPolicyBase): duration=100, sleep_for=5): raise exceptions.TimeoutException("Data did not converge in time " "or failure in server") + + @test.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error('aodh'), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.') diff --git a/congress_tempest_tests/tests/scenario/congress_datasources/test_ceilometer.py b/congress_tempest_tests/tests/scenario/congress_datasources/test_ceilometer.py index 6dbb6e50c..2eeba2025 100644 --- a/congress_tempest_tests/tests/scenario/congress_datasources/test_ceilometer.py +++ b/congress_tempest_tests/tests/scenario/congress_datasources/test_ceilometer.py @@ -77,3 +77,11 @@ class TestCeilometerDriver(manager_congress.ScenarioPolicyBase): duration=100, sleep_for=5): raise exceptions.TimeoutException("Data did not converge in time " "or failure in server") + + @test.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error('ceilometer'), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.') diff --git a/congress_tempest_tests/tests/scenario/congress_datasources/test_cinder.py b/congress_tempest_tests/tests/scenario/congress_datasources/test_cinder.py index dc844bcd8..0b6c0bae2 100644 --- a/congress_tempest_tests/tests/scenario/congress_datasources/test_cinder.py +++ b/congress_tempest_tests/tests/scenario/congress_datasources/test_cinder.py @@ -105,3 +105,11 @@ class TestCinderDriver(manager_congress.ScenarioPolicyBase): duration=100, sleep_for=5): raise exceptions.TimeoutException("Data did not converge in time " "or failure in server") + + @test.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error('cinder'), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.') diff --git a/congress_tempest_tests/tests/scenario/congress_datasources/test_glancev2.py b/congress_tempest_tests/tests/scenario/congress_datasources/test_glancev2.py index 5240b2806..1e36ccd26 100644 --- a/congress_tempest_tests/tests/scenario/congress_datasources/test_glancev2.py +++ b/congress_tempest_tests/tests/scenario/congress_datasources/test_glancev2.py @@ -126,3 +126,11 @@ class TestGlanceV2Driver(manager_congress.ScenarioPolicyBase): duration=100, sleep_for=5): raise exceptions.TimeoutException("Data did not converge in time " "or failure in server") + + @test.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error('glancev2'), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.') diff --git a/congress_tempest_tests/tests/scenario/congress_datasources/test_heat.py b/congress_tempest_tests/tests/scenario/congress_datasources/test_heat.py new file mode 100644 index 000000000..a421a0bb2 --- /dev/null +++ b/congress_tempest_tests/tests/scenario/congress_datasources/test_heat.py @@ -0,0 +1,45 @@ +# Copyright 2017 VMware Corporation. All rights reserved. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# 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 config +from tempest.lib.common.utils import test_utils +from tempest.lib import exceptions +from tempest import test + +from congress_tempest_tests.tests.scenario import manager_congress + + +CONF = config.CONF + + +class TestHeatDriver(manager_congress.ScenarioPolicyBase): + + @classmethod + def skip_checks(cls): + super(TestHeatDriver, cls).skip_checks() + if not getattr(CONF.service_available, 'heat_plugin', False): + msg = ("%s skipped because heat service is not configured" % + cls.__class__.__name__) + raise cls.skipException(msg) + + # TODO(testing): checks on correctness of data in updates + + @test.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error('heat'), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.') diff --git a/congress_tempest_tests/tests/scenario/congress_datasources/test_ironic.py b/congress_tempest_tests/tests/scenario/congress_datasources/test_ironic.py new file mode 100644 index 000000000..0e49283b6 --- /dev/null +++ b/congress_tempest_tests/tests/scenario/congress_datasources/test_ironic.py @@ -0,0 +1,45 @@ +# Copyright 2017 VMware Corporation. All rights reserved. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# 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 config +from tempest.lib.common.utils import test_utils +from tempest.lib import exceptions +from tempest import test + +from congress_tempest_tests.tests.scenario import manager_congress + + +CONF = config.CONF + + +class TestIronicDriver(manager_congress.ScenarioPolicyBase): + + @classmethod + def skip_checks(cls): + super(TestIronicDriver, cls).skip_checks() + if not getattr(CONF.service_available, 'ironic', False): + msg = ("%s skipped because ironic service is not configured" % + cls.__class__.__name__) + raise cls.skipException(msg) + + # TODO(testing): checks on correctness of data in updates + + @test.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error('ironic'), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.') diff --git a/congress_tempest_tests/tests/scenario/congress_datasources/test_keystonev2.py b/congress_tempest_tests/tests/scenario/congress_datasources/test_keystonev2.py index 38c18fe90..e78a40425 100644 --- a/congress_tempest_tests/tests/scenario/congress_datasources/test_keystonev2.py +++ b/congress_tempest_tests/tests/scenario/congress_datasources/test_keystonev2.py @@ -162,3 +162,11 @@ class TestKeystoneV2Driver(manager_congress.ScenarioPolicyBase): duration=100, sleep_for=5): raise exceptions.TimeoutException("Data did not converge in time " "or failure in server") + + @test.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error('keystone'), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.') diff --git a/congress_tempest_tests/tests/scenario/congress_datasources/test_murano.py b/congress_tempest_tests/tests/scenario/congress_datasources/test_murano.py index a91783d4a..587338468 100644 --- a/congress_tempest_tests/tests/scenario/congress_datasources/test_murano.py +++ b/congress_tempest_tests/tests/scenario/congress_datasources/test_murano.py @@ -15,6 +15,7 @@ import random import string from tempest import config +from tempest.lib.common.utils import test_utils from tempest.lib import exceptions from tempest import test @@ -196,3 +197,11 @@ class TestMuranoDriver(manager_congress.ScenarioPolicyBase): self.assertEqual([], result) result = _simulate_policy(policy_name, sim_query2) self.assertEqual('predeploy_error("env_uuid")', result[0]) + + @test.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error('murano'), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.') diff --git a/congress_tempest_tests/tests/scenario/congress_datasources/test_neutronv2.py b/congress_tempest_tests/tests/scenario/congress_datasources/test_neutronv2.py index 21cffb5d8..69b567721 100644 --- a/congress_tempest_tests/tests/scenario/congress_datasources/test_neutronv2.py +++ b/congress_tempest_tests/tests/scenario/congress_datasources/test_neutronv2.py @@ -389,3 +389,11 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase): duration=200, sleep_for=10): raise exceptions.TimeoutException("Data did not converge in time " "or failure in server") + + @test.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error('neutronv2'), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.') diff --git a/congress_tempest_tests/tests/scenario/congress_datasources/test_nova.py b/congress_tempest_tests/tests/scenario/congress_datasources/test_nova.py index 5d1074afd..d6c56f458 100644 --- a/congress_tempest_tests/tests/scenario/congress_datasources/test_nova.py +++ b/congress_tempest_tests/tests/scenario/congress_datasources/test_nova.py @@ -143,3 +143,11 @@ class TestNovaDriver(manager_congress.ScenarioPolicyBase): duration=100, sleep_for=5): raise exceptions.TimeoutException("Data did not converge in time " "or failure in server") + + @test.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error('nova'), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.') diff --git a/congress_tempest_tests/tests/scenario/congress_datasources/test_swift.py b/congress_tempest_tests/tests/scenario/congress_datasources/test_swift.py new file mode 100644 index 000000000..d2fceea31 --- /dev/null +++ b/congress_tempest_tests/tests/scenario/congress_datasources/test_swift.py @@ -0,0 +1,48 @@ +# Copyright 2017 VMware Inc. All rights reserved. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# 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 config +from tempest.lib.common.utils import test_utils +from tempest.lib import decorators +from tempest.lib import exceptions +from tempest import test + +from congress_tempest_tests.tests.scenario import manager_congress + + +CONF = config.CONF + + +class TestSwiftDriver(manager_congress.ScenarioPolicyBase): + + @classmethod + def skip_checks(cls): + super(TestSwiftDriver, cls).skip_checks() + if not CONF.service_available.swift: + msg = ("%s skipped because swift service is not configured" % + cls.__class__.__name__) + raise cls.skipException(msg) + + # TODO(testing): checks on correctness of data in updates + + # swift driver experiences auth error in test + @decorators.skip_because(bug="980688") + @test.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error('swift'), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.') diff --git a/congress_tempest_tests/tests/scenario/manager_congress.py b/congress_tempest_tests/tests/scenario/manager_congress.py index 48e64510d..51a8edd98 100644 --- a/congress_tempest_tests/tests/scenario/manager_congress.py +++ b/congress_tempest_tests/tests/scenario/manager_congress.py @@ -116,6 +116,19 @@ class ScenarioPolicyBase(manager.NetworkScenarioTest): self.assertIn(self.router['id'], seen_router_ids) + def check_datasource_no_error(self, datasource_name): + """Check that datasource has no error on latest update""" + ds_status = self.admin_manager.congress_client.list_datasource_status( + datasource_name) + if (ds_status['initialized'] == 'True' and + ds_status['number_of_updates'] != '0' and + ds_status['last_error'] == 'None'): + return True + else: + LOG.debug('datasource %s not initialized, not polled, or shows ' + 'error. Full status: %s', datasource_name, ds_status) + return False + def _create_server(self, name, network): keypair = self.create_keypair() self.keypairs[keypair['name']] = keypair