diff --git a/murano_plugin_tests/helpers/helpers.py b/murano_plugin_tests/helpers/helpers.py index fd579bd..e419892 100644 --- a/murano_plugin_tests/helpers/helpers.py +++ b/murano_plugin_tests/helpers/helpers.py @@ -802,3 +802,19 @@ class PluginHelper(object): def wait_os_cluster_readiness(self, timeout=15 * 60): self.fuel_web.assert_os_services_ready(self.cluster_id, timeout=timeout) + + def add_and_enable_yum_repo_with_detach_plugin(self): + cmd = ('yum-config-manager --add-repo' + 'http://mirror.seed-cz1.fuel-infra.org/' + 'mos-plugins/centos/9.0/') + self.ssh_manager.check_call( + ip=self.ssh_manager.admin_ip, + command=cmd) + + def install_detach_murano_plugin_from_repository(self, plugin_name): + cmds = ["yum install -y {}".format(plugin_name), + 'fuel plugins --sync'] + for cmd in cmds: + self.ssh_manager.check_call( + ip=self.ssh_manager.admin_ip, + command=cmd) diff --git a/murano_plugin_tests/murano_plugin/api.py b/murano_plugin_tests/murano_plugin/api.py index 62f1c56..81b98b6 100644 --- a/murano_plugin_tests/murano_plugin/api.py +++ b/murano_plugin_tests/murano_plugin/api.py @@ -105,12 +105,15 @@ class MuranoPluginApi(object): def run_ostf(self, test_sets): self.helpers.run_ostf(test_sets=test_sets) - def activate_plugin(self, options=None): + def activate_plugin(self, name=None, version=None, options=None): """Enable and configure the plugin in the environment.""" + if name is None: + name = self.settings.name + if version is None: + version = self.settings.version if options is None: options = self.settings.default_options - self.helpers.activate_plugin( - self.settings.name, self.settings.version, options) + self.helpers.activate_plugin(name, version, options) @retry(count=3, delay=120) def check_plugin_online(self): diff --git a/murano_plugin_tests/murano_plugin/test_murano_plugin_upgrade.py b/murano_plugin_tests/murano_plugin/test_murano_plugin_upgrade.py new file mode 100644 index 0000000..e729245 --- /dev/null +++ b/murano_plugin_tests/murano_plugin/test_murano_plugin_upgrade.py @@ -0,0 +1,178 @@ +# Copyright 2016 Mirantis, Inc. +# +# 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 fuelweb_test.helpers.decorators import log_snapshot_after_test +from proboscis import test + +from murano_plugin_tests.murano_plugin import api +from murano_plugin_tests.murano_plugin import plugin_settings + + +@test(groups=["plugins"]) +class TestMuranoPluginUpgrade(api.MuranoPluginApi): + """Class for upgrade testing the Murano plugin.""" + + @test(depends_on_groups=["prepare_slaves_3"], + groups=["upgrade_murano_plugin_on_controller", + "deploy", "murano_plugin", "upgrade", 'murano']) + @log_snapshot_after_test + def upgrade_murano_plugin_on_controller(self): + """Upgrade old Murano Plugin via the new one on controller. + + Scenario: + 1. Upload the Murano plugin(version 1.1.0) to the master node + 2. Install the plugin + 3. Create the cluster + 4. Add 1 node with controller role + 5. Add 1 node with compute and cinder roles + 6. Deploy the cluster + 7. Run OSTF + 8. Upload new version of the Murano plugin to the master node + 9. Install new plugin + 10. Upgrade old version of the plugin on the controller + 11. Update cluster + 12. Run OSTF + + Duration 120m + Snapshot upgrade_murano_plugin_on_controller + """ + + self.env.revert_snapshot("ready_with_3_slaves") + + self.helpers.add_and_enable_yum_repo_with_detach_plugin() + + self.helpers.install_detach_murano_plugin_from_repository( + 'detach-murano-1.1.noarch') + + self.helpers.create_cluster(name=self.__class__.__name__) + + self.activate_plugin('detach-murano', '1.1.0') + + self.helpers.deploy_cluster(self.only_controllers) + + self.run_ostf(['sanity', 'smoke']) + self.check_plugin_online() + + self.prepare_plugin() + + self.activate_plugin() + + self.helpers.apply_changes() + + self.run_ostf(['sanity', 'smoke']) + self.check_plugin_online() + + @test(depends_on_groups=["prepare_slaves_3"], + groups=["upgrade_murano_plugin_add_murano_node", + "deploy", "murano_plugin", "upgrade", 'murano']) + @log_snapshot_after_test + def upgrade_murano_plugin_add_murano_node(self): + """Upgrade old Murano Plugin via the new one with adding murano-node. + + Scenario: + 1. Upload the Murano plugin(version 1.1.0) to the master node + 2. Install the plugin + 3. Create the cluster + 4. Add 1 node with controller role + 5. Add 1 node with compute and cinder roles + 6. Deploy the cluster + 7. Run OSTF + 8. Upload new version of the Murano plugin to the master node + 9. Install new plugin + 10. Add 1 node with compute and murano-node roles + 11. Upgrade old version of the plugin + 12. Update cluster + 13. Run OSTF + + Duration 120m + Snapshot upgrade_murano_plugin_add_murano_node + """ + + self.env.revert_snapshot("ready_with_3_slaves") + + self.helpers.add_and_enable_yum_repo_with_detach_plugin() + + self.helpers.install_detach_murano_plugin_from_repository( + 'detach-murano-1.1.noarch') + + self.helpers.create_cluster(name=self.__class__.__name__) + + self.activate_plugin('detach-murano', '1.1.0') + + self.helpers.deploy_cluster(self.only_controllers) + + self.run_ostf(['sanity', 'smoke']) + self.check_plugin_online() + + self.prepare_plugin() + + self.activate_plugin() + + self.helpers.deploy_cluster({ + 'slave-03': plugin_settings.role_name, + }) + + self.run_ostf(['sanity', 'smoke']) + self.check_plugin_online() + + @test(depends_on_groups=["prepare_slaves_3"], + groups=["upgrade_murano_plugin_on_murano_node", + "deploy", "murano_plugin", "upgrade", 'murano']) + @log_snapshot_after_test + def upgrade_murano_plugin_on_murano_node(self): + """Upgrade old Murano Plugin via the new one on murano-node. + + Scenario: + 1. Upload the Murano plugin(version 1.1.0) to the master node + 2. Install the plugin + 3. Create the cluster + 4. Add 1 node with controller role + 5. Add 1 node with compute and cinder roles + 6. Add 1 node with murano-node roles + 7. Deploy the cluster + 8. Run OSTF + 9. Upload new version of the Murano plugin to the master node + 10. Install new plugin + 11. Upgrade old version of the plugin + 12. Update cluster + 13. Run OSTF + + Duration 120m + Snapshot upgrade_murano_plugin_on_murano_node + """ + + self.env.revert_snapshot("ready_with_3_slaves") + + self.helpers.add_and_enable_yum_repo_with_detach_plugin() + + self.helpers.install_detach_murano_plugin_from_repository( + 'detach-murano-1.1.noarch') + + self.helpers.create_cluster(name=self.__class__.__name__) + + self.activate_plugin('detach-murano', '1.1.0') + + self.helpers.deploy_cluster(self.base_nodes) + + self.run_ostf(['sanity', 'smoke']) + self.check_plugin_online() + + self.prepare_plugin() + + self.activate_plugin() + + self.helpers.apply_changes() + + self.run_ostf(['sanity', 'smoke']) + self.check_plugin_online() diff --git a/murano_plugin_tests/murano_plugin/test_post_install.py b/murano_plugin_tests/murano_plugin/test_post_install.py index 07577cb..6c0b706 100644 --- a/murano_plugin_tests/murano_plugin/test_post_install.py +++ b/murano_plugin_tests/murano_plugin/test_post_install.py @@ -116,11 +116,11 @@ class TestMuranoPostInstallation(api.MuranoPluginApi): self.check_plugin_online() @test(depends_on_groups=["deploy_murano_plugin_on_controller"], - groups=["move_murano_plugin_on_environment_from_controller" + groups=["move_murano_plugin_on_env_from_controller" "_to_murano_node", "deploy", "murano_plugin", "post_installation", 'murano']) @log_snapshot_after_test - def move_murano_plugin_on_environment_from_controller_to_murano_node(self): + def move_murano_plugin_on_env_from_controller_to_murano_node(self): """Move Murano plugin on environment from controller to murano-node. Scenario: 1. Revert snapshot with deployed non-ha cluster with Murano plugin @@ -128,7 +128,7 @@ class TestMuranoPostInstallation(api.MuranoPluginApi): 3. Deploy changes 4. Run OSTF Duration 120m - Snapshot move_murano_plugin_on_environment_from_controller_to_murano_node + Snapshot move_murano_plugin_on_env_from_controller_to_murano_node """ self.env.revert_snapshot("deploy_murano_plugin_on_controller") @@ -138,4 +138,4 @@ class TestMuranoPostInstallation(api.MuranoPluginApi): }) self.run_ostf(['sanity', 'smoke']) - self.check_plugin_online() \ No newline at end of file + self.check_plugin_online() diff --git a/murano_plugin_tests/run_system_test.py b/murano_plugin_tests/run_system_test.py index 946ec09..c9592b2 100644 --- a/murano_plugin_tests/run_system_test.py +++ b/murano_plugin_tests/run_system_test.py @@ -44,6 +44,7 @@ def import_tests(): from murano_plugin import test_murano_maintenance_update # noqa from murano_plugin import test_murano_plugin_bvt # noqa from murano_plugin import test_murano_plugin_update # noqa + from murano_plugin import test_murano_plugin_upgrade # noqa from murano_plugin import test_post_install # noqa from murano_plugin import test_system # noqa