blob: 17b3bf6c94b4a0d30f1897f769cc65281c16b567 [file] [log] [blame]
Joe Gordon4edb6452013-03-05 21:18:59 +00001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2013 OpenStack Foundation
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
18import logging
19import subprocess
20
21import testtools
22
23import cli
24
25
26LOG = logging.getLogger(__name__)
27
28
29class SimpleReadOnlyNovaManageTest(cli.ClientTestBase):
30
31 """
32 This is a first pass at a simple read only nova-manage test. This
33 only exercises client commands that are read only.
34
35 This should test commands:
36 * with and without optional parameters
37 * initially just check return codes, and later test command outputs
38
39 """
40
41 def test_admin_fake_action(self):
42 self.assertRaises(subprocess.CalledProcessError,
43 self.nova_manage,
44 'this-does-nova-exist')
45
46 #NOTE(jogo): Commands in order listed in 'nova-manage -h'
47
48 # test flags
49 def test_help_flag(self):
50 self.nova_manage('', '-h')
51
52 @testtools.skip("version is empty, bug 1138844")
53 def test_version_flag(self):
54 self.assertNotEqual("", self.nova_manage('', '--version'))
55
56 # test actions
57 def test_version(self):
58 self.assertNotEqual("", self.nova_manage('version'))
59
60 def test_flavor_list(self):
61 self.assertNotEqual("", self.nova_manage('flavor list'))