From d80ad455fccd8492dfdbe2cfa0edbc150a82a4c8 Mon Sep 17 00:00:00 2001 From: Ruslan Kamaldinov Date: Wed, 13 May 2015 15:29:05 +0300 Subject: [PATCH] Removed CLI tests from repo CLI tests moved to python-muranoclient. It is safe to remove them from this repo now. Change-Id: I5f740817d5eac5bfba5ef5c52be273f1d5d68765 --- functionaltests/run_tests.sh | 2 +- functionaltests/run_tests_common.sh | 6 - murano/tests/functional/cli/__init__.py | 0 murano/tests/functional/cli/muranoclient.py | 44 ------ .../cli/simple_read_only/__init__.py | 0 .../cli/simple_read_only/test_murano.py | 129 ------------------ 6 files changed, 1 insertion(+), 180 deletions(-) delete mode 100644 murano/tests/functional/cli/__init__.py delete mode 100644 murano/tests/functional/cli/muranoclient.py delete mode 100644 murano/tests/functional/cli/simple_read_only/__init__.py delete mode 100644 murano/tests/functional/cli/simple_read_only/test_murano.py diff --git a/functionaltests/run_tests.sh b/functionaltests/run_tests.sh index f843a3bc1..39ab8cb21 100755 --- a/functionaltests/run_tests.sh +++ b/functionaltests/run_tests.sh @@ -2,4 +2,4 @@ source ./run_tests_common.sh -nosetests -sv ../murano/tests/functional/api/v1 ../murano/tests/functional/cli/simple_read_only +nosetests -sv ../murano/tests/functional/api/v1 diff --git a/functionaltests/run_tests_common.sh b/functionaltests/run_tests_common.sh index 10b8ffbd8..6d74b6352 100755 --- a/functionaltests/run_tests_common.sh +++ b/functionaltests/run_tests_common.sh @@ -23,9 +23,3 @@ pip install -r $TEMPEST_DIR/requirements.txt #installing test requirements for murano pip install -r ../test-requirements.txt - -# Get admin credentials -cwd=$(pwd) -cd /opt/stack/new/devstack -source openrc admin admin -cd $cwd diff --git a/murano/tests/functional/cli/__init__.py b/murano/tests/functional/cli/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/murano/tests/functional/cli/muranoclient.py b/murano/tests/functional/cli/muranoclient.py deleted file mode 100644 index 2001667f8..000000000 --- a/murano/tests/functional/cli/muranoclient.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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. - -import os - -from tempest_lib.cli import base - - -class ClientTestBase(base.ClientTestBase): - - def murano(self, action, flags='', params='', - fail_ok=False, endpoint_type='publicURL', merge_stderr=True): - return self.clients.cmd_with_auth( - 'murano', action, flags, params, fail_ok, merge_stderr) - - def _get_clients(self): - clients = base.CLIClient( - username=os.environ.get('OS_USERNAME'), - password=os.environ.get('OS_PASSWORD'), - tenant_name=os.environ.get('OS_TENANT_NAME'), - uri=os.environ.get('OS_AUTH_URL'), - # FIXME: see how it's done in saharaclient - cli_dir='/usr/local/bin' - ) - return clients - - def listing(self, command, params=""): - return self.parser.listing(self.murano(command, params=params)) - - def get_value(self, need_field, known_field, known_value, somelist): - for element in somelist: - if element[known_field] == known_value: - return element[need_field] diff --git a/murano/tests/functional/cli/simple_read_only/__init__.py b/murano/tests/functional/cli/simple_read_only/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/murano/tests/functional/cli/simple_read_only/test_murano.py b/murano/tests/functional/cli/simple_read_only/test_murano.py deleted file mode 100644 index 8d686b984..000000000 --- a/murano/tests/functional/cli/simple_read_only/test_murano.py +++ /dev/null @@ -1,129 +0,0 @@ -# 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. - -import time -import uuid - -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.listing('environment-list') - - self.assertTableStruct(environments, - ['ID', 'Name', 'Created', 'Updated']) - - def test_package_list(self): - packages = self.listing('package-list') - - self.assertTableStruct(packages, - ['ID', 'Name', 'FQN', 'Author', 'Is Public']) - - def test_category_list(self): - self.murano('category-list') - - def test_table_struct_of_environment_create(self): - env_name = "gg" + uuid.uuid4().hex - environment = self.listing('environment-create', params=env_name) - - self.assertTableStruct(environment, - ['ID', 'Name', 'Created', 'Updated']) - - def test_table_struct_of_environment_delete(self): - env_name = "gg" + uuid.uuid4().hex - environment = self.listing('environment-create', params=env_name) - - ID = self.get_value('ID', 'Name', env_name, environment) - - delete_env = self.listing('environment-delete', params=ID) - - self.assertTableStruct(delete_env, - ['ID', 'Name', 'Created', 'Updated']) - - -class EnvironmentMuranoClientTest(muranoclient.ClientTestBase): - - @classmethod - def setUpClass(cls): - super(EnvironmentMuranoClientTest, cls).setUpClass() - - def test_environment_create(self): - env_name = "gg" + uuid.uuid4().hex - environment = self.listing('environment-create', params=env_name) - - environment_list = self.listing('environment-list') - - self.assertIn(env_name, [env['Name'] for env in environment]) - self.assertIn(env_name, [env['Name'] for env in environment_list]) - - def test_environment_delete(self): - env_name = "gg" + uuid.uuid4().hex - environments = self.listing('environment-create', params=env_name) - - ID = self.get_value('ID', 'Name', env_name, environments) - - self.listing('environment-delete', params=ID) - - start_time = time.time() - while env_name in [env['Name'] - for env in self.listing('environment-list')]: - if start_time - time.time() > 60: - self.fail("Environment is not deleted in 60 seconds") - - def test_environment_show(self): - env_name = "gg" + uuid.uuid4().hex - environment = self.listing('environment-create', params=env_name) - - ID = self.get_value('ID', 'Name', env_name, environment) - - created = self.get_value('Created', 'Name', env_name, environment) - updated = self.get_value('Updated', 'Name', env_name, environment) - - show_env = self.listing('environment-show', params=ID) - - self.assertEqual(env_name, self.get_value('Value', 'Property', 'name', - show_env)) - self.assertEqual(created, self.get_value('Value', 'Property', - 'created', show_env)) - self.assertEqual(updated, self.get_value('Value', 'Property', - 'updated', show_env)) - - def test_environment_rename(self): - env_name = "gg" + uuid.uuid4().hex - environment = self.listing('environment-create', params=env_name) - - ID = self.get_value('ID', 'Name', env_name, environment) - - new_name = "renamed" + uuid.uuid4().hex - rename_env = self.listing('environment-rename', - params='{id} {name}'.format(id=ID, - name=new_name)) - - show_env = self.listing('environment-show', params=ID) - - self.assertEqual(new_name, self.get_value('Name', 'ID', ID, - rename_env)) - self.assertEqual(new_name, self.get_value('Value', 'Property', 'name', - show_env))