Merge "Remove unused functional tests"

This commit is contained in:
Jenkins 2016-07-06 20:14:24 +00:00 committed by Gerrit Code Review
commit 5cf912636b
7 changed files with 4 additions and 189 deletions

View File

@ -0,0 +1,4 @@
---
prelude: >
Functional tests were replaced to sahara-tests repository. Please refer to
README of sahara-tests about how to run these tests now.

View File

@ -1,38 +0,0 @@
# 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):
"""Base class for saharaclient tests.
Establishes the sahara client and retrieves the essential environment
information.
"""
def _get_clients(self):
cli_dir = os.environ.get(
'OS_SAHARACLIENT_EXEC_DIR',
os.path.join(os.path.abspath('.'), '.tox/functional/bin'))
return 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'),
cli_dir=cli_dir)
def openstack(self, *args, **kwargs):
return self.clients.openstack(*args, **kwargs)

View File

@ -1,31 +0,0 @@
#!/bin/bash -xe
# 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.
# This script is executed inside post_test_hook function in devstack gate.
export SAHARACLIENT_DIR="$BASE/new/python-saharaclient"
# Get admin credentials
cd $BASE/new/devstack
source openrc admin admin
# Go to the saharaclient dir
cd $SAHARACLIENT_DIR
sudo chown -R jenkins:stack $SAHARACLIENT_DIR
# Run tests
echo "Running saharaclient functional test suite"
# Preserve env for OS_ credentials
sudo -E -H -u jenkins /usr/local/jenkins/slave_scripts/run-tox.sh functional

View File

@ -1,113 +0,0 @@
# 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 saharaclient.tests.functional import base
class SimpleReadOnlySaharaClientTest(base.ClientTestBase):
"""Basic, read-only tests for Sahara CLI client.
Checks return values and output of read-only commands.
These tests do not presume any content, nor do they create
their own. They only verify the structure of output if present.
"""
def test_openstack_cluster_list(self):
result = self.openstack('dataprocessing cluster list')
clusters = self.parser.listing(result)
self.assertTableStruct(clusters, [
'Name',
'Id',
'Plugin name',
'Plugin version',
'Status'
])
def test_openstack_cluster_template_list(self):
result = self.openstack('dataprocessing cluster template list')
templates = self.parser.listing(result)
self.assertTableStruct(templates, [
'Name',
'Id',
'Plugin name',
'Plugin version'
])
def test_openstack_image_list(self):
result = self.openstack('dataprocessing image list')
images = self.parser.listing(result)
self.assertTableStruct(images, [
'Name',
'Id',
'Username',
'Tags'
])
def test_openstack_job_binary_list(self):
result = self.openstack('dataprocessing job binary list')
job_binary = self.parser.listing(result)
self.assertTableStruct(job_binary, [
'name',
'url'
])
def test_openstack_job_template_list(self):
result = self.openstack('dataprocessing job template list')
job_template = self.parser.listing(result)
self.assertTableStruct(job_template, [
'name',
'type'
])
def test_openstack_data_source_list(self):
result = self.openstack('dataprocessing data source list')
data_source = self.parser.listing(result)
self.assertTableStruct(data_source, [
'name',
'type',
'url'
])
def test_openstack_job_type_list(self):
result = self.openstack('dataprocessing job type list')
job_type = self.parser.listing(result)
self.assertTableStruct(job_type, [
'Name',
'Plugins'
])
def test_openstack_node_group_template_list(self):
result = self.openstack('dataprocessing node group template list')
node_group = self.parser.listing(result)
self.assertTableStruct(node_group, [
'Name',
'Id',
'Plugin version',
'Plugin name'
])
def test_openstack_plugin_list(self):
result = self.openstack('dataprocessing plugin list')
plugin = self.parser.listing(result)
self.assertTableStruct(plugin, [
'Name',
'Versions'
])
def test_openstack_job_list(self):
result = self.openstack('dataprocessing job list')
jobs = self.parser.listing(result)
self.assertTableStruct(jobs, [
'id',
'cluster_id',
'status'
])

View File

@ -13,5 +13,4 @@ os-testr>=0.7.0 # Apache-2.0
reno>=1.8.0 # Apache2
requests-mock>=1.0 # Apache-2.0
sphinx!=1.3b1,<1.3,>=1.2.1 # BSD
tempest>=12.1.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD

View File

@ -28,12 +28,6 @@ commands = oslo_debug_helper -t saharaclient/tests/unit {posargs}
basepython = python3.4
commands = oslo_debug_helper -t saharaclient/tests/unit {posargs}
[testenv:functional]
passenv = OS_*
setenv =
DISCOVER_DIRECTORY=saharaclient/tests/functional/
commands = ostestr {posargs}
[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'