Use Tempest plugin interface

Make use of the Tempest plugin interface instead of copying Manila
files into Tempest. This will remove the burden to port Manila
tests onto Tempest master recurrently.

This ports all existing Manila Tempest test to the new structure.

It uses manila_tempest_tests as new top folder for all Tempest
tests. It follow the model of Heat (see [1]).

[1]: https://github.com/openstack/heat/tree/master/heat_integrationtests

Change-Id: Ie5ed64a6777ed1acf8dd56522c26705ae897596d
Partly-implements: bp tempest-plugin-interface
Depends-On: I26dd32b1de8cceeaa6dc674092efec683df71889
This commit is contained in:
Marc Koderer 2015-07-15 09:18:35 +02:00 committed by Ben Swartzlander
parent b0d2602548
commit 09798caae1
60 changed files with 202 additions and 174 deletions

View File

@ -89,11 +89,11 @@ set +o errexit
cd $BASE/new/tempest
export MANILA_TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-12}
export MANILA_TESTS=${MANILA_TESTS:-'tempest.api.share*'}
export MANILA_TESTS=${MANILA_TESTS:-'manila_tempest_tests.tests.api'}
if [[ "$JOB_NAME" =~ "scenario" ]]; then
echo "Set test set to scenario only"
MANILA_TESTS='tempest.scenario.*share*'
MANILA_TESTS='manila_tempest_tests.tests.scenario'
elif [[ "$JOB_NAME" =~ "no-share-servers" ]]; then
# Using approach without handling of share servers we have bigger load for
# volume creation in Cinder using Generic driver. So, reduce amount of
@ -102,5 +102,8 @@ elif [[ "$JOB_NAME" =~ "no-share-servers" ]]; then
MANILA_TEMPEST_CONCURRENCY=8
fi
# check if tempest plugin was installed corretly
echo 'import pkg_resources; print list(pkg_resources.iter_entry_points("tempest.test_plugins"))' | python
echo "Running tempest manila test suites"
sudo -H -u jenkins tox -eall $MANILA_TESTS -- --concurrency=$MANILA_TEMPEST_CONCURRENCY
sudo -H -u jenkins tox -eall-plugin $MANILA_TESTS -- --concurrency=$MANILA_TEMPEST_CONCURRENCY

View File

