python-novaclient/novaclient/tests/functional/test_readonly_nova.py

52 lines
1.6 KiB
Python

# 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_lib import exceptions
from novaclient.tests.functional import base
class SimpleReadOnlyNovaClientTest(base.ClientTestBase):
"""
This is a first pass at a simple read only python-novaclient test. This
only exercises client commands that are read only.
This should test commands:
* as a regular user
* as a admin user
* with and without optional parameters
* initially just check return codes, and later test command outputs
"""
def test_admin_fake_action(self):
self.assertRaises(exceptions.CommandFailed,
self.nova,
'this-does-nova-exist')
# NOTE(jogo): Commands in order listed in 'nova help'
# Optional arguments:
def test_admin_version(self):
self.nova('', flags='--version')
def test_admin_debug_list(self):
self.nova('list', flags='--debug')
def test_admin_timeout(self):
self.nova('list', flags='--timeout %d' % 10)
def test_admin_timing(self):
self.nova('list', flags='--timing')