Merge "Fix Share Migration tempest tests"
This commit is contained in:
commit
94e62e1a41
@ -27,6 +27,8 @@ if [[ "$1" =~ "multibackend" ]]; then
|
||||
# if arg $1 has "multibackend", then we assume multibackend installation
|
||||
iniset $BASE/new/tempest/etc/tempest.conf share multi_backend True
|
||||
|
||||
iniset $BASE/new/tempest/etc/tempest.conf share run_migration_tests $(trueorfalse True RUN_MANILA_MIGRATION_TESTS)
|
||||
|
||||
# Set share backends names, they are defined within pre_test_hook
|
||||
export BACKENDS_NAMES="LONDON,PARIS"
|
||||
else
|
||||
|
@ -359,6 +359,7 @@ function create_service_share_servers {
|
||||
iniset $MANILA_CONF $BE service_instance_name_or_id $vm_id
|
||||
iniset $MANILA_CONF $BE service_net_name_or_ip private
|
||||
iniset $MANILA_CONF $BE tenant_net_name_or_ip private
|
||||
iniset $MANILA_CONF $BE migration_data_copy_node_ip $PUBLIC_NETWORK_GATEWAY
|
||||
fi
|
||||
done
|
||||
}
|
||||
@ -553,11 +554,13 @@ function update_tempest {
|
||||
}
|
||||
|
||||
function install_libraries {
|
||||
if [ "$MANILA_MULTI_BACKEND" = "True" ]; then
|
||||
if is_ubuntu; then
|
||||
install_package nfs-common
|
||||
else
|
||||
install_package nfs-utils
|
||||
if [ $(trueorfalse False MANILA_MULTI_BACKEND) == True ]; then
|
||||
if [ $(trueorfalse True RUN_MANILA_MIGRATION_TESTS) == True ]; then
|
||||
if is_ubuntu; then
|
||||
install_package nfs-common
|
||||
else
|
||||
install_package nfs-utils
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
@ -144,6 +144,9 @@ ShareGroup = [
|
||||
help="Defines whether to run consistency group tests or not. "
|
||||
"Disable this feature if used driver doesn't support "
|
||||
"it."),
|
||||
cfg.BoolOpt("run_migration_tests",
|
||||
default=False,
|
||||
help="Enable or disable migration tests."),
|
||||
cfg.StrOpt("image_with_share_tools",
|
||||
default="manila-service-image",
|
||||
help="Image name for vm booting with nfs/smb clients tool."),
|
||||
@ -160,7 +163,4 @@ ShareGroup = [
|
||||
default=1200,
|
||||
help="Time to wait for share migration before "
|
||||
"timing out (seconds)."),
|
||||
cfg.BoolOpt("migration_enabled",
|
||||
default=True,
|
||||
help="Enable or disable migration tests."),
|
||||
]
|
||||
|
@ -21,7 +21,7 @@ from manila_tempest_tests.tests.api import base
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class MigrationTest(base.BaseSharesAdminTest):
|
||||
class MigrationNFSTest(base.BaseSharesAdminTest):
|
||||
"""Tests Share Migration.
|
||||
|
||||
Tests migration in multi-backend environment.
|
||||
@ -31,23 +31,23 @@ class MigrationTest(base.BaseSharesAdminTest):
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(MigrationTest, cls).resource_setup()
|
||||
super(MigrationNFSTest, cls).resource_setup()
|
||||
if cls.protocol not in CONF.share.enable_protocols:
|
||||
message = "%s tests are disabled" % cls.protocol
|
||||
raise cls.skipException(message)
|
||||
if not CONF.share.run_migration_tests:
|
||||
raise cls.skipException("Migration tests disabled. Skipping.")
|
||||
|
||||
@test.attr(type=["gate", "smoke", ])
|
||||
@test.attr(type=["gate", ])
|
||||
def test_migration_empty_v2_5(self):
|
||||
|
||||
if not CONF.share.migration_enabled:
|
||||
raise self.skipException("Migration tests disabled. Skipping.")
|
||||
|
||||
pools = self.shares_client.list_pools()['pools']
|
||||
|
||||
if len(pools) < 2:
|
||||
raise self.skipException("At least two different running "
|
||||
"manila-share services are needed to "
|
||||
"run migration tests. Skipping.")
|
||||
raise self.skipException("At least two different pool entries "
|
||||
"are needed to run migration tests. "
|
||||
"Skipping.")
|
||||
|
||||
share = self.create_share(self.protocol)
|
||||
share = self.shares_client.get_share(share['id'])
|
||||
|
||||
@ -55,6 +55,7 @@ class MigrationTest(base.BaseSharesAdminTest):
|
||||
None)
|
||||
|
||||
self.assertIsNotNone(dest_pool)
|
||||
self.assertIsNotNone(dest_pool.get('name'))
|
||||
|
||||
dest_pool = dest_pool['name']
|
||||
|
||||
|
@ -39,6 +39,8 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
|
||||
# Manila clients
|
||||
cls.shares_client = clients_share.Manager().shares_client
|
||||
cls.shares_admin_client = clients_share.AdminManager().shares_client
|
||||
cls.shares_admin_v2_client = (
|
||||
clients_share.AdminManager().shares_v2_client)
|
||||
|
||||
def _create_share(self, share_protocol=None, size=1, name=None,
|
||||
snapshot_id=None, description=None, metadata=None,
|
||||
@ -184,7 +186,7 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
|
||||
return linux_client
|
||||
|
||||
def _migrate_share(self, share_id, dest_host, client=None):
|
||||
client = client or self.shares_client
|
||||
client = client or self.shares_admin_v2_client
|
||||
client.migrate_share(share_id, dest_host)
|
||||
share = client.wait_for_migration_completed(share_id, dest_host)
|
||||
return share
|
||||
|
@ -118,7 +118,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
|
||||
|
||||
def migrate_share(self, share_id, dest_host):
|
||||
share = self._migrate_share(share_id, dest_host,
|
||||
self.shares_admin_client)
|
||||
self.shares_admin_v2_client)
|
||||
return share
|
||||
|
||||
def create_share_network(self):
|
||||
@ -200,15 +200,15 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
|
||||
raise self.skipException("Test for CIFS protocol not supported "
|
||||
"at this moment. Skipping.")
|
||||
|
||||
if not CONF.share.migration_enabled:
|
||||
if not CONF.share.run_migration_tests:
|
||||
raise self.skipException("Migration tests disabled. Skipping.")
|
||||
|
||||
pools = self.shares_admin_client.list_pools()['pools']
|
||||
|
||||
if len(pools) < 2:
|
||||
raise self.skipException("At least two different running "
|
||||
"manila-share services are needed to "
|
||||
"run migration tests. Skipping.")
|
||||
raise self.skipException("At least two different pool entries "
|
||||
"are needed to run migration tests. "
|
||||
"Skipping.")
|
||||
|
||||
self.security_group = self._create_security_group()
|
||||
self.create_share_network()
|
||||
@ -219,6 +219,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
|
||||
None)
|
||||
|
||||
self.assertIsNotNone(dest_pool)
|
||||
self.assertIsNotNone(dest_pool.get('name'))
|
||||
|
||||
dest_pool = dest_pool['name']
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user