check update error on tempest datasoure tests
add to each polling driver test a check that poll succeeded at least once without error. The purpose is to catch polling errors (usually due to service client changes) quickly. Closes-Bug: 1669164 Backport: testing-only change Change-Id: I2df2b813e0eb187cfd795a3fbd72240c127f61a4
This commit is contained in:
parent
fe16151a4b
commit
fbcc781c64
|
@ -98,3 +98,11 @@ class TestAodhDriver(manager_congress.ScenarioPolicyBase):
|
||||||
duration=100, sleep_for=5):
|
duration=100, sleep_for=5):
|
||||||
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')
|
||||||
|
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.')
|
||||||
|
|
|
@ -77,3 +77,11 @@ class TestCeilometerDriver(manager_congress.ScenarioPolicyBase):
|
||||||
duration=100, sleep_for=5):
|
duration=100, sleep_for=5):
|
||||||
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')
|
||||||
|
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.')
|
||||||
|
|
|
@ -105,3 +105,11 @@ class TestCinderDriver(manager_congress.ScenarioPolicyBase):
|
||||||
duration=100, sleep_for=5):
|
duration=100, sleep_for=5):
|
||||||
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')
|
||||||
|
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.')
|
||||||
|
|
|
@ -126,3 +126,11 @@ class TestGlanceV2Driver(manager_congress.ScenarioPolicyBase):
|
||||||
duration=100, sleep_for=5):
|
duration=100, sleep_for=5):
|
||||||
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')
|
||||||
|
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.')
|
||||||
|
|
|
@ -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.')
|
|
@ -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.')
|
|
@ -162,3 +162,11 @@ class TestKeystoneV2Driver(manager_congress.ScenarioPolicyBase):
|
||||||
duration=100, sleep_for=5):
|
duration=100, sleep_for=5):
|
||||||
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')
|
||||||
|
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.')
|
||||||
|
|
|
@ -15,6 +15,7 @@ import random
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from tempest import config
|
from tempest import config
|
||||||
|
from tempest.lib.common.utils import test_utils
|
||||||
from tempest.lib import exceptions
|
from tempest.lib import exceptions
|
||||||
from tempest import test
|
from tempest import test
|
||||||
|
|
||||||
|
@ -196,3 +197,11 @@ class TestMuranoDriver(manager_congress.ScenarioPolicyBase):
|
||||||
self.assertEqual([], result)
|
self.assertEqual([], result)
|
||||||
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')
|
||||||
|
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.')
|
||||||
|
|
|
@ -389,3 +389,11 @@ class TestNeutronV2Driver(manager_congress.ScenarioPolicyBase):
|
||||||
duration=200, sleep_for=10):
|
duration=200, sleep_for=10):
|
||||||
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')
|
||||||
|
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.')
|
||||||
|
|
|
@ -143,3 +143,11 @@ class TestNovaDriver(manager_congress.ScenarioPolicyBase):
|
||||||
duration=100, sleep_for=5):
|
duration=100, sleep_for=5):
|
||||||
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')
|
||||||
|
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.')
|
||||||
|
|
|
@ -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.')
|
|
@ -116,6 +116,19 @@ class ScenarioPolicyBase(manager.NetworkScenarioTest):
|
||||||
self.assertIn(self.router['id'],
|
self.assertIn(self.router['id'],
|
||||||
seen_router_ids)
|
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):
|
def _create_server(self, name, network):
|
||||||
keypair = self.create_keypair()
|
keypair = self.create_keypair()
|
||||||
self.keypairs[keypair['name']] = keypair
|
self.keypairs[keypair['name']] = keypair
|
||||||
|
|
Loading…
Reference in New Issue