Add openstack client stack basic funtion tests

Based from the existing heat function tests.
Can be expanded in the future with more then
read-only tests.  For now just get the tests
working with openstack client.

Change-Id: I1b84085b89c429b4b25f75d76d5c4b7b56d25326
Blueprint: heat-support-python-openstackclient
This commit is contained in:
Mark Vanderwiel 2016-01-29 15:52:59 -06:00
parent 78e7bcd189
commit bb866d4d75
4 changed files with 43 additions and 0 deletions

View File

@ -40,3 +40,6 @@ class ClientTestBase(base.ClientTestBase):
def heat(self, *args, **kwargs):
return self.clients.heat(*args, **kwargs)
def openstack(self, *args, **kwargs):
return self.clients.openstack(*args, **kwargs)

View File

@ -0,0 +1,40 @@
# 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 heatclient.tests.functional import base
class SimpleReadOnlyOpenStackClientTest(base.ClientTestBase):
"""Basic, read-only tests for Openstack CLI client heat plugin.
Basic smoke test for the openstack CLI commands which do not require
creating or modifying stacks.
"""
def test_openstack_fake_action(self):
self.assertRaises(exceptions.CommandFailed,
self.openstack,
'this-does-not-exist')
def test_openstack_stack_list(self):
self.openstack('stack list')
def test_openstack_stack_list_debug(self):
self.openstack('stack list', flags='--debug')
def test_openstack_help_cmd(self):
self.openstack('help stack')
def test_openstack_version(self):
self.openstack('', flags='--version')