Use dummy driver in functional tests CI job

For testing of manilaclient we need just some backend and
not some specific one. So, use dummy driver to avoid
possible real-driver-dependent problems in manilaclient functional
tests CI job.
Also fix NameError in functional tests that appears/reproducible
with such switch.

Change-Id: I14f3faf4c88eaca8d1cdec006fd1b4403dace66d
Closes-Bug: #1614981
Closes-Bug: #1631441
This commit is contained in:
vponomaryov 2016-10-07 17:46:22 +03:00 committed by Valeriy Ponomaryov
parent d7bd72fea6
commit 6f8f7d8c94
5 changed files with 8 additions and 6 deletions

View File

@ -60,6 +60,9 @@ iniset $MANILACLIENT_CONF DEFAULT admin_user_domain_id $OS_USER_DOMAIN_ID
SUPPRESS_ERRORS=${SUPPRESS_ERRORS_IN_CLEANUP:-True}
iniset $MANILACLIENT_CONF DEFAULT suppress_errors_in_cleanup $SUPPRESS_ERRORS
# Set access type usage specific to dummy driver that we are using in CI
iniset $MANILACLIENT_CONF DEFAULT access_types_mapping "nfs:ip,cifs:user"
# Create share network and use it for functional tests if required
USE_SHARE_NETWORK=$(trueorfalse True USE_SHARE_NETWORK)
if [[ ${USE_SHARE_NETWORK} = True ]]; then

View File

@ -15,7 +15,7 @@
# This script is executed inside pre_test_hook function in devstack gate.
# Run manila's pre_test_hook.sh script first
source $BASE/new/manila/contrib/ci/pre_test_hook.sh True generic multibackend
source $BASE/new/manila/contrib/ci/pre_test_hook.sh True dummy multibackend
localrc_path=$BASE/new/devstack/localrc

View File

@ -140,7 +140,7 @@ share_opts = [
"Allowed share protocols: nfs, cifs, cephfs, glusterfs, "
"hdfs."),
cfg.StrOpt("username_for_user_rules",
default="TESTDOMAIN\\Administrator",
default="stack",
help="Username, that will be used in share access tests for "
"user type of access."),
cfg.BoolOpt("run_snapshot_tests",

View File

@ -32,6 +32,7 @@ SHARE = 'share'
SHARE_TYPE = 'share_type'
SHARE_NETWORK = 'share_network'
SHARE_SERVER = 'share_server'
SNAPSHOT = 'snapshot'
def not_found_wrapper(f):
@ -40,7 +41,7 @@ def not_found_wrapper(f):
try:
return f(self, *args, **kwargs)
except tempest_lib_exc.CommandFailed as e:
for regexp in ('No (\w+) with a name or ID', 'not found'):
for regexp in ('No (\w+) with a name or ID', 'not(.*){0,5}found'):
if re.search(regexp, e.stderr):
# Raise appropriate 'NotFound' error
raise tempest_lib_exc.NotFound()

View File

@ -145,9 +145,7 @@ class SharesListReadWriteTest(base.BaseTestCase):
filters = filters or dict()
shares = self.user_client.list_shares(filters=filters)
self.assertTrue(len(shares) > 1)
for s_id in (self.private_share['id'], self.public_share['id']):
self.assertTrue(any(s_id == s['ID'] for s in shares))
self.assertTrue(len(shares) > 0)
if filters:
for share in shares:
try: