Skip to content

Commit

Permalink
tests: give jammy->noble upgrade its own test
Browse files Browse the repository at this point in the history
  • Loading branch information
orndorffgrant committed Sep 17, 2024
1 parent f79425d commit b465c81
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 6 deletions.
10 changes: 10 additions & 0 deletions features/steps/machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,13 @@ def given_a_sut_machine_with_user_data(context, series, machine_type):
@when("I reboot the machine")
def when_i_reboot_the_machine(context, machine_name=SUT):
context.machines[machine_name].instance.restart(wait=True)


@when("I update the series in the machine test metadata to `{series}`")
def when_i_update_series(context, series, machine_name=SUT):
context.machines[machine_name] = MachineTuple(
series=series,
machine_type=context.machines[machine_name].machine_type,
cloud=context.machines[machine_name].cloud,
instance=context.machines[machine_name].instance,
)
63 changes: 57 additions & 6 deletions features/ubuntu_upgrade.feature
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,63 @@ Feature: Upgrade between releases when uaclient is attached
"""

Examples: ubuntu release
| release | machine_type | next_release | prompt | devel_release | service1 | service1_status | service2 | service2_status | before_cmd |
| xenial | lxd-container | bionic | lts | | esm-infra | enabled | esm-apps | enabled | true |
| bionic | lxd-container | focal | lts | | esm-infra | enabled | esm-apps | enabled | true |
| bionic | lxd-container | focal | lts | | usg | enabled | usg | enabled | pro enable cis |
| focal | lxd-container | jammy | lts | | esm-infra | enabled | esm-apps | enabled | true |
| jammy | lxd-container | noble | lts | --devel-release | esm-infra | enabled | esm-apps | enabled | true |
| release | machine_type | next_release | prompt | devel_release | service1 | service1_status | service2 | service2_status | before_cmd |
| xenial | lxd-container | bionic | lts | | esm-infra | enabled | esm-apps | enabled | true |
| bionic | lxd-container | focal | lts | | esm-infra | enabled | esm-apps | enabled | true |
| bionic | lxd-container | focal | lts | | usg | enabled | usg | enabled | pro enable cis |
| focal | lxd-container | jammy | lts | | esm-infra | enabled | esm-apps | enabled | true |

@slow @upgrade
Scenario Outline: Attached upgrade jammy to noble
Given a `<release>` `<machine_type>` machine with ubuntu-advantage-tools installed
When I attach `contract_token` with sudo
# Local PPAs are prepared and served only when testing with local debs
And I prepare the local PPAs to upgrade from `<release>` to `<next_release>`
And I run `DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade --assume-yes` with sudo
# Some packages upgrade may require a reboot
And I reboot the machine
And I create the file `/etc/update-manager/release-upgrades.d/ua-test.cfg` with the following
"""
[Sources]
AllowThirdParty=yes
"""
And I run `sed -i 's/Prompt=lts/Prompt=<prompt>/' /etc/update-manager/release-upgrades` with sudo
And I run `do-release-upgrade <devel_release> --frontend DistUpgradeViewNonInteractive` `with sudo` and stdin `y\n`
When I run `systemctl mask apt-news.service` with sudo
When I run `systemctl mask esm-cache.service` with sudo
And I update the series in the machine test metadata to `<next_release>`
And I install ubuntu-advantage-tools
When I run `systemctl unmask esm-cache.service` with sudo
When I run `systemctl unmask apt-news.service` with sudo
And I reboot the machine
And I run `lsb_release -cs` as non-root
Then I will see the following on stdout:
"""
<next_release>
"""
And I verify that running `egrep "<release>|disabled" /etc/apt/sources.list.d/*` `as non-root` exits `2`
And I will see the following on stdout:
"""
"""
When I run `pro refresh` with sudo
And I run `pro status --all` with sudo
Then stdout matches regexp:
"""
<service1> +yes +<service1_status>
"""
Then stdout matches regexp:
"""
<service2> +yes +<service2_status>
"""
When I run `pro detach --assume-yes` with sudo
Then stdout matches regexp:
"""
This machine is now detached.
"""

Examples: ubuntu release
| release | machine_type | next_release | prompt | devel_release | service1 | service1_status | service2 | service2_status |
| jammy | lxd-container | noble | lts | --devel-release | esm-infra | enabled | esm-apps | enabled |

@slow @upgrade
Scenario Outline: Attached FIPS upgrade across LTS releases
Expand Down

0 comments on commit b465c81

Please sign in to comment.