From 91b6d76613f24727b120d2694f913289062883c3 Mon Sep 17 00:00:00 2001 From: Eric K Date: Wed, 4 Apr 2018 15:24:20 -0700 Subject: [PATCH] add minimal test for monasca integration Depends-On: I5f4873752f41f7d0a4b0903f1f9e4d41eb05e810 Change-Id: I90eaf3fae8ad51268ea9ca4b667e0e4bd34f8082 --- .../congress_datasources/test_monasca.py | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 congress_tempest_plugin/tests/scenario/congress_datasources/test_monasca.py diff --git a/congress_tempest_plugin/tests/scenario/congress_datasources/test_monasca.py b/congress_tempest_plugin/tests/scenario/congress_datasources/test_monasca.py new file mode 100644 index 0000000..ce2e0af --- /dev/null +++ b/congress_tempest_plugin/tests/scenario/congress_datasources/test_monasca.py @@ -0,0 +1,46 @@ +# Copyright 2018 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 decorators +from tempest.lib import exceptions + +from congress_tempest_plugin.tests.scenario import manager_congress + + +CONF = config.CONF +DRIVER_NAME = 'monasca' + + +class TestMonascaDriver(manager_congress.ScenarioPolicyBase): + + @classmethod + def skip_checks(cls): + super(TestMonascaDriver, cls).skip_checks() + if not getattr(CONF.service_available, DRIVER_NAME, False): + msg = ("%s skipped because %s service is not configured" % + (cls.__class__.__name__, DRIVER_NAME)) + raise cls.skipException(msg) + + # TODO(testing): checks on correctness of data in updates + + @decorators.attr(type='smoke') + def test_update_no_error(self): + if not test_utils.call_until_true( + func=lambda: self.check_datasource_no_error(DRIVER_NAME), + duration=30, sleep_for=5): + raise exceptions.TimeoutException('Datasource could not poll ' + 'without error.')