Use ExampleV4 plugin in backup-restore tests
V3 plugin is deprecated in 9.1 and contains dropped tasks - it's impossible to use in for testing - replacing the plugin. Change-Id: Id25a324d490144556938c80b1b6931ce361dd237 Closes-bug:1621105
This commit is contained in:
parent
0e0774fc2a
commit
403ab4492c
@ -438,6 +438,8 @@ UPGRADE_FUEL_TO = os.environ.get('UPGRADE_FUEL_TO', '9.0')
|
||||
OCTANE_PATCHES = os.environ.get('OCTANE_PATCHES', None)
|
||||
EXAMPLE_V3_PLUGIN_REMOTE_URL = os.environ.get('EXAMPLE_V3_PLUGIN_REMOTE_URL',
|
||||
None)
|
||||
EXAMPLE_V4_PLUGIN_REMOTE_URL = os.environ.get('EXAMPLE_V4_PLUGIN_REMOTE_URL',
|
||||
None)
|
||||
UPGRADE_BACKUP_FILES_LOCAL_DIR = os.environ.get(
|
||||
'UPGRADE_BACKUP_FILES_LOCAL_DIR', os.path.join(
|
||||
os.path.curdir, "..", "backup_storage"))
|
||||
|
@ -22,6 +22,8 @@ from fuelweb_test.helpers.decorators import log_snapshot_after_test
|
||||
from fuelweb_test.tests.base_test_case import SetupEnvironment
|
||||
from fuelweb_test.tests.tests_upgrade.test_data_driven_upgrade_base import \
|
||||
DataDrivenUpgradeBase
|
||||
from fuelweb_test.tests.tests_upgrade.test_data_driven_upgrade_base import \
|
||||
LooseVersion
|
||||
|
||||
|
||||
@test
|
||||
@ -33,6 +35,15 @@ class UpgradePlugin(DataDrivenUpgradeBase):
|
||||
self.backup_name = "backup_plugin.tar.gz"
|
||||
self.repos_backup_name = "repos_backup_plugin.tar.gz"
|
||||
|
||||
if LooseVersion(settings.UPGRADE_FUEL_FROM) < LooseVersion("9.0"):
|
||||
self.plugin_url = settings.EXAMPLE_V3_PLUGIN_REMOTE_URL
|
||||
self.plugin_name = "fuel_plugin_example_v3"
|
||||
self.plugin_custom_role = "fuel_plugin_example_v3"
|
||||
else:
|
||||
self.plugin_url = settings.EXAMPLE_V4_PLUGIN_REMOTE_URL
|
||||
self.plugin_name = "fuel_plugin_example_v4"
|
||||
self.plugin_custom_role = "fuel_plugin_example_v4"
|
||||
|
||||
@test(groups=['upgrade_plugin_backup'],
|
||||
depends_on=[SetupEnvironment.prepare_release])
|
||||
@log_snapshot_after_test
|
||||
@ -56,11 +67,12 @@ class UpgradePlugin(DataDrivenUpgradeBase):
|
||||
Duration: TODO
|
||||
Snapshot: upgrade_plugin_backup
|
||||
"""
|
||||
assert_is_not_none(settings.EXAMPLE_V3_PLUGIN_REMOTE_URL,
|
||||
"EXAMPLE_V3_PLUGIN_REMOTE_URL is not defined!")
|
||||
|
||||
assert_is_not_none(self.plugin_url,
|
||||
"EXAMPLE_V[34]_PLUGIN_REMOTE_URL is not defined!")
|
||||
example_plugin_remote_name = os.path.join(
|
||||
"/var",
|
||||
os.path.basename(settings.EXAMPLE_V3_PLUGIN_REMOTE_URL))
|
||||
os.path.basename(self.plugin_url))
|
||||
|
||||
self.check_run(self.source_snapshot_name)
|
||||
|
||||
@ -71,7 +83,7 @@ class UpgradePlugin(DataDrivenUpgradeBase):
|
||||
admin_remote = self.env.d_env.get_admin_remote()
|
||||
admin_remote.check_call(
|
||||
"curl -s {url} > {location}".format(
|
||||
url=settings.EXAMPLE_V3_PLUGIN_REMOTE_URL,
|
||||
url=self.plugin_url,
|
||||
location=example_plugin_remote_name))
|
||||
admin_remote.check_call(
|
||||
"fuel plugins --install {location} ".format(
|
||||
@ -98,11 +110,11 @@ class UpgradePlugin(DataDrivenUpgradeBase):
|
||||
'name': self.upgrade_plugin_backup.__name__,
|
||||
'settings': cluster_settings,
|
||||
'plugin':
|
||||
{'name': 'fuel_plugin_example_v3',
|
||||
{'name': self.plugin_name,
|
||||
'data': {'metadata/enabled': True}},
|
||||
'nodes':
|
||||
{'slave-01': ['controller'],
|
||||
'slave-02': ['fuel_plugin_example_v3'],
|
||||
'slave-02': [self.plugin_custom_role],
|
||||
'slave-03': ['compute', 'ceph-osd'],
|
||||
'slave-04': ['compute', 'ceph-osd'],
|
||||
'slave-05': ['compute', 'ceph-osd']}
|
||||
@ -157,12 +169,12 @@ class UpgradePlugin(DataDrivenUpgradeBase):
|
||||
cluster_id = self.fuel_web.get_last_created_cluster()
|
||||
self.show_step(6)
|
||||
attr = self.fuel_web.client.get_cluster_attributes(cluster_id)
|
||||
assert_true('fuel_plugin_example_v3' in attr['editable'],
|
||||
assert_true(self.plugin_name in attr['editable'],
|
||||
"Can't find plugin data in cluster attributes!")
|
||||
admin_remote = self.env.d_env.get_admin_remote()
|
||||
stdout = admin_remote.check_call(
|
||||
"find /var/www/nailgun/plugins/ "
|
||||
"-name fuel_plugin_example_v3*")['stdout']
|
||||
"-name fuel_plugin_example_v*")['stdout']
|
||||
assert_not_equal(len(stdout), 0, "Can not find plugin's directory")
|
||||
plugin_dir = stdout[0].strip()
|
||||
|
||||
@ -206,7 +218,7 @@ class UpgradePlugin(DataDrivenUpgradeBase):
|
||||
len(self.fuel_web.client.list_nodes()) + 1)
|
||||
self.env.bootstrap_nodes([self.env.d_env.get_node(name=slave_name)])
|
||||
self.fuel_web.update_nodes(cluster_id,
|
||||
{slave_name: ['fuel_plugin_example_v3']})
|
||||
{slave_name: [self.plugin_custom_role]})
|
||||
self.show_step(3)
|
||||
self.fuel_web.verify_network(cluster_id)
|
||||
self.show_step(4)
|
||||
|
Loading…
Reference in New Issue
Block a user