Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 1 | # Copyright 2013 OpenStack Foundation |
| 2 | # All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | # not use this file except in compliance with the License. You may obtain |
| 6 | # a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | # License for the specific language governing permissions and limitations |
| 14 | # under the License. |
| 15 | |
vponomaryov | aa86a80 | 2014-01-06 09:29:58 +0200 | [diff] [blame] | 16 | from tempest import cli |
| 17 | from tempest import config |
Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 18 | from tempest.openstack.common import log as logging |
Matthew Treinish | 550f2ab | 2014-03-17 18:07:23 +0000 | [diff] [blame] | 19 | from tempest import test |
Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 20 | |
vponomaryov | aa86a80 | 2014-01-06 09:29:58 +0200 | [diff] [blame] | 21 | CONF = config.CONF |
Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 22 | |
| 23 | LOG = logging.getLogger(__name__) |
| 24 | |
| 25 | |
vponomaryov | aa86a80 | 2014-01-06 09:29:58 +0200 | [diff] [blame] | 26 | class SimpleReadOnlyCeilometerClientTest(cli.ClientTestBase): |
Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 27 | """Basic, read-only tests for Ceilometer CLI client. |
| 28 | |
| 29 | Checks return values and output of read-only commands. |
| 30 | These tests do not presume any content, nor do they create |
| 31 | their own. They only verify the structure of output if present. |
| 32 | """ |
| 33 | |
| 34 | @classmethod |
| 35 | def setUpClass(cls): |
| 36 | if (not CONF.service_available.ceilometer): |
Steven Hardy | 028d2e5 | 2014-01-06 10:03:11 +0000 | [diff] [blame] | 37 | msg = ("Skipping all Ceilometer cli tests because it is " |
Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 38 | "not available") |
| 39 | raise cls.skipException(msg) |
| 40 | super(SimpleReadOnlyCeilometerClientTest, cls).setUpClass() |
| 41 | |
| 42 | def test_ceilometer_meter_list(self): |
| 43 | self.ceilometer('meter-list') |
| 44 | |
Matthew Treinish | 550f2ab | 2014-03-17 18:07:23 +0000 | [diff] [blame] | 45 | @test.attr(type='slow') |
Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 46 | def test_ceilometer_resource_list(self): |
| 47 | self.ceilometer('resource-list') |
| 48 | |
| 49 | def test_ceilometermeter_alarm_list(self): |
| 50 | self.ceilometer('alarm-list') |
Masayuki Igawa | b7df179 | 2013-12-22 18:07:16 +0900 | [diff] [blame] | 51 | |
| 52 | def test_ceilometer_version(self): |
| 53 | self.ceilometer('', flags='--version') |