blob: ec978ece78c1af89c91f10ae894d8247eb1b81b1 [file] [log] [blame]
Mehdi Abaakoukb64d2b02018-09-03 11:50:49 +02001# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
Mehdi Abaakoukb64d2b02018-09-03 11:50:49 +020013import os
14
15from tempest import config
16import tempest.test
17
18from telemetry_tempest_plugin.scenario import utils
19
20CONF = config.CONF
21
22TEST_DIR = os.path.join(os.path.dirname(__file__), 'gnocchi_gabbits')
23
24
25class GnocchiGabbiTest(tempest.test.BaseTestCase):
26 credentials = ['admin']
27
28 TIMEOUT_SCALING_FACTOR = 5
29
30 @classmethod
31 def skip_checks(cls):
32 super(GnocchiGabbiTest, cls).skip_checks()
33 if not CONF.service_available.gnocchi:
34 raise cls.skipException("Gnocchi support is required")
35
36 def _prep_test(self, filename):
37 token = self.os_admin.auth_provider.get_token()
38 url = self.os_admin.auth_provider.base_url(
39 {'service': CONF.metric.catalog_type,
40 'endpoint_type': CONF.metric.endpoint_type,
41 'region': CONF.identity.region})
42
43 os.environ.update({
44 "GNOCCHI_SERVICE_URL": url,
45 "GNOCCHI_SERVICE_TOKEN": token,
46 "GNOCCHI_AUTHORIZATION": "not used",
47 })
48
49
50utils.generate_tests(GnocchiGabbiTest, TEST_DIR)