diff --git a/cou/apps/auxiliary.py b/cou/apps/auxiliary.py index e05f03d3..5f60665b 100644 --- a/cou/apps/auxiliary.py +++ b/cou/apps/auxiliary.py @@ -628,7 +628,7 @@ def post_upgrade_steps( :return: List of post upgrade steps. :rtype: list[PostUpgradeStep] """ - upgrade_step = self._get_upgrade_charm_step(target=target) + upgrade_step = self._get_upgrade_charm_steps(target=target) steps = [] # Add unseal steps only if chaneel is changed. diff --git a/cou/apps/base.py b/cou/apps/base.py index 69eb8125..5fab113a 100644 --- a/cou/apps/base.py +++ b/cou/apps/base.py @@ -436,7 +436,7 @@ def pre_upgrade_steps( """ return [ self._get_upgrade_current_release_packages_step(units), - self._get_refresh_charm_step(target), + *self._get_refresh_charm_steps(target), ] def upgrade_steps( @@ -455,7 +455,7 @@ def upgrade_steps( """ return [ self._set_action_managed_upgrade(enable=bool(units)), - self._get_upgrade_charm_step(target), + *self._get_upgrade_charm_steps(target), self._get_change_install_repository_step(target), self._get_units_upgrade_steps(units, force), ] @@ -569,28 +569,37 @@ def _get_upgrade_current_release_packages_step( return step - def _get_refresh_charm_step(self, target: OpenStackRelease) -> PreUpgradeStep: - """Get step for refreshing the charm. + def _get_refresh_charm_steps(self, target: OpenStackRelease) -> list[PreUpgradeStep]: + """Get steps for refreshing the charm. :param target: OpenStack release as target to upgrade :type target: OpenStackRelease :raises ApplicationError: When application has unexpected channel. - :return: Step for refreshing the charm - :rtype: PreUpgradeStep + :return: Steps for refreshing the charm + :rtype: list[PreUpgradeStep] """ + wait_step = PreUpgradeStep( + description=f"Wait for up to {STANDARD_IDLE_TIMEOUT}s for " + f"app '{self.name}' to reach the idle state", + parallel=False, + coro=self.model.wait_for_idle(STANDARD_IDLE_TIMEOUT, apps=[self.name]), + ) if self.is_from_charm_store: - return self._get_charmhub_migration_step(target) + return [self._get_charmhub_migration_step(target), wait_step] if self.channel in LATEST_STABLE: - return self._get_change_channel_possible_downgrade_step( - target, self.expected_current_channel(target) - ) + return [ + self._get_change_channel_possible_downgrade_step( + target, self.expected_current_channel(target) + ), + wait_step, + ] if self._need_current_channel_refresh(target): - return self._get_refresh_current_channel_step() + return [self._get_refresh_current_channel_step(), wait_step] logger.info( "'%s' does not need to refresh the current channel: %s", self.name, self.channel ) - return PreUpgradeStep() + return [] def _get_charmhub_migration_step(self, target: OpenStackRelease) -> PreUpgradeStep: """Get the step for charm hub migration from charm store. @@ -656,30 +665,38 @@ def _need_current_channel_refresh(self, target: OpenStackRelease) -> bool: """ return bool(self.can_upgrade_to) and self.channel_o7k_release <= target - def _get_upgrade_charm_step(self, target: OpenStackRelease) -> UpgradeStep: - """Get step for upgrading the charm. + def _get_upgrade_charm_steps(self, target: OpenStackRelease) -> list[UpgradeStep]: + """Get steps for upgrading the charm. :param target: OpenStack release as target to upgrade. :type target: OpenStackRelease :raises ApplicationError: When the current channel is ahead from expected and the target. - :return: Step for upgrading the charm. - :rtype: UpgradeStep + :return: List of steps for upgrading the charm. + :rtype: list[UpgradeStep] """ channel = self.expected_current_channel(target) if self.need_crossgrade else self.channel if channel == self.target_channel(target): logger.debug("%s channel already set to %s", self.name, self.channel) - return UpgradeStep() + return [] # Normally, prior the upgrade the channel is equal to the application release. # However, when colocated with other app, the channel can be in a release lesser than the # workload version of the application. if self.channel_o7k_release <= self.o7k_release or self.multiple_channels: - return UpgradeStep( - description=f"Upgrade '{self.name}' from '{channel}' to the new channel: " - f"'{self.target_channel(target)}'", - coro=self.model.upgrade_charm(self.name, self.target_channel(target)), - ) + return [ + UpgradeStep( + description=f"Upgrade '{self.name}' from '{channel}' to the new channel: " + f"'{self.target_channel(target)}'", + coro=self.model.upgrade_charm(self.name, self.target_channel(target)), + ), + UpgradeStep( + description=f"Wait for up to {STANDARD_IDLE_TIMEOUT}s for " + f"app '{self.name}' to reach the idle state", + parallel=False, + coro=self.model.wait_for_idle(STANDARD_IDLE_TIMEOUT, apps=[self.name]), + ), + ] raise ApplicationError( f"The '{self.name}' application is using channel '{self.channel}'. Channels supported " diff --git a/cou/apps/subordinate.py b/cou/apps/subordinate.py index 25af36ad..116e6490 100644 --- a/cou/apps/subordinate.py +++ b/cou/apps/subordinate.py @@ -69,7 +69,7 @@ def upgrade_steps( :return: List of upgrade steps. :rtype: list[UpgradeStep] """ - return [self._get_upgrade_charm_step(target)] + return self._get_upgrade_charm_steps(target) def post_upgrade_steps( self, target: OpenStackRelease, units: Optional[list[Unit]] diff --git a/tests/functional/tests/smoke.py b/tests/functional/tests/smoke.py index df5b658c..6e45dd29 100644 --- a/tests/functional/tests/smoke.py +++ b/tests/functional/tests/smoke.py @@ -146,6 +146,7 @@ def generate_expected_plan(self, backup: bool = True) -> str: "\t\t\tUpgrade 'designate-bind' from 'ussuri/stable' to the new channel: " "'victoria/stable'\n" "\t\t\tWait for up to 300s for app 'designate-bind' to reach the idle state\n" + "\t\t\tWait for up to 300s for app 'designate-bind' to reach the idle state\n" "\t\t\tVerify that the workload of 'designate-bind' has been upgraded on units:" " designate-bind/0\n" "\t\tUpgrade plan for 'mysql-innodb-cluster' to 'victoria'\n" diff --git a/tests/mocked_plans/sample_plans/018346c5-f95c-46df-a34e-9a78bdec0018.yaml b/tests/mocked_plans/sample_plans/018346c5-f95c-46df-a34e-9a78bdec0018.yaml index ea67aba8..1b398419 100644 --- a/tests/mocked_plans/sample_plans/018346c5-f95c-46df-a34e-9a78bdec0018.yaml +++ b/tests/mocked_plans/sample_plans/018346c5-f95c-46df-a34e-9a78bdec0018.yaml @@ -7,73 +7,108 @@ plan: | Control Plane subordinate(s) upgrade plan Upgrade plan for 'ceph-dashboard' to 'victoria' Refresh 'ceph-dashboard' to the latest revision of 'octopus/stable' + Wait for up to 300s for app 'ceph-dashboard' to reach the idle state Upgrade plan for 'cinder-ceph' to 'victoria' Upgrade 'cinder-ceph' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder-ceph' to reach the idle state Upgrade plan for 'hacluster-aodh' to 'victoria' WARNING: Changing 'hacluster-aodh' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-aodh' to reach the idle state Upgrade plan for 'hacluster-ceilometer' to 'victoria' WARNING: Changing 'hacluster-ceilometer' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-ceilometer' to reach the idle state Upgrade plan for 'hacluster-cinder' to 'victoria' WARNING: Changing 'hacluster-cinder' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-cinder' to reach the idle state Upgrade plan for 'hacluster-designate' to 'victoria' WARNING: Changing 'hacluster-designate' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-designate' to reach the idle state Upgrade plan for 'hacluster-glance' to 'victoria' WARNING: Changing 'hacluster-glance' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-glance' to reach the idle state Upgrade plan for 'hacluster-gnocchi' to 'victoria' WARNING: Changing 'hacluster-gnocchi' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-gnocchi' to reach the idle state Upgrade plan for 'hacluster-heat' to 'victoria' WARNING: Changing 'hacluster-heat' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-heat' to reach the idle state Upgrade plan for 'hacluster-horizon' to 'victoria' WARNING: Changing 'hacluster-horizon' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-horizon' to reach the idle state Upgrade plan for 'hacluster-keystone' to 'victoria' WARNING: Changing 'hacluster-keystone' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-keystone' to reach the idle state Upgrade plan for 'hacluster-neutron' to 'victoria' WARNING: Changing 'hacluster-neutron' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-neutron' to reach the idle state Upgrade plan for 'hacluster-nova' to 'victoria' WARNING: Changing 'hacluster-nova' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-nova' to reach the idle state Upgrade plan for 'hacluster-octavia' to 'victoria' WARNING: Changing 'hacluster-octavia' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-octavia' to reach the idle state Upgrade plan for 'hacluster-placement' to 'victoria' WARNING: Changing 'hacluster-placement' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-placement' to reach the idle state Upgrade plan for 'hacluster-radosgw' to 'victoria' WARNING: Changing 'hacluster-radosgw' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-radosgw' to reach the idle state Upgrade plan for 'hacluster-vault' to 'victoria' WARNING: Changing 'hacluster-vault' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'hacluster-vault' to reach the idle state Upgrade plan for 'keystone-ldap' to 'victoria' WARNING: Changing 'keystone-ldap' channel from latest/stable to ussuri/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'keystone-ldap' to reach the idle state Upgrade 'keystone-ldap' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'keystone-ldap' to reach the idle state Upgrade plan for 'aodh-mysql-router' to 'victoria' Refresh 'aodh-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'aodh-mysql-router' to reach the idle state Upgrade plan for 'cinder-mysql-router' to 'victoria' Refresh 'cinder-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'cinder-mysql-router' to reach the idle state Upgrade plan for 'designate-mysql-router' to 'victoria' Refresh 'designate-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'designate-mysql-router' to reach the idle state Upgrade plan for 'glance-mysql-router' to 'victoria' Refresh 'glance-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'glance-mysql-router' to reach the idle state Upgrade plan for 'gnocchi-mysql-router' to 'victoria' Refresh 'gnocchi-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'gnocchi-mysql-router' to reach the idle state Upgrade plan for 'heat-mysql-router' to 'victoria' Refresh 'heat-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'heat-mysql-router' to reach the idle state Upgrade plan for 'keystone-mysql-router' to 'victoria' Refresh 'keystone-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'keystone-mysql-router' to reach the idle state Upgrade plan for 'neutron-api-mysql-router' to 'victoria' Refresh 'neutron-api-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'neutron-api-mysql-router' to reach the idle state Upgrade plan for 'nova-mysql-router' to 'victoria' Refresh 'nova-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'nova-mysql-router' to reach the idle state Upgrade plan for 'octavia-mysql-router' to 'victoria' Refresh 'octavia-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'octavia-mysql-router' to reach the idle state Upgrade plan for 'openstack-dashboard-mysql-router' to 'victoria' Refresh 'openstack-dashboard-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'openstack-dashboard-mysql-router' to reach the idle state Upgrade plan for 'placement-mysql-router' to 'victoria' Refresh 'placement-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'placement-mysql-router' to reach the idle state Upgrade plan for 'vault-mysql-router' to 'victoria' Refresh 'vault-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'vault-mysql-router' to reach the idle state Upgrade plan for 'neutron-openvswitch-octavia' to 'victoria' Upgrade 'neutron-openvswitch-octavia' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'neutron-openvswitch-octavia' to reach the idle state Upgrade plan for 'octavia-dashboard' to 'victoria' Upgrade 'octavia-dashboard' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'octavia-dashboard' to reach the idle state Upgrade plan for 'octavia-diskimage-retrofit' to 'victoria' Upgrade 'octavia-diskimage-retrofit' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'octavia-diskimage-retrofit' to reach the idle state Control Plane principal(s) upgrade plan Upgrade plan for 'rabbitmq-server' to 'victoria' Upgrade software packages of 'rabbitmq-server' from the current APT repositories @@ -81,6 +116,7 @@ plan: | Ψ Upgrade software packages on unit 'rabbitmq-server/1' Ψ Upgrade software packages on unit 'rabbitmq-server/2' WARNING: Changing 'rabbitmq-server' channel from latest/stable to 3.9/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'rabbitmq-server' to reach the idle state Change charm config of 'rabbitmq-server' 'source' to 'cloud:focal-victoria' Wait for up to 2400s for model '018346c5-f95c-46df-a34e-9a78bdec0018' to reach the idle state Verify that the workload of 'rabbitmq-server' has been upgraded on units: rabbitmq-server/0, rabbitmq-server/1, rabbitmq-server/2 @@ -90,6 +126,7 @@ plan: | Ψ Upgrade software packages on unit 'ceph-mon/1' Ψ Upgrade software packages on unit 'ceph-mon/2' WARNING: Changing 'ceph-mon' channel from latest/stable to octopus/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'ceph-mon' to reach the idle state Ensure that the 'require-osd-release' option matches the 'ceph-osd' version Change charm config of 'ceph-mon' 'source' to 'cloud:focal-victoria' Wait for up to 2400s for model '018346c5-f95c-46df-a34e-9a78bdec0018' to reach the idle state @@ -100,7 +137,9 @@ plan: | Ψ Upgrade software packages on unit 'keystone/1' Ψ Upgrade software packages on unit 'keystone/2' Refresh 'keystone' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'keystone' to reach the idle state Upgrade 'keystone' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'keystone' to reach the idle state Change charm config of 'keystone' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 2400s for model '018346c5-f95c-46df-a34e-9a78bdec0018' to reach the idle state Verify that the workload of 'keystone' has been upgraded on units: keystone/0, keystone/1, keystone/2 @@ -110,7 +149,9 @@ plan: | Ψ Upgrade software packages on unit 'aodh/1' Ψ Upgrade software packages on unit 'aodh/2' Refresh 'aodh' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'aodh' to reach the idle state Upgrade 'aodh' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'aodh' to reach the idle state Change charm config of 'aodh' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'aodh' to reach the idle state Verify that the workload of 'aodh' has been upgraded on units: aodh/0, aodh/1, aodh/2 @@ -120,7 +161,9 @@ plan: | Ψ Upgrade software packages on unit 'ceilometer/1' Ψ Upgrade software packages on unit 'ceilometer/2' Refresh 'ceilometer' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'ceilometer' to reach the idle state Upgrade 'ceilometer' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'ceilometer' to reach the idle state Change charm config of 'ceilometer' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'ceilometer' to reach the idle state Verify that the workload of 'ceilometer' has been upgraded on units: ceilometer/0, ceilometer/1, ceilometer/2 @@ -130,6 +173,7 @@ plan: | Ψ Upgrade software packages on unit 'ceph-radosgw/1' Ψ Upgrade software packages on unit 'ceph-radosgw/2' WARNING: Changing 'ceph-radosgw' channel from latest/stable to octopus/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'ceph-radosgw' to reach the idle state Change charm config of 'ceph-radosgw' 'source' to 'cloud:focal-victoria' Wait for up to 300s for app 'ceph-radosgw' to reach the idle state Verify that the workload of 'ceph-radosgw' has been upgraded on units: ceph-radosgw/0, ceph-radosgw/1, ceph-radosgw/2 @@ -139,7 +183,9 @@ plan: | Ψ Upgrade software packages on unit 'cinder/1' Ψ Upgrade software packages on unit 'cinder/2' Refresh 'cinder' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'cinder' to reach the idle state Upgrade 'cinder' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder' to reach the idle state Change charm config of 'cinder' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'cinder' to reach the idle state Verify that the workload of 'cinder' has been upgraded on units: cinder/0, cinder/1, cinder/2 @@ -149,7 +195,9 @@ plan: | Ψ Upgrade software packages on unit 'designate/2' Ψ Upgrade software packages on unit 'designate/3' Refresh 'designate' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'designate' to reach the idle state Upgrade 'designate' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'designate' to reach the idle state Change charm config of 'designate' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'designate' to reach the idle state Verify that the workload of 'designate' has been upgraded on units: designate/1, designate/2, designate/3 @@ -160,6 +208,7 @@ plan: | Ψ Upgrade software packages on unit 'designate-bind/2' Upgrade 'designate-bind' from 'ussuri/stable' to the new channel: 'victoria/stable' Wait for up to 300s for app 'designate-bind' to reach the idle state + Wait for up to 300s for app 'designate-bind' to reach the idle state Verify that the workload of 'designate-bind' has been upgraded on units: designate-bind/0, designate-bind/1, designate-bind/2 Upgrade plan for 'glance' to 'victoria' Upgrade software packages of 'glance' from the current APT repositories @@ -167,7 +216,9 @@ plan: | Ψ Upgrade software packages on unit 'glance/1' Ψ Upgrade software packages on unit 'glance/2' Refresh 'glance' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'glance' to reach the idle state Upgrade 'glance' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'glance' to reach the idle state Change charm config of 'glance' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'glance' to reach the idle state Verify that the workload of 'glance' has been upgraded on units: glance/0, glance/1, glance/2 @@ -177,7 +228,9 @@ plan: | Ψ Upgrade software packages on unit 'gnocchi/1' Ψ Upgrade software packages on unit 'gnocchi/2' Refresh 'gnocchi' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'gnocchi' to reach the idle state Upgrade 'gnocchi' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'gnocchi' to reach the idle state Change charm config of 'gnocchi' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'gnocchi' to reach the idle state Verify that the workload of 'gnocchi' has been upgraded on units: gnocchi/0, gnocchi/1, gnocchi/2 @@ -187,7 +240,9 @@ plan: | Ψ Upgrade software packages on unit 'heat/1' Ψ Upgrade software packages on unit 'heat/2' Refresh 'heat' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'heat' to reach the idle state Upgrade 'heat' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'heat' to reach the idle state Change charm config of 'heat' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'heat' to reach the idle state Verify that the workload of 'heat' has been upgraded on units: heat/0, heat/1, heat/2 @@ -197,7 +252,9 @@ plan: | Ψ Upgrade software packages on unit 'neutron-api/1' Ψ Upgrade software packages on unit 'neutron-api/2' Refresh 'neutron-api' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'neutron-api' to reach the idle state Upgrade 'neutron-api' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'neutron-api' to reach the idle state Change charm config of 'neutron-api' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'neutron-api' to reach the idle state Verify that the workload of 'neutron-api' has been upgraded on units: neutron-api/0, neutron-api/1, neutron-api/2 @@ -207,7 +264,9 @@ plan: | Ψ Upgrade software packages on unit 'placement/4' Ψ Upgrade software packages on unit 'placement/5' Refresh 'placement' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'placement' to reach the idle state Upgrade 'placement' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'placement' to reach the idle state Change charm config of 'placement' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'placement' to reach the idle state Verify that the workload of 'placement' has been upgraded on units: placement/3, placement/4, placement/5 @@ -217,7 +276,9 @@ plan: | Ψ Upgrade software packages on unit 'nova-cloud-controller/1' Ψ Upgrade software packages on unit 'nova-cloud-controller/2' Refresh 'nova-cloud-controller' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-cloud-controller' to reach the idle state Upgrade 'nova-cloud-controller' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-cloud-controller' to reach the idle state Change charm config of 'nova-cloud-controller' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'nova-cloud-controller' to reach the idle state Verify that the workload of 'nova-cloud-controller' has been upgraded on units: nova-cloud-controller/0, nova-cloud-controller/1, nova-cloud-controller/2 @@ -227,7 +288,9 @@ plan: | Ψ Upgrade software packages on unit 'openstack-dashboard/1' Ψ Upgrade software packages on unit 'openstack-dashboard/2' Refresh 'openstack-dashboard' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'openstack-dashboard' to reach the idle state Upgrade 'openstack-dashboard' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'openstack-dashboard' to reach the idle state Change charm config of 'openstack-dashboard' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'openstack-dashboard' to reach the idle state Verify that the workload of 'openstack-dashboard' has been upgraded on units: openstack-dashboard/0, openstack-dashboard/1, openstack-dashboard/2 @@ -237,7 +300,9 @@ plan: | Ψ Upgrade software packages on unit 'octavia/8' Ψ Upgrade software packages on unit 'octavia/9' Refresh 'octavia' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'octavia' to reach the idle state Upgrade 'octavia' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'octavia' to reach the idle state Change charm config of 'octavia' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 2400s for app 'octavia' to reach the idle state Verify that the workload of 'octavia' has been upgraded on units: octavia/10, octavia/8, octavia/9 @@ -245,6 +310,7 @@ plan: | Upgrade software packages of 'glance-simplestreams-sync' from the current APT repositories Ψ Upgrade software packages on unit 'glance-simplestreams-sync/0' Upgrade 'glance-simplestreams-sync' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'glance-simplestreams-sync' to reach the idle state Change charm config of 'glance-simplestreams-sync' 'source' to 'cloud:focal-victoria' Upgrade plan for 'mysql-innodb-cluster' to 'victoria' Upgrade software packages of 'mysql-innodb-cluster' from the current APT repositories @@ -252,6 +318,7 @@ plan: | Ψ Upgrade software packages on unit 'mysql-innodb-cluster/1' Ψ Upgrade software packages on unit 'mysql-innodb-cluster/2' Refresh 'mysql-innodb-cluster' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'mysql-innodb-cluster' to reach the idle state Change charm config of 'mysql-innodb-cluster' 'source' to 'cloud:focal-victoria' Wait for up to 2400s for app 'mysql-innodb-cluster' to reach the idle state Verify that the workload of 'mysql-innodb-cluster' has been upgraded on units: mysql-innodb-cluster/0, mysql-innodb-cluster/1, mysql-innodb-cluster/2 @@ -263,6 +330,7 @@ plan: | Ψ Upgrade software packages on unit 'cinder-volume/3' Ψ Upgrade software packages on unit 'cinder-volume/9' Refresh 'cinder-volume' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'cinder-volume' to reach the idle state Disable nova-compute scheduler from unit: 'nova-compute-kvm/0' Disable nova-compute scheduler from unit: 'nova-compute-kvm/2' Disable nova-compute scheduler from unit: 'nova-compute-kvm/3' @@ -273,7 +341,9 @@ plan: | Ψ Upgrade software packages on unit 'nova-compute-kvm/3' Ψ Upgrade software packages on unit 'nova-compute-kvm/9' Refresh 'nova-compute-kvm' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute-kvm' to reach the idle state Upgrade 'cinder-volume' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder-volume' to reach the idle state Change charm config of 'cinder-volume' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: cinder-volume/0, cinder-volume/2, cinder-volume/3, cinder-volume/9 Ψ Upgrade plan for unit 'cinder-volume/0' @@ -293,6 +363,7 @@ plan: | Upgrade the unit: 'cinder-volume/9' Resume the unit: 'cinder-volume/9' Upgrade 'nova-compute-kvm' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute-kvm' to reach the idle state Change charm config of 'nova-compute-kvm' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute-kvm/0, nova-compute-kvm/2, nova-compute-kvm/3, nova-compute-kvm/9 Ψ Upgrade plan for unit 'nova-compute-kvm/0' @@ -334,6 +405,7 @@ plan: | Ψ Upgrade software packages on unit 'cinder-volume/11' Ψ Upgrade software packages on unit 'cinder-volume/5' Refresh 'cinder-volume' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'cinder-volume' to reach the idle state Disable nova-compute scheduler from unit: 'nova-compute-kvm/1' Disable nova-compute scheduler from unit: 'nova-compute-kvm/10' Disable nova-compute scheduler from unit: 'nova-compute-kvm/11' @@ -344,7 +416,9 @@ plan: | Ψ Upgrade software packages on unit 'nova-compute-kvm/11' Ψ Upgrade software packages on unit 'nova-compute-kvm/5' Refresh 'nova-compute-kvm' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute-kvm' to reach the idle state Upgrade 'cinder-volume' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder-volume' to reach the idle state Change charm config of 'cinder-volume' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: cinder-volume/1, cinder-volume/10, cinder-volume/11, cinder-volume/5 Ψ Upgrade plan for unit 'cinder-volume/1' @@ -364,6 +438,7 @@ plan: | Upgrade the unit: 'cinder-volume/5' Resume the unit: 'cinder-volume/5' Upgrade 'nova-compute-kvm' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute-kvm' to reach the idle state Change charm config of 'nova-compute-kvm' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute-kvm/1, nova-compute-kvm/10, nova-compute-kvm/11, nova-compute-kvm/5 Ψ Upgrade plan for unit 'nova-compute-kvm/1' @@ -405,6 +480,7 @@ plan: | Ψ Upgrade software packages on unit 'cinder-volume/7' Ψ Upgrade software packages on unit 'cinder-volume/8' Refresh 'cinder-volume' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'cinder-volume' to reach the idle state Disable nova-compute scheduler from unit: 'nova-compute-kvm/4' Disable nova-compute scheduler from unit: 'nova-compute-kvm/6' Disable nova-compute scheduler from unit: 'nova-compute-kvm/7' @@ -415,7 +491,9 @@ plan: | Ψ Upgrade software packages on unit 'nova-compute-kvm/7' Ψ Upgrade software packages on unit 'nova-compute-kvm/8' Refresh 'nova-compute-kvm' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute-kvm' to reach the idle state Upgrade 'cinder-volume' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder-volume' to reach the idle state Change charm config of 'cinder-volume' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: cinder-volume/4, cinder-volume/6, cinder-volume/7, cinder-volume/8 Ψ Upgrade plan for unit 'cinder-volume/4' @@ -435,6 +513,7 @@ plan: | Upgrade the unit: 'cinder-volume/8' Resume the unit: 'cinder-volume/8' Upgrade 'nova-compute-kvm' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute-kvm' to reach the idle state Change charm config of 'nova-compute-kvm' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute-kvm/4, nova-compute-kvm/6, nova-compute-kvm/7, nova-compute-kvm/8 Ψ Upgrade plan for unit 'nova-compute-kvm/4' @@ -477,21 +556,28 @@ plan: | Ψ Upgrade software packages on unit 'ceph-osd/1' Ψ Upgrade software packages on unit 'ceph-osd/2' WARNING: Changing 'ceph-osd' channel from latest/stable to octopus/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'ceph-osd' to reach the idle state Change charm config of 'ceph-osd' 'source' to 'cloud:focal-victoria' Wait for up to 300s for app 'ceph-osd' to reach the idle state Verify that the workload of 'ceph-osd' has been upgraded on units: ceph-osd/0, ceph-osd/1, ceph-osd/2 Data Plane subordinate(s) upgrade plan Upgrade plan for 'ceilometer-agent' to 'victoria' Refresh 'ceilometer-agent' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'ceilometer-agent' to reach the idle state Upgrade 'ceilometer-agent' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'ceilometer-agent' to reach the idle state Upgrade plan for 'cinder-lvm-fast' to 'victoria' Upgrade 'cinder-lvm-fast' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder-lvm-fast' to reach the idle state Upgrade plan for 'cinder-lvm-fast2' to 'victoria' Upgrade 'cinder-lvm-fast2' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder-lvm-fast2' to reach the idle state Upgrade plan for 'cinder-lvm-slow' to 'victoria' Upgrade 'cinder-lvm-slow' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder-lvm-slow' to reach the idle state Upgrade plan for 'cinder-volume-mysql-router' to 'victoria' Refresh 'cinder-volume-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'cinder-volume-mysql-router' to reach the idle state Ensure that the 'require-osd-release' option in 'ceph-mon' matches the 'ceph-osd' version diff --git a/tests/mocked_plans/sample_plans/9eb9af6a-b919-4cf9-8f2f-9df16a1556be.yaml b/tests/mocked_plans/sample_plans/9eb9af6a-b919-4cf9-8f2f-9df16a1556be.yaml index a3ad14c0..4e0d4abf 100644 --- a/tests/mocked_plans/sample_plans/9eb9af6a-b919-4cf9-8f2f-9df16a1556be.yaml +++ b/tests/mocked_plans/sample_plans/9eb9af6a-b919-4cf9-8f2f-9df16a1556be.yaml @@ -7,105 +7,164 @@ plan: | OVN subordinate upgrade plan Upgrade plan for 'octavia-ovn-chassis' to 'victoria' WARNING: Changing 'octavia-ovn-chassis' channel from latest/stable to 22.03/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'octavia-ovn-chassis' to reach the idle state Upgrade plan for 'ovn-chassis' to 'victoria' WARNING: Changing 'ovn-chassis' channel from latest/stable to 22.03/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'ovn-chassis' to reach the idle state Control Plane subordinate(s) upgrade plan Upgrade plan for 'barbican-vault' to 'victoria' Upgrade 'barbican-vault' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'barbican-vault' to reach the idle state Upgrade plan for 'ceph-dashboard' to 'victoria' Refresh 'ceph-dashboard' to the latest revision of 'octopus/stable' + Wait for up to 300s for app 'ceph-dashboard' to reach the idle state Upgrade plan for 'cinder-ceph' to 'victoria' Refresh 'cinder-ceph' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'cinder-ceph' to reach the idle state Upgrade 'cinder-ceph' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder-ceph' to reach the idle state Upgrade plan for 'hacluster-aodh' to 'victoria' Refresh 'hacluster-aodh' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-aodh' to reach the idle state Upgrade 'hacluster-aodh' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-aodh' to reach the idle state Upgrade plan for 'hacluster-barbican' to 'victoria' Refresh 'hacluster-barbican' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-barbican' to reach the idle state Upgrade 'hacluster-barbican' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-barbican' to reach the idle state Upgrade plan for 'hacluster-ceilometer' to 'victoria' Refresh 'hacluster-ceilometer' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-ceilometer' to reach the idle state Upgrade 'hacluster-ceilometer' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-ceilometer' to reach the idle state Upgrade plan for 'hacluster-ceph-radosgw' to 'victoria' Refresh 'hacluster-ceph-radosgw' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-ceph-radosgw' to reach the idle state Upgrade 'hacluster-ceph-radosgw' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-ceph-radosgw' to reach the idle state Upgrade plan for 'hacluster-cinder' to 'victoria' Refresh 'hacluster-cinder' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-cinder' to reach the idle state Upgrade 'hacluster-cinder' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-cinder' to reach the idle state Upgrade plan for 'hacluster-designate' to 'victoria' Refresh 'hacluster-designate' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-designate' to reach the idle state Upgrade 'hacluster-designate' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-designate' to reach the idle state Upgrade plan for 'hacluster-glance' to 'victoria' Refresh 'hacluster-glance' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-glance' to reach the idle state Upgrade 'hacluster-glance' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-glance' to reach the idle state Upgrade plan for 'hacluster-gnocchi' to 'victoria' Refresh 'hacluster-gnocchi' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-gnocchi' to reach the idle state Upgrade 'hacluster-gnocchi' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-gnocchi' to reach the idle state Upgrade plan for 'hacluster-heat' to 'victoria' Refresh 'hacluster-heat' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-heat' to reach the idle state Upgrade 'hacluster-heat' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-heat' to reach the idle state Upgrade plan for 'hacluster-keystone' to 'victoria' Refresh 'hacluster-keystone' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-keystone' to reach the idle state Upgrade 'hacluster-keystone' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-keystone' to reach the idle state Upgrade plan for 'hacluster-neutron-api' to 'victoria' Refresh 'hacluster-neutron-api' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-neutron-api' to reach the idle state Upgrade 'hacluster-neutron-api' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-neutron-api' to reach the idle state Upgrade plan for 'hacluster-nova-cloud-controller' to 'victoria' Refresh 'hacluster-nova-cloud-controller' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-nova-cloud-controller' to reach the idle state Upgrade 'hacluster-nova-cloud-controller' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-nova-cloud-controller' to reach the idle state Upgrade plan for 'hacluster-octavia' to 'victoria' Refresh 'hacluster-octavia' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-octavia' to reach the idle state Upgrade 'hacluster-octavia' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-octavia' to reach the idle state Upgrade plan for 'hacluster-openstack-dashboard' to 'victoria' Refresh 'hacluster-openstack-dashboard' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-openstack-dashboard' to reach the idle state Upgrade 'hacluster-openstack-dashboard' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-openstack-dashboard' to reach the idle state Upgrade plan for 'hacluster-placement' to 'victoria' Refresh 'hacluster-placement' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-placement' to reach the idle state Upgrade 'hacluster-placement' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-placement' to reach the idle state Upgrade plan for 'hacluster-vault' to 'victoria' Refresh 'hacluster-vault' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'hacluster-vault' to reach the idle state Upgrade 'hacluster-vault' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'hacluster-vault' to reach the idle state Upgrade plan for 'openstack-loadbalancer-hacluster' to 'victoria' WARNING: Changing 'openstack-loadbalancer-hacluster' channel from latest/stable to 2.4/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'openstack-loadbalancer-hacluster' to reach the idle state Upgrade plan for 'keystone-saml-mellon' to 'victoria' Upgrade 'keystone-saml-mellon' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'keystone-saml-mellon' to reach the idle state Upgrade plan for 'aodh-mysql-router' to 'victoria' Refresh 'aodh-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'aodh-mysql-router' to reach the idle state Upgrade plan for 'barbican-mysql-router' to 'victoria' Refresh 'barbican-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'barbican-mysql-router' to reach the idle state Upgrade plan for 'cinder-mysql-router' to 'victoria' Refresh 'cinder-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'cinder-mysql-router' to reach the idle state Upgrade plan for 'designate-mysql-router' to 'victoria' Refresh 'designate-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'designate-mysql-router' to reach the idle state Upgrade plan for 'glance-mysql-router' to 'victoria' Refresh 'glance-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'glance-mysql-router' to reach the idle state Upgrade plan for 'gnocchi-mysql-router' to 'victoria' Refresh 'gnocchi-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'gnocchi-mysql-router' to reach the idle state Upgrade plan for 'heat-mysql-router' to 'victoria' Refresh 'heat-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'heat-mysql-router' to reach the idle state Upgrade plan for 'keystone-mysql-router' to 'victoria' Refresh 'keystone-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'keystone-mysql-router' to reach the idle state Upgrade plan for 'neutron-api-mysql-router' to 'victoria' Refresh 'neutron-api-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'neutron-api-mysql-router' to reach the idle state Upgrade plan for 'nova-cloud-controller-mysql-router' to 'victoria' Refresh 'nova-cloud-controller-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'nova-cloud-controller-mysql-router' to reach the idle state Upgrade plan for 'octavia-mysql-router' to 'victoria' Refresh 'octavia-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'octavia-mysql-router' to reach the idle state Upgrade plan for 'openstack-dashboard-mysql-router' to 'victoria' Refresh 'openstack-dashboard-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'openstack-dashboard-mysql-router' to reach the idle state Upgrade plan for 'placement-mysql-router' to 'victoria' Refresh 'placement-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'placement-mysql-router' to reach the idle state Upgrade plan for 'vault-mysql-router' to 'victoria' Refresh 'vault-mysql-router' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'vault-mysql-router' to reach the idle state Upgrade plan for 'neutron-api-plugin-ovn' to 'victoria' Upgrade 'neutron-api-plugin-ovn' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'neutron-api-plugin-ovn' to reach the idle state Upgrade plan for 'octavia-dashboard' to 'victoria' Upgrade 'octavia-dashboard' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'octavia-dashboard' to reach the idle state Upgrade plan for 'octavia-diskimage-retrofit' to 'victoria' Refresh 'octavia-diskimage-retrofit' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'octavia-diskimage-retrofit' to reach the idle state Upgrade 'octavia-diskimage-retrofit' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'octavia-diskimage-retrofit' to reach the idle state Upgrade plan for 'octavia-ovn-chassis' to 'victoria' WARNING: Changing 'octavia-ovn-chassis' channel from latest/stable to 22.03/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'octavia-ovn-chassis' to reach the idle state Control Plane principal(s) upgrade plan Upgrade plan for 'vault' to 'victoria' Upgrade software packages of 'vault' from the current APT repositories @@ -113,6 +172,7 @@ plan: | Ψ Upgrade software packages on unit 'vault/1' Ψ Upgrade software packages on unit 'vault/2' Refresh 'vault' to the latest revision of '1.7/stable' + Wait for up to 300s for app 'vault' to reach the idle state Wait for up to 2400s for model '9eb9af6a-b919-4cf9-8f2f-9df16a1556be' to reach the idle state Verify that the workload of 'vault' has been upgraded on units: vault/0, vault/1, vault/2 Upgrade plan for 'rabbitmq-server' to 'victoria' @@ -121,7 +181,9 @@ plan: | Ψ Upgrade software packages on unit 'rabbitmq-server/1' Ψ Upgrade software packages on unit 'rabbitmq-server/2' Refresh 'rabbitmq-server' to the latest revision of '3.8/stable' + Wait for up to 300s for app 'rabbitmq-server' to reach the idle state Upgrade 'rabbitmq-server' from '3.8/stable' to the new channel: '3.9/stable' + Wait for up to 300s for app 'rabbitmq-server' to reach the idle state Change charm config of 'rabbitmq-server' 'source' to 'cloud:focal-victoria' Wait for up to 2400s for model '9eb9af6a-b919-4cf9-8f2f-9df16a1556be' to reach the idle state Verify that the workload of 'rabbitmq-server' has been upgraded on units: rabbitmq-server/0, rabbitmq-server/1, rabbitmq-server/2 @@ -131,6 +193,7 @@ plan: | Ψ Upgrade software packages on unit 'ceph-mon/1' Ψ Upgrade software packages on unit 'ceph-mon/2' Refresh 'ceph-mon' to the latest revision of 'octopus/stable' + Wait for up to 300s for app 'ceph-mon' to reach the idle state Ensure that the 'require-osd-release' option matches the 'ceph-osd' version Change charm config of 'ceph-mon' 'source' to 'cloud:focal-victoria' Wait for up to 2400s for model '9eb9af6a-b919-4cf9-8f2f-9df16a1556be' to reach the idle state @@ -142,6 +205,7 @@ plan: | Ψ Upgrade software packages on unit 'keystone/2' Change charm config of 'keystone' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'keystone' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'keystone' to reach the idle state Change charm config of 'keystone' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 2400s for model '9eb9af6a-b919-4cf9-8f2f-9df16a1556be' to reach the idle state Verify that the workload of 'keystone' has been upgraded on units: keystone/0, keystone/1, keystone/2 @@ -152,6 +216,7 @@ plan: | Ψ Upgrade software packages on unit 'aodh/2' Change charm config of 'aodh' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'aodh' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'aodh' to reach the idle state Change charm config of 'aodh' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'aodh' to reach the idle state Verify that the workload of 'aodh' has been upgraded on units: aodh/0, aodh/1, aodh/2 @@ -162,6 +227,7 @@ plan: | Ψ Upgrade software packages on unit 'barbican/2' Change charm config of 'barbican' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'barbican' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'barbican' to reach the idle state Change charm config of 'barbican' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'barbican' to reach the idle state Verify that the workload of 'barbican' has been upgraded on units: barbican/0, barbican/1, barbican/2 @@ -172,6 +238,7 @@ plan: | Ψ Upgrade software packages on unit 'ceilometer/2' Change charm config of 'ceilometer' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'ceilometer' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'ceilometer' to reach the idle state Change charm config of 'ceilometer' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'ceilometer' to reach the idle state Verify that the workload of 'ceilometer' has been upgraded on units: ceilometer/0, ceilometer/1, ceilometer/2 @@ -181,6 +248,7 @@ plan: | Ψ Upgrade software packages on unit 'ceph-radosgw/1' Ψ Upgrade software packages on unit 'ceph-radosgw/2' Refresh 'ceph-radosgw' to the latest revision of 'octopus/stable' + Wait for up to 300s for app 'ceph-radosgw' to reach the idle state Change charm config of 'ceph-radosgw' 'source' to 'cloud:focal-victoria' Wait for up to 300s for app 'ceph-radosgw' to reach the idle state Verify that the workload of 'ceph-radosgw' has been upgraded on units: ceph-radosgw/0, ceph-radosgw/1, ceph-radosgw/2 @@ -191,6 +259,7 @@ plan: | Ψ Upgrade software packages on unit 'cinder/2' Change charm config of 'cinder' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'cinder' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder' to reach the idle state Change charm config of 'cinder' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'cinder' to reach the idle state Verify that the workload of 'cinder' has been upgraded on units: cinder/0, cinder/1, cinder/2 @@ -201,6 +270,7 @@ plan: | Ψ Upgrade software packages on unit 'designate/2' Change charm config of 'designate' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'designate' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'designate' to reach the idle state Change charm config of 'designate' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'designate' to reach the idle state Verify that the workload of 'designate' has been upgraded on units: designate/0, designate/1, designate/2 @@ -209,8 +279,10 @@ plan: | Ψ Upgrade software packages on unit 'designate-bind/0' Ψ Upgrade software packages on unit 'designate-bind/1' Refresh 'designate-bind' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'designate-bind' to reach the idle state Upgrade 'designate-bind' from 'ussuri/stable' to the new channel: 'victoria/stable' Wait for up to 300s for app 'designate-bind' to reach the idle state + Wait for up to 300s for app 'designate-bind' to reach the idle state Verify that the workload of 'designate-bind' has been upgraded on units: designate-bind/0, designate-bind/1 Upgrade plan for 'glance' to 'victoria' Upgrade software packages of 'glance' from the current APT repositories @@ -218,8 +290,10 @@ plan: | Ψ Upgrade software packages on unit 'glance/1' Ψ Upgrade software packages on unit 'glance/2' Refresh 'glance' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'glance' to reach the idle state Change charm config of 'glance' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'glance' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'glance' to reach the idle state Change charm config of 'glance' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'glance' to reach the idle state Verify that the workload of 'glance' has been upgraded on units: glance/0, glance/1, glance/2 @@ -230,6 +304,7 @@ plan: | Ψ Upgrade software packages on unit 'gnocchi/2' Change charm config of 'gnocchi' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'gnocchi' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'gnocchi' to reach the idle state Change charm config of 'gnocchi' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'gnocchi' to reach the idle state Verify that the workload of 'gnocchi' has been upgraded on units: gnocchi/0, gnocchi/1, gnocchi/2 @@ -240,6 +315,7 @@ plan: | Ψ Upgrade software packages on unit 'heat/2' Change charm config of 'heat' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'heat' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'heat' to reach the idle state Change charm config of 'heat' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'heat' to reach the idle state Verify that the workload of 'heat' has been upgraded on units: heat/0, heat/1, heat/2 @@ -250,6 +326,7 @@ plan: | Ψ Upgrade software packages on unit 'neutron-api/2' Change charm config of 'neutron-api' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'neutron-api' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'neutron-api' to reach the idle state Change charm config of 'neutron-api' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'neutron-api' to reach the idle state Verify that the workload of 'neutron-api' has been upgraded on units: neutron-api/0, neutron-api/1, neutron-api/2 @@ -259,6 +336,7 @@ plan: | Ψ Upgrade software packages on unit 'ovn-central/1' Ψ Upgrade software packages on unit 'ovn-central/2' WARNING: Changing 'ovn-central' channel from latest/stable to 22.03/stable. This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'ovn-central' to reach the idle state Change charm config of 'ovn-central' 'source' to 'cloud:focal-victoria' Wait for up to 300s for app 'ovn-central' to reach the idle state Verify that the workload of 'ovn-central' has been upgraded on units: ovn-central/0, ovn-central/1, ovn-central/2 @@ -269,6 +347,7 @@ plan: | Ψ Upgrade software packages on unit 'placement/2' Change charm config of 'placement' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'placement' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'placement' to reach the idle state Change charm config of 'placement' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'placement' to reach the idle state Verify that the workload of 'placement' has been upgraded on units: placement/0, placement/1, placement/2 @@ -279,6 +358,7 @@ plan: | Ψ Upgrade software packages on unit 'nova-cloud-controller/2' Change charm config of 'nova-cloud-controller' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'nova-cloud-controller' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-cloud-controller' to reach the idle state Change charm config of 'nova-cloud-controller' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'nova-cloud-controller' to reach the idle state Verify that the workload of 'nova-cloud-controller' has been upgraded on units: nova-cloud-controller/0, nova-cloud-controller/1, nova-cloud-controller/2 @@ -288,8 +368,10 @@ plan: | Ψ Upgrade software packages on unit 'openstack-dashboard/1' Ψ Upgrade software packages on unit 'openstack-dashboard/2' Refresh 'openstack-dashboard' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'openstack-dashboard' to reach the idle state Change charm config of 'openstack-dashboard' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'openstack-dashboard' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'openstack-dashboard' to reach the idle state Change charm config of 'openstack-dashboard' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'openstack-dashboard' to reach the idle state Verify that the workload of 'openstack-dashboard' has been upgraded on units: openstack-dashboard/0, openstack-dashboard/1, openstack-dashboard/2 @@ -300,6 +382,7 @@ plan: | Ψ Upgrade software packages on unit 'octavia/2' Change charm config of 'octavia' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'octavia' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'octavia' to reach the idle state Change charm config of 'octavia' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 2400s for app 'octavia' to reach the idle state Verify that the workload of 'octavia' has been upgraded on units: octavia/0, octavia/1, octavia/2 @@ -307,6 +390,7 @@ plan: | Upgrade software packages of 'glance-simplestreams-sync' from the current APT repositories Ψ Upgrade software packages on unit 'glance-simplestreams-sync/0' Upgrade 'glance-simplestreams-sync' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'glance-simplestreams-sync' to reach the idle state Change charm config of 'glance-simplestreams-sync' 'source' to 'cloud:focal-victoria' Upgrade plan for 'mysql-innodb-cluster' to 'victoria' Upgrade software packages of 'mysql-innodb-cluster' from the current APT repositories @@ -314,6 +398,7 @@ plan: | Ψ Upgrade software packages on unit 'mysql-innodb-cluster/1' Ψ Upgrade software packages on unit 'mysql-innodb-cluster/2' Refresh 'mysql-innodb-cluster' to the latest revision of '8.0/stable' + Wait for up to 300s for app 'mysql-innodb-cluster' to reach the idle state Change charm config of 'mysql-innodb-cluster' 'source' to 'cloud:focal-victoria' Wait for up to 2400s for app 'mysql-innodb-cluster' to reach the idle state Verify that the workload of 'mysql-innodb-cluster' has been upgraded on units: mysql-innodb-cluster/0, mysql-innodb-cluster/1, mysql-innodb-cluster/2 @@ -327,7 +412,9 @@ plan: | Ψ Upgrade software packages on unit 'nova-compute/2' Ψ Upgrade software packages on unit 'nova-compute/3' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/0, nova-compute/2, nova-compute/3 Ψ Upgrade plan for unit 'nova-compute/0' @@ -362,7 +449,9 @@ plan: | Ψ Upgrade software packages on unit 'nova-compute/6' Ψ Upgrade software packages on unit 'nova-compute/8' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/1, nova-compute/6, nova-compute/8 Ψ Upgrade plan for unit 'nova-compute/1' @@ -397,7 +486,9 @@ plan: | Ψ Upgrade software packages on unit 'nova-compute/5' Ψ Upgrade software packages on unit 'nova-compute/7' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/4, nova-compute/5, nova-compute/7 Ψ Upgrade plan for unit 'nova-compute/4' @@ -437,12 +528,14 @@ plan: | Ψ Upgrade software packages on unit 'ceph-osd/7' Ψ Upgrade software packages on unit 'ceph-osd/8' Refresh 'ceph-osd' to the latest revision of 'octopus/stable' + Wait for up to 300s for app 'ceph-osd' to reach the idle state Change charm config of 'ceph-osd' 'source' to 'cloud:focal-victoria' Wait for up to 300s for app 'ceph-osd' to reach the idle state Verify that the workload of 'ceph-osd' has been upgraded on units: ceph-osd/0, ceph-osd/1, ceph-osd/2, ceph-osd/3, ceph-osd/4, ceph-osd/5, ceph-osd/6, ceph-osd/7, ceph-osd/8 Data Plane subordinate(s) upgrade plan Upgrade plan for 'ceilometer-agent' to 'victoria' Upgrade 'ceilometer-agent' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'ceilometer-agent' to reach the idle state Ensure that the 'require-osd-release' option in 'ceph-mon' matches the 'ceph-osd' version applications: diff --git a/tests/mocked_plans/sample_plans/base.yaml b/tests/mocked_plans/sample_plans/base.yaml index fca74675..331b8f49 100644 --- a/tests/mocked_plans/sample_plans/base.yaml +++ b/tests/mocked_plans/sample_plans/base.yaml @@ -7,17 +7,22 @@ plan: | OVN subordinate upgrade plan Upgrade plan for 'ovn-chassis' to 'victoria' Refresh 'ovn-chassis' to the latest revision of '22.03/stable' + Wait for up to 300s for app 'ovn-chassis' to reach the idle state Control Plane subordinate(s) upgrade plan Upgrade plan for 'keystone-ldap' to 'victoria' Refresh 'keystone-ldap' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'keystone-ldap' to reach the idle state Upgrade 'keystone-ldap' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'keystone-ldap' to reach the idle state Control Plane principal(s) upgrade plan Upgrade plan for 'keystone' to 'victoria' Upgrade software packages of 'keystone' from the current APT repositories Ψ Upgrade software packages on unit 'keystone/0' Refresh 'keystone' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'keystone' to reach the idle state Change charm config of 'keystone' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'keystone' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'keystone' to reach the idle state Change charm config of 'keystone' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 2400s for model 'base' to reach the idle state Verify that the workload of 'keystone' has been upgraded on units: keystone/0 @@ -27,8 +32,10 @@ plan: | Upgrade software packages of 'nova-compute' from the current APT repositories Ψ Upgrade software packages on unit 'nova-compute/0' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'source' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/0 Ψ Upgrade plan for unit 'nova-compute/0' @@ -46,6 +53,7 @@ plan: | Upgrade software packages of 'ceph-osd' from the current APT repositories Ψ Upgrade software packages on unit 'ceph-osd/0' Refresh 'ceph-osd' to the latest revision of 'octopus/stable' + Wait for up to 300s for app 'ceph-osd' to reach the idle state Change charm config of 'ceph-osd' 'source' to 'cloud:focal-victoria' Wait for up to 300s for app 'ceph-osd' to reach the idle state Verify that the workload of 'ceph-osd' has been upgraded on units: ceph-osd/0 diff --git a/tests/unit/apps/test_auxiliary.py b/tests/unit/apps/test_auxiliary.py index b48ec7b0..ecb73157 100644 --- a/tests/unit/apps/test_auxiliary.py +++ b/tests/unit/apps/test_auxiliary.py @@ -167,11 +167,21 @@ def test_auxiliary_upgrade_plan_ussuri_to_victoria_change_channel(model): parallel=False, coro=model.upgrade_charm(app.name, "3.8/stable"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Upgrade '{app.name}' from '3.8/stable' to the new channel: '3.9/stable'", parallel=False, coro=model.upgrade_charm(app.name, "3.9/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-victoria'", @@ -248,6 +258,11 @@ def test_auxiliary_upgrade_plan_ussuri_to_victoria(model): description=f"Refresh '{app.name}' to the latest revision of '3.9/stable'", coro=model.upgrade_charm(app.name, "3.9/stable"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-victoria'", @@ -323,6 +338,11 @@ def test_auxiliary_upgrade_plan_ussuri_to_victoria_ch_migration(model): f"Migrate '{app.name}' from charmstore to charmhub", coro=model.upgrade_charm(app.name, "3.9/stable", switch="ch:rabbitmq-server"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-victoria'", @@ -441,6 +461,11 @@ def test_rabbitmq_server_upgrade_plan_ussuri_to_victoria_auto_restart_False(mode description=f"Refresh '{app.name}' to the latest revision of '3.9/stable'", coro=model.upgrade_charm(app.name, "3.9/stable"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), run_deferred_hooks_and_restart_pre_upgrades, run_deferred_hooks_and_restart_pre_wait_step, UpgradeStep( @@ -815,6 +840,11 @@ def test_ceph_mon_upgrade_plan_xena_to_yoga(model): parallel=False, coro=model.upgrade_charm(app.name, "pacific/stable"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), PreUpgradeStep( description="Ensure that the 'require-osd-release' option matches the 'ceph-osd' " "version", @@ -827,6 +857,11 @@ def test_ceph_mon_upgrade_plan_xena_to_yoga(model): parallel=False, coro=model.upgrade_charm(app.name, "quincy/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-yoga'", @@ -901,6 +936,11 @@ def test_ceph_mon_upgrade_plan_ussuri_to_victoria(model): parallel=False, coro=model.upgrade_charm(app.name, "octopus/stable"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), PreUpgradeStep( "Ensure that the 'require-osd-release' option matches the 'ceph-osd' version", parallel=False, @@ -1187,6 +1227,11 @@ def test_ovn_principal_upgrade_plan(model): parallel=False, coro=model.upgrade_charm(app.name, "22.03/stable"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-{target}'", @@ -1261,6 +1306,11 @@ def test_mysql_innodb_cluster_upgrade(model): parallel=False, coro=model.upgrade_charm(app.name, "8.0/stable"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-{target}'", @@ -1496,6 +1546,7 @@ def test_ceph_osd_upgrade_plan(model): Ψ Upgrade software packages on unit 'ceph-osd/1' Ψ Upgrade software packages on unit 'ceph-osd/2' Refresh 'ceph-osd' to the latest revision of 'octopus/stable' + Wait for up to 300s for app 'ceph-osd' to reach the idle state Change charm config of 'ceph-osd' 'source' to 'cloud:focal-victoria' Wait for up to 300s for app 'ceph-osd' to reach the idle state Verify that the workload of 'ceph-osd' has been upgraded on units: ceph-osd/0, ceph-osd/1, ceph-osd/2 @@ -1866,6 +1917,13 @@ def test_vault_post_upgrade_steps_ussuri_to_victoria(model): parallel=False, coro=vault_o7k_app.model.upgrade_charm(vault_o7k_app.name, "1.7/stable"), ), + PreUpgradeStep( + description=( + f"Wait for up to 300s for app '{vault_o7k_app.name}' to reach the idle state" + ), + parallel=False, + coro=model.wait_for_idle(300, apps=[vault_o7k_app.name]), + ), PostUpgradeStep( description=( f"Wait for up to {vault_o7k_app.wait_timeout}s for" @@ -1918,6 +1976,16 @@ def test_vault_post_upgrade_steps_yoga_to_zed(vault_o7k_app): parallel=False, coro=vault_o7k_app.model.upgrade_charm(vault_o7k_app.name, "1.7/stable"), ), + PreUpgradeStep( + description=( + f"Wait for up to 300s for app '{vault_o7k_app.name}' to reach the idle state" + ), + parallel=False, + coro=vault_o7k_app.model.wait_for_idle( + 300, + apps=[vault_o7k_app.name], + ), + ), UpgradeStep( description=( f"Upgrade '{vault_o7k_app.name}' from" @@ -1926,6 +1994,16 @@ def test_vault_post_upgrade_steps_yoga_to_zed(vault_o7k_app): parallel=False, coro=vault_o7k_app.model.upgrade_charm(vault_o7k_app.name, "1.8/stable"), ), + UpgradeStep( + description=( + f"Wait for up to 300s for app '{vault_o7k_app.name}' to reach the idle state" + ), + parallel=False, + coro=vault_o7k_app.model.wait_for_idle( + 300, + apps=[vault_o7k_app.name], + ), + ), PostUpgradeStep( description=( f"Wait for up to {vault_o7k_app.wait_timeout}s" diff --git a/tests/unit/apps/test_auxiliary_subordinate.py b/tests/unit/apps/test_auxiliary_subordinate.py index d2c8ca74..0c03ffcc 100644 --- a/tests/unit/apps/test_auxiliary_subordinate.py +++ b/tests/unit/apps/test_auxiliary_subordinate.py @@ -84,6 +84,13 @@ def test_auxiliary_subordinate_upgrade_plan_to_victoria(model): coro=model.upgrade_charm(app.name, "8.0/stable"), ), ) + expected_plan.add_step( + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), + ) upgrade_plan = app.generate_upgrade_plan(target, False) @@ -202,7 +209,12 @@ def test_ovn_subordinate_upgrade_plan(model): description=f"Refresh '{app.name}' to the latest revision of '22.03/stable'", parallel=False, coro=model.upgrade_charm(app.name, "22.03/stable"), - ) + ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), ] expected_plan.add_steps(upgrade_steps) @@ -271,7 +283,12 @@ def test_ceph_dashboard_upgrade_plan_ussuri_to_victoria(model): description=f"Refresh '{app.name}' to the latest revision of 'octopus/stable'", parallel=False, coro=model.upgrade_charm(app.name, "octopus/stable"), - ) + ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), ] expected_plan.add_steps(upgrade_steps) @@ -311,12 +328,22 @@ def test_ceph_dashboard_upgrade_plan_xena_to_yoga(model): parallel=False, coro=model.upgrade_charm(app.name, "pacific/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Upgrade '{app.name}' from 'pacific/stable' to the new channel: " "'quincy/stable'", parallel=False, coro=model.upgrade_charm(app.name, "quincy/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), ] expected_plan.add_steps(upgrade_steps) @@ -333,6 +360,7 @@ def test_auxiliary_subordinate_latest_stable(model): Upgrade plan for 'keystone-hacluster' to 'victoria' WARNING: Changing 'keystone-hacluster' channel from latest/stable to 2.4/stable. \ This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'keystone-hacluster' to reach the idle state """ ) @@ -411,7 +439,9 @@ def test_hacluster_change_channel(model): """\ Upgrade plan for 'keystone-hacluster' to 'victoria' Refresh 'keystone-hacluster' to the latest revision of '2.0.3/stable' + Wait for up to 300s for app 'keystone-hacluster' to reach the idle state Upgrade 'keystone-hacluster' from '2.0.3/stable' to the new channel: '2.4/stable' + Wait for up to 300s for app 'keystone-hacluster' to reach the idle state """ ) diff --git a/tests/unit/apps/test_base.py b/tests/unit/apps/test_base.py index 8378d180..d996b35e 100644 --- a/tests/unit/apps/test_base.py +++ b/tests/unit/apps/test_base.py @@ -680,7 +680,7 @@ def test_get_refresh_charm_step_skip( units={}, workload_version="1", ) - assert app._get_refresh_charm_step(target) == PreUpgradeStep() + assert app._get_refresh_charm_steps(target) == [] mock_ch_migration.assert_not_called() mock_possible_downgrade_step.assert_not_called() mock_refresh_current_channel.assert_not_called() @@ -712,13 +712,22 @@ def test_get_refresh_charm_step_refresh_current_channel( units={}, workload_version="1", ) - expected_result = PreUpgradeStep( + upgrade_step = PreUpgradeStep( f"Refresh '{app.name}' to the latest revision of '{app.channel}'", coro=model.upgrade_charm(app.name, app.channel), ) - mock_refresh_current_channel.return_value = expected_result + mock_refresh_current_channel.return_value = upgrade_step + + expected_result = [ + upgrade_step, + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), + ] - assert app._get_refresh_charm_step(target) == expected_result + assert app._get_refresh_charm_steps(target) == expected_result mock_ch_migration.assert_not_called() mock_possible_downgrade_step.assert_not_called() @@ -762,11 +771,19 @@ def test_get_refresh_charm_step_change_to_openstack_channels( ) coro = model.upgrade_charm(app.name, app.expected_current_channel) - expected_step = PreUpgradeStep(description=description, coro=coro) - - mock_possible_downgrade_step.return_value = expected_step + upgrade_step = PreUpgradeStep(description=description, coro=coro) + mock_possible_downgrade_step.return_value = upgrade_step + + expected_steps = [ + upgrade_step, + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), + ] - assert app._get_refresh_charm_step(target) == expected_step + assert app._get_refresh_charm_steps(target) == expected_steps mock_ch_migration.assert_not_called() mock_possible_downgrade_step.assert_called_once_with(target, "ussuri/stable") @@ -803,13 +820,22 @@ def test_get_refresh_charm_step_charmhub_migration( units={}, workload_version="1", ) - expected_result = PreUpgradeStep( + migrate_step = PreUpgradeStep( f"Migrate '{app.name}' from charmstore to charmhub", coro=model.upgrade_charm(app.name, app.expected_current_channel, switch=f"ch:{app.charm}"), ) - mock_ch_migration.return_value = expected_result + mock_ch_migration.return_value = migrate_step + + expected_result = [ + migrate_step, + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), + ] - assert app._get_refresh_charm_step(target) == expected_result + assert app._get_refresh_charm_steps(target) == expected_result mock_ch_migration.assert_called_once() mock_possible_downgrade_step.assert_not_called() diff --git a/tests/unit/apps/test_channel_based.py b/tests/unit/apps/test_channel_based.py index 809d12bf..73a53cc8 100644 --- a/tests/unit/apps/test_channel_based.py +++ b/tests/unit/apps/test_channel_based.py @@ -73,7 +73,9 @@ def test_channel_based_application_latest_stable(model): Ψ Upgrade software packages on unit 'glance-simplestreams-sync/0' WARNING: Changing 'glance-simplestreams-sync' channel from latest/stable to victoria/stable. \ This may be a charm downgrade, which is generally not supported. + Wait for up to 300s for app 'glance-simplestreams-sync' to reach the idle state Upgrade 'glance-simplestreams-sync' from 'victoria/stable' to the new channel: 'wallaby/stable' + Wait for up to 300s for app 'glance-simplestreams-sync' to reach the idle state Change charm config of 'glance-simplestreams-sync' 'openstack-origin' to 'cloud:focal-wallaby' """ # noqa: E501 line too long ) @@ -259,12 +261,22 @@ def test_application_versionless_upgrade_plan_ussuri_to_victoria(model): parallel=False, coro=model.upgrade_charm(app.name, "ussuri/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Upgrade '{app.name}' from 'ussuri/stable' to the new channel: " "'victoria/stable'", parallel=False, coro=model.upgrade_charm(app.name, "victoria/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-victoria'", @@ -335,12 +347,22 @@ def test_application_gnocchi_upgrade_plan_ussuri_to_victoria(model): parallel=False, coro=model.upgrade_charm(app.name, "ussuri/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Upgrade '{app.name}' from 'ussuri/stable' to the new channel: " "'victoria/stable'", parallel=False, coro=model.upgrade_charm(app.name, "victoria/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-victoria'", @@ -420,12 +442,22 @@ def test_application_designate_bind_upgrade_plan_ussuri_to_victoria(model): parallel=False, coro=model.upgrade_charm(app.name, "ussuri/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Upgrade '{app.name}' from 'ussuri/stable' to the new channel: " "'victoria/stable'", parallel=False, coro=model.upgrade_charm(app.name, "victoria/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-victoria'", diff --git a/tests/unit/apps/test_core.py b/tests/unit/apps/test_core.py index a1b8c290..02937403 100644 --- a/tests/unit/apps/test_core.py +++ b/tests/unit/apps/test_core.py @@ -215,6 +215,11 @@ def test_upgrade_plan_ussuri_to_victoria(model): parallel=False, coro=model.upgrade_charm(app.name, "ussuri/stable"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' 'action-managed-upgrade' " "from 'True' to 'False'", @@ -227,6 +232,11 @@ def test_upgrade_plan_ussuri_to_victoria(model): parallel=False, coro=model.upgrade_charm(app.name, "victoria/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-victoria'", @@ -302,6 +312,11 @@ def test_upgrade_plan_ussuri_to_victoria_ch_migration(model): parallel=False, coro=model.upgrade_charm(app.name, "ussuri/stable", switch="ch:keystone"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' 'action-managed-upgrade' " "from 'True' to 'False'", @@ -314,6 +329,11 @@ def test_upgrade_plan_ussuri_to_victoria_ch_migration(model): parallel=False, coro=model.upgrade_charm(app.name, "victoria/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-victoria'", @@ -472,6 +492,11 @@ def test_upgrade_plan_origin_already_on_next_openstack_release(model): parallel=False, coro=model.upgrade_charm(app.name, "ussuri/stable"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' 'action-managed-upgrade' " "from 'True' to 'False'", @@ -484,6 +509,11 @@ def test_upgrade_plan_origin_already_on_next_openstack_release(model): parallel=False, coro=model.upgrade_charm(app.name, "victoria/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), PostUpgradeStep( description=f"Wait for up to 2400s for model '{model.name}' to reach the idle state", parallel=False, @@ -590,12 +620,22 @@ def test_upgrade_plan_application_already_disable_action_managed(model): parallel=False, coro=model.upgrade_charm(app.name, "ussuri/stable"), ), + PreUpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Upgrade '{app.name}' from 'ussuri/stable' to the new channel: " "'victoria/stable'", parallel=False, coro=model.upgrade_charm(app.name, "victoria/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Change charm config of '{app.name}' " f"'{app.origin_setting}' to 'cloud:focal-victoria'", @@ -622,7 +662,7 @@ def test_upgrade_plan_application_already_disable_action_managed(model): assert_steps(upgrade_plan, expected_plan) -@patch("cou.apps.base.OpenStackApplication._get_refresh_charm_step") +@patch("cou.apps.base.OpenStackApplication._get_refresh_charm_steps") @patch("cou.apps.base.OpenStackApplication._get_upgrade_current_release_packages_step") @patch("cou.apps.core.NovaCompute._get_disable_scheduler_step") def test_nova_compute_pre_upgrade_steps( @@ -846,8 +886,10 @@ def test_nova_compute_upgrade_plan(model): Ψ Upgrade software packages on unit 'nova-compute/1' Ψ Upgrade software packages on unit 'nova-compute/2' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'source' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/0, nova-compute/1, nova-compute/2 Ψ Upgrade plan for unit 'nova-compute/0' @@ -917,8 +959,10 @@ def test_nova_compute_upgrade_plan_single_unit(model): Upgrade software packages of 'nova-compute' from the current APT repositories Ψ Upgrade software packages on unit 'nova-compute/0' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'source' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/0 Ψ Upgrade plan for unit 'nova-compute/0' @@ -976,7 +1020,9 @@ def test_cinder_upgrade_plan(model): Ψ Upgrade software packages on unit 'cinder/1' Ψ Upgrade software packages on unit 'cinder/2' Refresh 'cinder' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'cinder' to reach the idle state Upgrade 'cinder' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder' to reach the idle state Change charm config of 'cinder' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 300s for app 'cinder' to reach the idle state Verify that the workload of 'cinder' has been upgraded on units: \ @@ -1025,8 +1071,10 @@ def test_cinder_upgrade_plan_single_unit(model): Upgrade software packages of 'cinder' from the current APT repositories Ψ Upgrade software packages on unit 'cinder/0' Refresh 'cinder' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'cinder' to reach the idle state Change charm config of 'cinder' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'cinder' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder' to reach the idle state Change charm config of 'cinder' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: cinder/0 Ψ Upgrade plan for unit 'cinder/0' diff --git a/tests/unit/apps/test_subordinate.py b/tests/unit/apps/test_subordinate.py index c89c2f2b..861825e1 100644 --- a/tests/unit/apps/test_subordinate.py +++ b/tests/unit/apps/test_subordinate.py @@ -74,12 +74,22 @@ def test_generate_upgrade_plan(model): parallel=False, coro=model.upgrade_charm(app.name, "ussuri/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Upgrade '{app.name}' from 'ussuri/stable' to the new channel: " "'victoria/stable'", parallel=False, coro=model.upgrade_charm(app.name, "victoria/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), ] expected_plan.add_steps(upgrade_steps) @@ -191,12 +201,22 @@ def test_generate_plan_ch_migration(model, channel): parallel=False, coro=model.upgrade_charm(app.name, "victoria/stable", switch="ch:keystone-ldap"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Upgrade '{app.name}' from 'victoria/stable' to the new channel: " "'wallaby/stable'", parallel=False, coro=model.upgrade_charm(app.name, "wallaby/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), ] expected_plan.add_steps(upgrade_steps) @@ -239,12 +259,22 @@ def test_generate_plan_from_to(model, from_os, to_os): parallel=False, coro=model.upgrade_charm(app.name, f"{from_os}/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), UpgradeStep( description=f"Upgrade '{app.name}' from '{from_os}/stable' to the new channel: " f"'{to_os}/stable'", parallel=False, coro=model.upgrade_charm(app.name, f"{to_os}/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), ] expected_plan.add_steps(upgrade_steps) @@ -288,6 +318,11 @@ def test_generate_plan_in_same_version(model, from_to): parallel=False, coro=model.upgrade_charm(app.name, f"{from_to}/stable"), ), + UpgradeStep( + description=f"Wait for up to 300s for app '{app.name}' to reach the idle state", + parallel=False, + coro=model.wait_for_idle(300, apps=[app.name]), + ), ] expected_plan.add_steps(upgrade_steps) diff --git a/tests/unit/steps/test_hypervisor.py b/tests/unit/steps/test_hypervisor.py index c2225705..746951bc 100644 --- a/tests/unit/steps/test_hypervisor.py +++ b/tests/unit/steps/test_hypervisor.py @@ -396,12 +396,15 @@ def test_hypervisor_upgrade_plan(model): Upgrade software packages of 'cinder' from the current APT repositories Ψ Upgrade software packages on unit 'cinder/0' Refresh 'cinder' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'cinder' to reach the idle state Disable nova-compute scheduler from unit: 'nova-compute/0' Upgrade software packages of 'nova-compute' from the current APT repositories Ψ Upgrade software packages on unit 'nova-compute/0' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'cinder' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'cinder' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder' to reach the idle state Change charm config of 'cinder' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: cinder/0 Ψ Upgrade plan for unit 'cinder/0' @@ -410,6 +413,7 @@ def test_hypervisor_upgrade_plan(model): Resume the unit: 'cinder/0' Change charm config of 'nova-compute' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'source' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/0 Ψ Upgrade plan for unit 'nova-compute/0' @@ -428,8 +432,10 @@ def test_hypervisor_upgrade_plan(model): Upgrade software packages of 'nova-compute' from the current APT repositories Ψ Upgrade software packages on unit 'nova-compute/1' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'source' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/1 Ψ Upgrade plan for unit 'nova-compute/1' @@ -446,8 +452,10 @@ def test_hypervisor_upgrade_plan(model): Upgrade software packages of 'nova-compute' from the current APT repositories Ψ Upgrade software packages on unit 'nova-compute/2' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'source' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/2 Ψ Upgrade plan for unit 'nova-compute/2' @@ -531,12 +539,15 @@ def test_hypervisor_upgrade_plan_single_machine(model): Upgrade software packages of 'cinder' from the current APT repositories Ψ Upgrade software packages on unit 'cinder/0' Refresh 'cinder' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'cinder' to reach the idle state Disable nova-compute scheduler from unit: 'nova-compute/0' Upgrade software packages of 'nova-compute' from the current APT repositories Ψ Upgrade software packages on unit 'nova-compute/0' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'cinder' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'cinder' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'cinder' to reach the idle state Change charm config of 'cinder' 'openstack-origin' to 'cloud:focal-victoria' Upgrade plan for units: cinder/0 Ψ Upgrade plan for unit 'cinder/0' @@ -545,6 +556,7 @@ def test_hypervisor_upgrade_plan_single_machine(model): Resume the unit: 'cinder/0' Change charm config of 'nova-compute' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'source' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/0 Ψ Upgrade plan for unit 'nova-compute/0' diff --git a/tests/unit/steps/test_plan.py b/tests/unit/steps/test_plan.py index 7879be7a..f4807f73 100644 --- a/tests/unit/steps/test_plan.py +++ b/tests/unit/steps/test_plan.py @@ -162,17 +162,22 @@ async def test_generate_plan(mock_filter_hypervisors, model, cli_args): OVN subordinate upgrade plan Upgrade plan for 'ovn-chassis' to 'victoria' Refresh 'ovn-chassis' to the latest revision of '22.03/stable' + Wait for up to 300s for app 'ovn-chassis' to reach the idle state Control Plane subordinate(s) upgrade plan Upgrade plan for 'keystone-ldap' to 'victoria' Refresh 'keystone-ldap' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'keystone-ldap' to reach the idle state Upgrade 'keystone-ldap' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'keystone-ldap' to reach the idle state Control Plane principal(s) upgrade plan Upgrade plan for 'keystone' to 'victoria' Upgrade software packages of 'keystone' from the current APT repositories Ψ Upgrade software packages on unit 'keystone/0' Refresh 'keystone' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'keystone' to reach the idle state Change charm config of 'keystone' 'action-managed-upgrade' from 'True' to 'False' Upgrade 'keystone' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'keystone' to reach the idle state Change charm config of 'keystone' 'openstack-origin' to 'cloud:focal-victoria' Wait for up to 2400s for model 'test_model' to reach the idle state Verify that the workload of 'keystone' has been upgraded on units: keystone/0 @@ -182,8 +187,10 @@ async def test_generate_plan(mock_filter_hypervisors, model, cli_args): Upgrade software packages of 'nova-compute' from the current APT repositories Ψ Upgrade software packages on unit 'nova-compute/0' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'source' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/0 Ψ Upgrade plan for unit 'nova-compute/0' @@ -201,6 +208,7 @@ async def test_generate_plan(mock_filter_hypervisors, model, cli_args): Upgrade software packages of 'ceph-osd' from the current APT repositories Ψ Upgrade software packages on unit 'ceph-osd/0' Refresh 'ceph-osd' to the latest revision of 'octopus/stable' + Wait for up to 300s for app 'ceph-osd' to reach the idle state Change charm config of 'ceph-osd' 'source' to 'cloud:focal-victoria' Wait for up to 300s for app 'ceph-osd' to reach the idle state Verify that the workload of 'ceph-osd' has been upgraded on units: ceph-osd/0 @@ -334,18 +342,23 @@ async def test_generate_plan_with_warning_messages(mock_filter_hypervisors, mode OVN subordinate upgrade plan Upgrade plan for 'ovn-chassis' to 'victoria' Refresh 'ovn-chassis' to the latest revision of '22.03/stable' + Wait for up to 300s for app 'ovn-chassis' to reach the idle state Control Plane subordinate(s) upgrade plan Upgrade plan for 'keystone-ldap' to 'victoria' Refresh 'keystone-ldap' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'keystone-ldap' to reach the idle state Upgrade 'keystone-ldap' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'keystone-ldap' to reach the idle state Upgrading all applications deployed on machines with hypervisor. Upgrade plan for [nova-compute/0] in 'az-1' to 'victoria' Disable nova-compute scheduler from unit: 'nova-compute/0' Upgrade software packages of 'nova-compute' from the current APT repositories Ψ Upgrade software packages on unit 'nova-compute/0' Refresh 'nova-compute' to the latest revision of 'ussuri/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'action-managed-upgrade' from 'False' to 'True' Upgrade 'nova-compute' from 'ussuri/stable' to the new channel: 'victoria/stable' + Wait for up to 300s for app 'nova-compute' to reach the idle state Change charm config of 'nova-compute' 'source' to 'cloud:focal-victoria' Upgrade plan for units: nova-compute/0 Ψ Upgrade plan for unit 'nova-compute/0' @@ -363,6 +376,7 @@ async def test_generate_plan_with_warning_messages(mock_filter_hypervisors, mode Upgrade software packages of 'ceph-osd' from the current APT repositories Ψ Upgrade software packages on unit 'ceph-osd/0' Refresh 'ceph-osd' to the latest revision of 'octopus/stable' + Wait for up to 300s for app 'ceph-osd' to reach the idle state Change charm config of 'ceph-osd' 'source' to 'cloud:focal-victoria' Wait for up to 300s for app 'ceph-osd' to reach the idle state Verify that the workload of 'ceph-osd' has been upgraded on units: ceph-osd/0