@ -55,14 +55,13 @@ fi
# created vm's in scenario tests.
echo 'ENABLE_ISOLATED_METADATA=True' >> $localrc_path
# Go to Tempest dir and checkout stable commit to avoid possible
# incompatibilities for plugin stored in Manila repo.
TEMPEST_COMMIT="489f5e62" # 15 June, 2015
TEMPEST_COMMIT="3b1bb9be3265f" # 28 Aug, 2015
cd $BASE/new/tempest
git checkout $TEMPEST_COMMIT
# Print current Tempest status
git status
# Install Manila Tempest integration
cp -r $BASE/new/manila/contrib/tempest/tempest/* $BASE/new/tempest/tempest

View File

@ -1,20 +0,0 @@
====================
Tempest Integration
====================
This directory contains the files necessary for tempest to cover Manila project.
To install:
$ TEMPEST_DIR=<path to tempest>
$ TEMPEST_COMMIT=<Commit-ID in `pre_test_hook.sh`>
$ cd ${TEMPEST_DIR}
$ git checkout ${TEMPEST_COMMIT}
$ cd -
$ cp -r tempest ${TEMPEST_DIR}
Notes
-----
These are pluggable-like files to Tempest project without requirement to change core Tempest files. But, due to constant changes of Tempest and absence of sync it can become incompatible with some states of Tempest. So, please look at file `contrib/ci/pre_test_hook.sh` where you can find commit that is used as HEAD of Tempest master branch.

View File

@ -120,7 +120,7 @@ def no_translate_debug_logs(logical_line, filename):
def validate_log_translations(logical_line, physical_line, filename):
# Translations are not required in the test and tempest
# directories.
if ("manila/tests" in filename or
if ("manila/tests" in filename or "manila_tempest_tests" in filename or
"contrib/tempest" in filename):
return
if pep8.noqa(physical_line):

View File

@ -0,0 +1,6 @@
====================
Tempest Integration
====================
This directory contains Tempest tests to cover Manila project.

View File

@ -15,7 +15,8 @@
from tempest import clients
from tempest.common import cred_provider
from tempest.services.share.json import shares_client
from manila_tempest_tests.services.share.json import shares_client
class Manager(clients.Manager):

View File

@ -152,20 +152,3 @@ ShareGroup = [
default="100",
help="Flavor used for client vm in scenario tests."),
]
class TempestConfigProxyManila(object):
"""Wrapper over standard Tempest config that sets Manila opts."""
def __init__(self):
self._config = config.CONF
config.register_opt_group(
cfg.CONF, service_available_group, ServiceAvailableGroup)
config.register_opt_group(cfg.CONF, share_group, ShareGroup)
self._config.share = cfg.CONF.share
def __getattr__(self, attr):
return getattr(self._config, attr)
CONF = TempestConfigProxyManila()

View File

@ -0,0 +1,41 @@
# Copyright 2015 Deutsche Telekom AG
# All Rights Reserved.
#
# 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 import config
from tempest.test_discover import plugins
from manila_tempest_tests import config as config_share
class ManilaTempestPlugin(plugins.TempestPlugin):
def load_tests(self):
base_path = os.path.split(os.path.dirname(
os.path.abspath(__file__)))[0]
test_dir = "manila_tempest_tests/tests"
full_test_dir = os.path.join(base_path, test_dir)
return full_test_dir, base_path
def register_opts(self, conf):
config.register_opt_group(
conf, config_share.service_available_group,
config_share.ServiceAvailableGroup)
config.register_opt_group(conf, config_share.share_group,
config_share.ShareGroup)
def get_opt_lists(self):
return [(config_share.share_group.name, config_share.ShareGroup)]

View File

@ -18,12 +18,12 @@ import time
import urllib
import six
from tempest import config # noqa
from tempest_lib.common import rest_client
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions
from tempest import config_share as config # noqa
from tempest import share_exceptions # noqa
from manila_tempest_tests import share_exceptions
CONF = config.CONF

View File

View File

@ -13,11 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,13 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import clients_share as clients
from tempest import config_share as config
from tempest import test
from manila_tempest_tests import clients_share as clients
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,11 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib.common.utils import data_utils # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,10 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.share import base
from tempest import clients_share as clients
from tempest import config_share as config
from tempest import test
from tempest import config # noqa
from tempest import test # noqa
from manila_tempest_tests import clients_share as clients
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,13 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import clients_share as clients
from tempest import config_share as config
from tempest import test
from manila_tempest_tests import clients_share as clients
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.share import base
from tempest.api.share import test_security_services
from tempest import test
from tempest import test # noqa
from manila_tempest_tests.tests.api import base
from manila_tempest_tests.tests.api import test_security_services
class SecurityServiceAdminTest(

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.share import base
from tempest import test
from tempest import test # noqa
from manila_tempest_tests.tests.api import base
class ServicesAdminTest(base.BaseSharesAdminTest):

View File

@ -13,11 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
from tempest.api.share import base
from tempest import clients_share as clients
from tempest import test
from manila_tempest_tests import clients_share as clients
from manila_tempest_tests.tests.api import base
class ServicesAdminNegativeTest(base.BaseSharesAdminTest):

View File

@ -13,13 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib.common.utils import data_utils # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.share import base
from tempest.api.share import test_share_networks
from tempest import test
from tempest import test # noqa
from manila_tempest_tests.tests.api import base
from manila_tempest_tests.tests.api import test_share_networks
class ShareNetworkAdminTest(

View File

@ -16,11 +16,11 @@
import re
import six # noqa
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import test # noqa
from tempest_lib.common.utils import data_utils # noqa
from tempest_lib import exceptions as lib_exc # noqa
from tempest.api.share import base
from tempest import clients_share as clients
from tempest import test
from manila_tempest_tests import clients_share as clients
from manila_tempest_tests.tests.api import base
class ShareServersNegativeAdminTest(base.BaseSharesAdminTest):

View File

@ -13,12 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib.common.utils import data_utils # noqa
from tempest_lib import exceptions as lib_exc # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -15,10 +15,10 @@
import copy
from tempest import test # noqa
from tempest_lib.common.utils import data_utils # noqa
from tempest.api.share import base
from tempest import test
from manila_tempest_tests.tests.api import base
class ExtraSpecsReadAdminTest(base.BaseSharesAdminTest):

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import test # noqa
from tempest_lib.common.utils import data_utils # noqa
from tempest_lib import exceptions as lib_exc # noqa
from tempest.api.share import base
from tempest import clients_share as clients
from tempest import test
from manila_tempest_tests import clients_share as clients
from manila_tempest_tests.tests.api import base
class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import test # noqa
from tempest_lib.common.utils import data_utils # noqa
from tempest_lib import exceptions as lib_exc # noqa
from tempest.api.share import base
from tempest import clients_share as clients
from tempest import test
from manila_tempest_tests import clients_share as clients
from manila_tempest_tests.tests.api import base
class ShareTypesAdminNegativeTest(base.BaseSharesAdminTest):

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib.common.utils import data_utils # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -20,14 +20,14 @@ import traceback
from oslo_concurrency import lockutils
from oslo_log import log
import six
from tempest.common import isolated_creds # noqa
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions
from tempest import clients_share as clients # noqa
from tempest.common import isolated_creds # noqa
from tempest import config_share as config # noqa
from tempest import share_exceptions # noqa
from tempest import test # noqa
from manila_tempest_tests import clients_share as clients
from manila_tempest_tests import share_exceptions
CONF = config.CONF
LOG = log.getLogger(__name__)

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.share import base
from tempest import test
from tempest import test # noqa
from manila_tempest_tests.tests.api import base
class ExtensionsTest(base.BaseSharesTest):

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.share import base
from tempest import test
from tempest import test # noqa
from manila_tempest_tests.tests.api import base
class ShareLimitsTest(base.BaseSharesTest):

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.share import base
from tempest import test
from tempest import test # noqa
from manila_tempest_tests.tests.api import base
class SharesMetadataTest(base.BaseSharesTest):

View File

@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
from tempest.api.share import base
from tempest import test
from manila_tempest_tests.tests.api import base
class SharesMetadataNegativeTest(base.BaseSharesTest):

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.share import base
from tempest import test
from tempest import test # noqa
from manila_tempest_tests.tests.api import base
class SharesQuotasTest(base.BaseSharesTest):

View File

@ -13,11 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import test
from manila_tempest_tests.tests.api import base
class SharesQuotasNegativeTest(base.BaseSharesTest):

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
from tempest.api.share import base
from tempest import test
from manila_tempest_tests.tests.api import base
class SchedulerStatsNegativeTest(base.BaseSharesTest):

View File

@ -15,11 +15,11 @@
from oslo_log import log # noqa
import six # noqa
from tempest import config # noqa
from tempest import test # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF
LOG = log.getLogger(__name__)

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.share import base
from tempest import test
from tempest import test # noqa
from manila_tempest_tests.tests.api import base
class SecurityServicesMappingTest(base.BaseSharesTest):

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -15,12 +15,12 @@
from oslo_log import log # noqa
import six # noqa
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF
LOG = log.getLogger(__name__)

View File

@ -14,11 +14,11 @@
# under the License.
import six # noqa
from tempest import config # noqa
from tempest import test # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import test # noqa
from tempest_lib.common.utils import data_utils # noqa
from tempest_lib import exceptions as lib_exc # noqa
from tempest.api.share import base
from tempest import clients_share as clients
from tempest import test
from manila_tempest_tests import clients_share as clients
from manila_tempest_tests.tests.api import base
class ShareTypesNegativeTest(base.BaseSharesTest):

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib.common.utils import data_utils # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import test
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,13 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import clients_share as clients
from tempest import config_share as config
from tempest import test
from manila_tempest_tests import clients_share as clients
from manila_tempest_tests.tests.api import base
CONF = config.CONF
@ -133,4 +133,4 @@ class SharesActionsNegativeTest(base.BaseSharesTest):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.shrink_share,
share['id'],
new_size)
new_size)

View File

@ -13,13 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib import exceptions as lib_exc # noqa
import testtools # noqa
from tempest.api.share import base
from tempest import config_share as config
from tempest import share_exceptions
from tempest import test
from manila_tempest_tests import share_exceptions
from manila_tempest_tests.tests.api import base
CONF = config.CONF

View File

@ -13,15 +13,15 @@
# License for the specific language governing permissions and limitations
# under the License.
import six # noqa
from oslo_log import log
import six
from oslo_log import log # noqa
from tempest_lib.common.utils import data_utils # noqa
from tempest.common.utils.linux import remote_client # noqa
from tempest import config # noqa
from tempest.scenario import manager # noqa
from tempest_lib.common.utils import data_utils
from tempest import clients_share
from tempest.common.utils.linux import remote_client
from tempest import config
from tempest.scenario import manager
from manila_tempest_tests import clients_share
CONF = config.CONF

View File

@ -14,12 +14,12 @@
# under the License.
from oslo_log import log as logging
from tempest import config # noqa
from tempest import test # noqa
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions
from tempest import config # noqa
from tempest.scenario import manager_share as manager # noqa
from tempest import test # noqa
from manila_tempest_tests.tests.scenario import manager_share as manager
CONF = config.CONF
@ -47,7 +47,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
if not hasattr(self, 'flavor_ref'):
self.flavor_ref = CONF.share.client_vm_flavor_ref
if CONF.share.image_with_share_tools:
images = self.images_client.list_images()
images = self.images_client.list_images()["images"]
for img in images:
if img["name"] == CONF.share.image_with_share_tools:
self.image_ref = img['id']
@ -79,7 +79,8 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
def init_ssh(self, instance, do_ping=False):
# Obtain a floating IP
floating_ip = self.floating_ips_client.create_floating_ip()
floating_ip = (self.floating_ips_client.create_floating_ip()
['floating_ip'])
self.addCleanup(self.delete_wrapper,
self.floating_ips_client.delete_floating_ip,
floating_ip['id'])

View File

@ -53,6 +53,8 @@ oslo.config.opts =
manila.share.drivers.emc.plugins =
vnx = manila.share.drivers.emc.plugins.vnx.connection:VNXStorageConnection
isilon = manila.share.drivers.emc.plugins.isilon.isilon:IsilonStorageConnection
tempest.test_plugins =
manila_tests = manila_tempest_tests.plugin:ManilaTempestPlugin
[build_sphinx]
all_files = 1