Removed CLI tests from repo

CLI tests moved to python-muranoclient. It is safe to remove them
from this repo now.

Change-Id: I5f740817d5eac5bfba5ef5c52be273f1d5d68765
This commit is contained in:
Ruslan Kamaldinov 2015-05-13 15:29:05 +03:00
parent 4e5d37f8a6
commit d80ad455fc
6 changed files with 1 additions and 180 deletions

View File

@ -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

View File

@ -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

View File

@ -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]

View File

@ -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))