From 3fb4325c4bc0d1499d7f02c6a8ad5acc525d78b1 Mon Sep 17 00:00:00 2001 From: Alexey Stepanov Date: Mon, 22 Aug 2016 09:33:51 +0300 Subject: [PATCH] Pre-upgrade computes after upgrading of control plane Run octane upgrade-computeonly if upgrading from <8.0 onto >=9.0 PROD-6652 Upgrade MOS cloud 7.0->9.1: upgrade of control plane validation Change-Id: I54fd1d9acdf2aa67362e27b61fea6ffd8329bc02 --- .../tests/tests_upgrade/test_os_upgrade.py | 16 ++++++---- .../tests/tests_upgrade/upgrade_base.py | 29 ++++++++++++++++++- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/fuelweb_test/tests/tests_upgrade/test_os_upgrade.py b/fuelweb_test/tests/tests_upgrade/test_os_upgrade.py index 4fcd18882..27fa2f7e8 100644 --- a/fuelweb_test/tests/tests_upgrade/test_os_upgrade.py +++ b/fuelweb_test/tests/tests_upgrade/test_os_upgrade.py @@ -144,11 +144,13 @@ class TestOSupgrade(OSUpgradeBase): 2. Select cluster for upgrade and upgraded cluster 3. Run octane upgrade-control 4. Check cluster consistency - 5. Collect old controllers for upgrade - 6. Run octane upgrade-node - 7. Check tasks status after upgrade run completion - 8. Run network verification on target cluster - 9. Run minimal OSTF sanity check (user list) on target cluster + 5. Check, if required pre-upgrade computes packages and run: + run octane upgrade-compute ${SEED_ID} [... ] + 6. Collect old controllers for upgrade + 7. Run octane upgrade-node + 8. Check tasks status after upgrade run completion + 9. Run network verification on target cluster + 10. Run minimal OSTF sanity check (user list) on target cluster """ @@ -164,6 +166,10 @@ class TestOSupgrade(OSUpgradeBase): self.upgrade_control_plane_code(seed_cluster_id) + self.pre_upgrade_computes( + orig_cluster_id=self.orig_cluster_id, + seed_cluster_id=seed_cluster_id) + # upgrade controllers part self.upgrade_controllers_code(seed_cluster_id) diff --git a/fuelweb_test/tests/tests_upgrade/upgrade_base.py b/fuelweb_test/tests/tests_upgrade/upgrade_base.py index 68fc370bc..91dd4d335 100644 --- a/fuelweb_test/tests/tests_upgrade/upgrade_base.py +++ b/fuelweb_test/tests/tests_upgrade/upgrade_base.py @@ -14,6 +14,12 @@ from __future__ import unicode_literals +# pylint: disable=import-error +# pylint: disable=no-name-in-module +from distutils.version import LooseVersion +# pylint: enable=no-name-in-module +# pylint: enable=import-error + from proboscis.asserts import assert_equal from proboscis.asserts import assert_not_equal from proboscis.asserts import assert_true @@ -24,6 +30,8 @@ from fuelweb_test import logger from fuelweb_test.settings import KEYSTONE_CREDS from fuelweb_test.settings import OPENSTACK_RELEASE from fuelweb_test.settings import OPENSTACK_RELEASE_UBUNTU +from fuelweb_test.settings import UPGRADE_FUEL_FROM +from fuelweb_test.settings import UPGRADE_FUEL_TO from fuelweb_test.tests.tests_upgrade.test_data_driven_upgrade_base import \ DataDrivenUpgradeBase @@ -106,7 +114,7 @@ class OSUpgradeBase(DataDrivenUpgradeBase): assert_equal( self.fuel_web.get_cluster_release_id(new_cluster_id), self.fuel_web.client.get_release_id( - release_name='Liberty on Ubuntu 14.04')) + release_name='Mitaka on Ubuntu 14.04')) def upgrade_first_controller_code(self, seed_cluster_id): self.show_step(self.next_step) @@ -312,6 +320,25 @@ class OSUpgradeBase(DataDrivenUpgradeBase): self.minimal_check(seed_cluster_id=seed_cluster_id, nwk_check=True) + def pre_upgrade_computes(self, orig_cluster_id, seed_cluster_id): + self.show_step(self.next_step) + + # Fuel-octane can run pre-upgrade only starting from version 9.0 and + # we are upgrading packages only if version difference is >1 step + if LooseVersion(UPGRADE_FUEL_TO) >= LooseVersion('9.0') and \ + LooseVersion(UPGRADE_FUEL_FROM) < LooseVersion('8.0'): + + computes = self.fuel_web.get_nailgun_cluster_nodes_by_roles( + orig_cluster_id, ["compute"] + ) + + self.ssh_manager.check_call( + ip=self.ssh_manager.admin_ip, + command="octane upgrade-compute {0} {1}".format( + seed_cluster_id, + " ".join([str(comp["id"]) for comp in computes])), + error_info="octane upgrade-node failed") + def upgrade_nodes(self, seed_cluster_id, nodes_str, live_migration=False): self.ssh_manager.check_call( ip=self.ssh_manager.admin_ip,