@@ -21448,27 +21448,31 @@ def test_aks_upgrade_upgrade_settings(self, resource_group, resource_group_locat
2144821448 @AllowLargeResponse()
2144921449 @AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus2')
2145021450 def test_aks_upgrade_with_tier_switch(self, resource_group, resource_group_location):
21451- """ This test case exercises enabling LTS tier with upgrade command."""
21451+ """ This test case exercises switching from LTS tier with upgrade command."""
2145221452
2145321453 # reset the count so in replay mode the random names will start with 0
2145421454 self.test_resources_count = 0
2145521455 # kwargs for string formatting
2145621456 aks_name = self.create_random_name('cliakstest', 16)
2145721457
21458- # Pick the oldest community-supported version
21458+ # Pick the oldest community-supported version as the upgrade target.
2145921459 non_lts_version = self._get_oldest_non_lts_version(resource_group_location)
2146021460 if non_lts_version is None:
2146121461 self.skipTest('No community-supported versions found in the location')
2146221462
21463- # Use the 2nd latest available LTS-only version
21463+ # Use the latest available LTS-only version as the source version.
2146421464 lts_version = self._get_latest_lts_version(resource_group_location)
2146521465 if lts_version is None:
2146621466 self.skipTest('No LTS-only versions found in the location')
2146721467
21468- # ensure non_lts_version and lts_version has less than 3 minor version difference,
21469- # otherwise the upgrade will not be allowed
21468+ # This test performs an upgrade while switching away from the LTS support plan,
21469+ # so the target version must be newer than the source version.
21470+ if version_to_tuple(non_lts_version) <= version_to_tuple(lts_version):
21471+ self.skipTest('No newer community-supported version is available for upgrade from the selected LTS version')
21472+
21473+ # Ensure the upgrade path stays within the allowed minor-version window.
2147021474 if self._get_minor_version(non_lts_version) - self._get_minor_version(lts_version) > 3:
21471- self.skipTest('Non-LTS version and LTS version has more than 3 minor version difference')
21475+ self.skipTest('Non-LTS version and LTS version have more than 3 minor versions difference')
2147221476
2147321477 self.kwargs.update({
2147421478 'resource_group': resource_group,
0 commit comments