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 |
| 19 | |
vponomaryov | aa86a80 | 2014-01-06 09:29:58 +0200 | [diff] [blame] | 20 | CONF = config.CONF |
Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 21 | |
| 22 | LOG = logging.getLogger(__name__) |
| 23 | |
| 24 | |
vponomaryov | aa86a80 | 2014-01-06 09:29:58 +0200 | [diff] [blame] | 25 | class SimpleReadOnlyCeilometerClientTest(cli.ClientTestBase): |
Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 26 | """Basic, read-only tests for Ceilometer CLI client. |
| 27 | |
| 28 | Checks return values and output of read-only commands. |
| 29 | These tests do not presume any content, nor do they create |
| 30 | their own. They only verify the structure of output if present. |
| 31 | """ |
| 32 | |
| 33 | @classmethod |
| 34 | def setUpClass(cls): |
| 35 | if (not CONF.service_available.ceilometer): |
Steven Hardy | 028d2e5 | 2014-01-06 10:03:11 +0000 | [diff] [blame] | 36 | msg = ("Skipping all Ceilometer cli tests because it is " |
Mehdi Abaakouk | 8581c0b | 2013-10-04 10:45:42 +0200 | [diff] [blame] | 37 | "not available") |
| 38 | raise cls.skipException(msg) |
| 39 | super(SimpleReadOnlyCeilometerClientTest, cls).setUpClass() |
| 40 | |
| 41 | def test_ceilometer_meter_list(self): |
| 42 | self.ceilometer('meter-list') |
| 43 | |
| 44 | def test_ceilometer_resource_list(self): |
| 45 | self.ceilometer('resource-list') |
| 46 | |
| 47 | def test_ceilometermeter_alarm_list(self): |
| 48 | self.ceilometer('alarm-list') |
Masayuki Igawa | b7df179 | 2013-12-22 18:07:16 +0900 | [diff] [blame] | 49 | |
| 50 | def test_ceilometer_version(self): |
| 51 | self.ceilometer('', flags='--version') |