diff --git a/functionaltests/run_tests.sh b/functionaltests/run_tests.sh index ed826a459..e77db2f13 100755 --- a/functionaltests/run_tests.sh +++ b/functionaltests/run_tests.sh @@ -28,4 +28,5 @@ TEMPEST_DIR=${TEMPEST_DIR:-/opt/stack/new/tempest} # Add tempest source tree to PYTHONPATH export PYTHONPATH=$PYTHONPATH:$TEMPEST_DIR -nosetests -sv ../murano/tests/functional/api/v1 +nosetests -sv ../murano/tests/functional/api/v1 ../murano/tests/functional/cli/simple_read_only + diff --git a/murano/tests/functional/cli/__init__.py b/murano/tests/functional/cli/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/murano/tests/functional/cli/muranoclient.py b/murano/tests/functional/cli/muranoclient.py new file mode 100644 index 000000000..85a49e9a6 --- /dev/null +++ b/murano/tests/functional/cli/muranoclient.py @@ -0,0 +1,23 @@ +# Copyright (c) 2014 Mirantis, Inc. +# +# 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 import cli + + +class ClientTestBase(cli.ClientTestBase): + + def murano(self, action, flags='', params='', admin=True, fail_ok=False): + """Executes murano command for the given action.""" + return self.cmd_with_auth( + 'murano', action, flags, params, admin, fail_ok) diff --git a/murano/tests/functional/cli/simple_read_only/__init__.py b/murano/tests/functional/cli/simple_read_only/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/murano/tests/functional/cli/simple_read_only/test_murano.py b/murano/tests/functional/cli/simple_read_only/test_murano.py new file mode 100644 index 000000000..61f8dd081 --- /dev/null +++ b/murano/tests/functional/cli/simple_read_only/test_murano.py @@ -0,0 +1,42 @@ +# Copyright (c) 2014 Mirantis, Inc. +# +# 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 murano.tests.functional.cli import muranoclient + + +class SimpleReadOnlyMuranoClientTest(muranoclient.ClientTestBase): + """Basic, read-only tests for Murano CLI client. + + Basic smoke test for the Murano CLI commands which do not require + creating or modifying murano objects. + """ + + @classmethod + def setUpClass(cls): + super(SimpleReadOnlyMuranoClientTest, cls).setUpClass() + + def test_environment_list(self): + environments = self.parser.listing(self.murano('environment-list')) + + self.assertTableStruct(environments, + ['ID', 'Name', 'Created', 'Updated']) + + def test_package_list(self): + packages = self.parser.listing(self.murano('package-list')) + + self.assertTableStruct(packages, + ['ID', 'Name', 'FQN', 'Author', 'Is Public']) + + def test_category_list(self): + self.murano('category-list')