Merge ~renanrodrigo/ubuntu/+source/ubuntu-advantage-tools:upload-27.11-kinetic into ubuntu/+source/ubuntu-advantage-tools:ubuntu/devel

Proposed by Renan Rodrigo
Status: Merged
Merge reported by: Renan Rodrigo
Merged at revision: 69ddad099a3f8a03070499406e4fd02dfcc2fb91
Proposed branch: ~renanrodrigo/ubuntu/+source/ubuntu-advantage-tools:upload-27.11-kinetic
Merge into: ubuntu/+source/ubuntu-advantage-tools:ubuntu/devel
Diff against target: 34580 lines (+14190/-5940)
218 files modified
.github/workflows/ci-integration.yaml (+8/-3)
.github/workflows/cla-check.yaml (+12/-0)
.readthedocs.yaml (+14/-0)
CONTRIBUTING.md (+6/-0)
Makefile (+1/-0)
README.md (+33/-32)
apport/source_ubuntu-advantage-tools.py (+29/-0)
apt-hook/hook.cc (+2/-6)
apt-hook/json-hook.cc (+3/-12)
apt-hook/json-hook.test.cc (+22/-22)
debian/changelog (+60/-0)
debian/control (+2/-2)
debian/ubuntu-advantage-tools.links (+2/-0)
debian/ubuntu-advantage-tools.postinst (+26/-3)
dev-docs/explanations/how_auto_attach_works.md (+57/-0)
dev-docs/howtoguides/how_to_use_magic_attach_endpoints.md (+168/-0)
dev-docs/howtoguides/testing.md (+12/-4)
dev-docs/howtoguides/use_staging_environment.md (+13/-0)
dev-docs/references/directory_layout.md (+11/-0)
dev-docs/references/what_happens_during_attach.md (+2/-1)
dev/null (+0/-9)
docs-requirements.txt (+4/-0)
docs/README.md (+11/-0)
docs/conf.py (+52/-0)
docs/explanations/apt_messages.md (+19/-29)
docs/explanations/how_to_interpret_the_security_status_command.md (+7/-0)
docs/explanations/motd_messages.md (+15/-18)
docs/explanations/status_columns.md (+2/-3)
docs/explanations/what_are_the_timer_jobs.md (+1/-1)
docs/howtoguides/create_pro_golden_image.md (+7/-17)
docs/howtoguides/enable_cc.md (+28/-0)
docs/howtoguides/enable_realtime_kernel.md (+62/-0)
docs/howtoguides/enable_ua_in_dockerfile.md (+1/-1)
docs/howtoguides/get_token_and_attach.md (+1/-1)
docs/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md (+1/-1)
docs/howtoguides/how_to_simulate_attach.md (+1/-1)
docs/index.rst (+58/-0)
docs/references/support_matrix.md (+3/-1)
docs/tutorials/basic_ua_commands.md (+6/-7)
docs/tutorials/create_a_fips_updates_pro_cloud_image.md (+65/-0)
docs/tutorials/ua_fix_scenarios.md (+9/-9)
features/_version.feature (+8/-8)
features/api.feature (+52/-0)
features/api_full_auto_attach.feature (+39/-0)
features/api_magic_attach.feature (+74/-0)
features/apt_messages.feature (+328/-0)
features/attach_invalidtoken.feature (+10/-10)
features/attach_validtoken.feature (+37/-170)
features/attached_commands.feature (+189/-240)
features/attached_enable.feature (+251/-183)
features/attached_status.feature (+168/-3)
features/cloud.py (+7/-15)
features/cloud_pro_clone.feature (+65/-0)
features/collect_logs.feature (+4/-14)
features/daemon.feature (+16/-16)
features/detached_auto_attach.feature (+7/-7)
features/docker.feature (+3/-3)
features/enable_fips_cloud.feature (+36/-36)
features/enable_fips_container.feature (+11/-11)
features/enable_fips_pro.feature (+15/-15)
features/enable_fips_vm.feature (+68/-66)
features/environment.py (+104/-77)
features/fix.feature (+58/-60)
features/install_uninstall.feature (+2/-2)
features/motd_messages.feature (+163/-0)
features/proxy_config.feature (+127/-127)
features/realtime_kernel.feature (+49/-12)
features/schemas/api_response.json (+64/-0)
features/schemas/magic_attach.json (+24/-0)
features/schemas/ua_security_status.json (+19/-0)
features/security_status.feature (+542/-0)
features/staging_commands.feature (+6/-53)
features/steps/steps.py (+216/-74)
features/ubuntu_pro.feature (+167/-59)
features/ubuntu_pro_fips.feature (+100/-113)
features/ubuntu_upgrade.feature (+25/-23)
features/ubuntu_upgrade_unattached.feature (+3/-5)
features/unattached_commands.feature (+135/-103)
features/unattached_status.feature (+467/-176)
features/util.py (+67/-42)
help_data.yaml (+10/-11)
integration-requirements.txt (+1/-1)
lib/auto_attach.py (+69/-0)
lib/daemon.py (+2/-2)
lib/patch_status_json.py (+4/-4)
lib/reboot_cmds.py (+10/-8)
lib/timer.py (+7/-2)
lib/upgrade_lts_contract.py (+16/-10)
setup.py (+5/-1)
systemd/ua-auto-attach.service (+2/-1)
tools/create-lp-release-branches.sh (+2/-3)
tools/refresh-aws-pro-ids (+3/-3)
tools/run-integration-tests.py (+37/-27)
tools/test-in-lxd.sh (+2/-2)
tools/ua.bash (+1/-1)
tox.ini (+4/-3)
uaclient-devel.conf (+1/-1)
uaclient.conf (+3/-3)
uaclient/actions.py (+170/-10)
uaclient/api/__init__.py (+0/-0)
uaclient/api/api.py (+144/-0)
uaclient/api/data_types.py (+69/-0)
uaclient/api/errors.py (+61/-0)
uaclient/api/exceptions.py (+40/-0)
uaclient/api/tests/__init__.py (+0/-0)
uaclient/api/tests/test_api.py (+310/-0)
uaclient/api/tests/test_api_u_pro_attach_auto_should_auto_attach.py (+49/-0)
uaclient/api/tests/test_api_u_pro_attach_magic_wait_v1.py (+147/-0)
uaclient/api/tests/test_api_u_pro_version.py (+26/-0)
uaclient/api/tests/test_u_pro_attach_auto_full_auto_attach_v1.py (+161/-0)
uaclient/api/u/__init__.py (+0/-0)
uaclient/api/u/pro/__init__.py (+0/-0)
uaclient/api/u/pro/attach/__init__.py (+0/-0)
uaclient/api/u/pro/attach/auto/__init__.py (+0/-0)
uaclient/api/u/pro/attach/auto/full_auto_attach/__init__.py (+0/-0)
uaclient/api/u/pro/attach/auto/full_auto_attach/v1.py (+149/-0)
uaclient/api/u/pro/attach/auto/should_auto_attach/__init__.py (+0/-0)
uaclient/api/u/pro/attach/auto/should_auto_attach/v1.py (+41/-0)
uaclient/api/u/pro/attach/magic/__init__.py (+0/-0)
uaclient/api/u/pro/attach/magic/initiate/__init__.py (+0/-0)
uaclient/api/u/pro/attach/magic/initiate/v1.py (+55/-0)
uaclient/api/u/pro/attach/magic/revoke/__init__.py (+0/-0)
uaclient/api/u/pro/attach/magic/revoke/v1.py (+39/-0)
uaclient/api/u/pro/attach/magic/wait/__init__.py (+0/-0)
uaclient/api/u/pro/attach/magic/wait/v1.py (+118/-0)
uaclient/api/u/pro/version/__init__.py (+0/-0)
uaclient/api/u/pro/version/v1.py (+39/-0)
uaclient/apt.py (+111/-43)
uaclient/cli.py (+244/-279)
uaclient/clouds/aws.py (+5/-5)
uaclient/clouds/azure.py (+4/-4)
uaclient/clouds/gcp.py (+9/-7)
uaclient/clouds/identity.py (+4/-4)
uaclient/clouds/tests/test_aws.py (+3/-3)
uaclient/clouds/tests/test_azure.py (+6/-6)
uaclient/clouds/tests/test_gcp.py (+9/-7)
uaclient/clouds/tests/test_identity.py (+9/-9)
uaclient/config.py (+56/-257)
uaclient/conftest.py (+30/-9)
uaclient/contract.py (+209/-34)
uaclient/contract_data_types.py (+312/-0)
uaclient/daemon.py (+8/-8)
uaclient/data_types.py (+63/-8)
uaclient/defaults.py (+11/-2)
uaclient/entitlements/__init__.py (+45/-0)
uaclient/entitlements/base.py (+58/-36)
uaclient/entitlements/cc.py (+15/-6)
uaclient/entitlements/cis.py (+3/-2)
uaclient/entitlements/entitlement_status.py (+4/-3)
uaclient/entitlements/esm.py (+36/-12)
uaclient/entitlements/fips.py (+37/-25)
uaclient/entitlements/livepatch.py (+33/-23)
uaclient/entitlements/realtime.py (+16/-8)
uaclient/entitlements/repo.py (+46/-23)
uaclient/entitlements/ros.py (+0/-1)
uaclient/entitlements/tests/conftest.py (+18/-6)
uaclient/entitlements/tests/test_base.py (+49/-14)
uaclient/entitlements/tests/test_cc.py (+30/-18)
uaclient/entitlements/tests/test_cis.py (+5/-4)
uaclient/entitlements/tests/test_esm.py (+32/-37)
uaclient/entitlements/tests/test_fips.py (+68/-48)
uaclient/entitlements/tests/test_livepatch.py (+243/-124)
uaclient/entitlements/tests/test_repo.py (+72/-32)
uaclient/event_logger.py (+8/-16)
uaclient/exceptions.py (+82/-29)
uaclient/files.py (+433/-0)
uaclient/jobs/eol_status.py (+13/-0)
uaclient/jobs/tests/__init__.py (+0/-0)
uaclient/jobs/tests/test_update_messaging.py (+111/-136)
uaclient/jobs/update_messaging.py (+102/-85)
uaclient/lock.py (+2/-2)
uaclient/messages.py (+234/-84)
uaclient/security.py (+66/-31)
uaclient/security_status.py (+498/-74)
uaclient/serviceclient.py (+16/-5)
uaclient/snap.py (+7/-7)
uaclient/status.py (+74/-41)
uaclient/system.py (+479/-0)
uaclient/tests/test_apt.py (+134/-70)
uaclient/tests/test_cli.py (+122/-28)
uaclient/tests/test_cli_api.py (+64/-0)
uaclient/tests/test_cli_attach.py (+30/-26)
uaclient/tests/test_cli_auto_attach.py (+26/-117)
uaclient/tests/test_cli_collect_logs.py (+39/-54)
uaclient/tests/test_cli_config_set.py (+20/-9)
uaclient/tests/test_cli_config_show.py (+24/-10)
uaclient/tests/test_cli_config_unset.py (+18/-7)
uaclient/tests/test_cli_detach.py (+7/-8)
uaclient/tests/test_cli_disable.py (+42/-26)
uaclient/tests/test_cli_enable.py (+38/-17)
uaclient/tests/test_cli_fix.py (+8/-4)
uaclient/tests/test_cli_refresh.py (+17/-14)
uaclient/tests/test_cli_security_status.py (+70/-33)
uaclient/tests/test_cli_status.py (+184/-98)
uaclient/tests/test_config.py (+201/-192)
uaclient/tests/test_contract.py (+457/-22)
uaclient/tests/test_daemon.py (+10/-10)
uaclient/tests/test_data_types.py (+296/-1)
uaclient/tests/test_eol_status.py (+83/-0)
uaclient/tests/test_event_logger.py (+20/-2)
uaclient/tests/test_files.py (+175/-0)
uaclient/tests/test_gpg.py (+5/-5)
uaclient/tests/test_lib_auto_attach.py (+98/-0)
uaclient/tests/test_lock.py (+2/-2)
uaclient/tests/test_patch_status_json.py (+8/-8)
uaclient/tests/test_reboot_cmds.py (+3/-3)
uaclient/tests/test_security.py (+109/-79)
uaclient/tests/test_security_status.py (+149/-53)
uaclient/tests/test_snap.py (+5/-5)
uaclient/tests/test_status.py (+117/-129)
uaclient/tests/test_system.py (+953/-0)
uaclient/tests/test_ua_timer.py (+3/-1)
uaclient/tests/test_upgrade_lts_contract.py (+6/-1)
uaclient/tests/test_util.py (+29/-795)
uaclient/tests/test_version.py (+70/-2)
uaclient/util.py (+67/-449)
uaclient/version.py (+53/-5)
ubuntu-advantage.1 (+41/-39)
Reviewer Review Type Date Requested Status
Robie Basak ubuntu-sru Approve
Paride Legovini (community) Approve
Review via email: mp+429778@code.launchpad.net

Description of the change

Release 27.11 of ubuntu-advantage-tools.

More information about the changes can be found in the SRU bug:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1989279

Packages built from this branch can be found in the `staging` PPA:
https://launchpad.net/~ua-client/+archive/ubuntu/staging

To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote :

Has the namespace grab of /usr/bin/pro been approved by somebody considering the archive side - such as an AA? Notably /usr/bin/ua remains "grabbed". Are we OK to continue to grow a list of short names that will potentially collide with Debian essentially forever?

review: Needs Information
Revision history for this message
Robie Basak (racb) wrote :

Somebody also needs to search the archives for anything that might collide with "pro" in PATH please. And another risk that should be noted is that users may have installed "pro" into their PATH either via a local customisation or a third party software source, and this would then collide.

9119019... by Grant Orndorff

messaging: correct num covered packages

Revision history for this message
Paride Legovini (paride) wrote :

Hi, this diff is quite big, I tried to do a commit by commit review to get a sense of the changes, paying more attention to packaging changes and changes in behavior and less attention to changes that do not affect how to package behaves for users (e.g. tests). The gist of it is:

- New features: they look safe to me from a SRU perspective. The code looks good, so I'm +1 for inclusion in the stable releases (provided that the tests pass).

- Bug fixes: LGTM.

- Renaming from ua to pro: it's a bit confusing in some places, for example the service files and "true" filenames of the cli tool and manpage are still `ubuntu-advantage`, but then users are expected to use "pro", and then `ua` still appears here and there. In any case, given that we had to stay backwards compatible, I think you did the best that was possible to do with the rename.

- File name clash: I share Robie's concern on taking the "pro" name. I searched the archive and I don't think we have conflicts at the moment, but this is a "forever" thing. We should at least think of a way to free the "ua" name at some point, not straightforward as we want to SRU the same package to all the supported releases, but doable.

- File name clash 2: if a stable release user is using "pro" for a locally installed script/package/alias, the new "pro" command may not work as expected, or their script may stop working. Given how PATH is ordered and that `ua` will still be available this risk should be low.

- Packaging changes: the only notable is handling PUBLIC_MACHINE_TOKEN_FILE in postinst. The logic looks good, I tested a couple of use cases and it worked fine.

Overall +1 from me, ready for the next review step!

review: Approve
69ddad0... by Renan Rodrigo

jobs: don't run the EOL job

At least temporarily, until we find out if it is feasible or if there is
a better solution.

Signed-off-by: Renan Rodrigo <email address hidden>

e540ca0... by Grant Orndorff

status: set contract check timeout lower to let status finish

Revision history for this message
Renan Rodrigo (renanrodrigo) wrote :

Paride, thanks for your review! The renaming to `pro` is indeed the task with most changes, mainly in messaging, and further iterations may come in the future. About the file name, we have now the open discussion with AAs to make sure we are doing it without too much risk.

Revision history for this message
Renan Rodrigo (renanrodrigo) wrote :

Robie, thanks for the comments as well. As we have been discussing, AAs should sign off in the SRU bug that this change is feasible. Besides that, the SRU bug has also been updated ([Discussion] section) to bring the known risks about the new /usr/bin/pro symlink, and it includes a topic about the expectation to not add more names in the future.

Revision history for this message
Renan Rodrigo (renanrodrigo) wrote :

Robie, a new commit has been added disabling the EOL-Check job, as discussed earlier.

Revision history for this message
Robie Basak (racb) wrote :

+1 for SRU. I reviewed up to commit 69ddad0, tree 31ab7922fa25bcae9b4954131d592a12ae3261ff.

Review comments:

Łukasz has signed off on the use of /usr/bin/pro, and Steve has indicated his agreement that it's OK privately. Risk and mitigations have been discussed in the SRU information in the bug. So +1 to proceed on that.

> - "From Ubuntu 20.04 and onwards 'ua enable cis' has been",
> - "replaced by 'ua enable usg'. See more information at:",
> + "From Ubuntu 20.04 and onwards 'pro enable cis' has been",
> + "replaced by 'pro enable usg'. See more information at:",

[a passing comment; not within the scope of my SRU review] Isn't this going to be confusing for a user who invokes "ua enable cis"?

[Already addressed] Commit 8a5091e introduces an entry in sources.list even if a user has not opted-in. This will cause an automated "apt-get update" to start failing for users who operate production services isolated from direct access to our public apt sources. On further discussion, apparently running the postinst after Bionic reaches standard support will do this as well, on the version of ubuntu-advantage-tools already in the archive. I understand this functionality has been disabled, but the existing code that will activate this behaviour in the postinst when Bionic reaches ESM remains. With the functionality disabled, this SRU is not touching the bug, and there's no requirement to block this SRU to fix a bug introduced in a previous SRU, so this is OK for now. However it does need fixing in a future SRU so I filed bug 1990378 to track that.

[Continue if you think it's OK; no need for re-review] Commit 767dfdc: maybe overreaching a little with all timers rather than just ua-tools ones? Are all files being sent definitely bounded in size (via logrotate or equivalent?) Otherwise free disk space might become an issue. Maybe apport itself has that issue too, but no reason to double it.

[Not a blocker for SRU] Commit bd095d4: IMHO, it's preferable to guard all upgrade path code with a test against the version being upgraded from. By doing this from the beginning, it's less risky to remove it in the future. One can simply confirm that no supported users remain on the old version because the guard ensures that newer users are not relying on its behaviour. Easier future cleanup helps minimise complexity in upgrade path code.

review: Approve (ubuntu-sru)
Revision history for this message
Renan Rodrigo (renanrodrigo) wrote :

About the CIS comment, the same would happen to help or CLI hints. We discussed that with Lech and got response that it is fine to have `pro` in the text, as it is the preferred name, even if the user calls `ua`. `ua` should be there just for the backwards compatibility, so people don't need to rush changing scripts and such.

Thanks for filing the APT/ESM bug!

About the logs:
- we do logrotate our logs
- the timers list won't add that much to the tarball size
I'm adding a task to revisit this in the future, but so far we think this is ok.

For the postinst change, we added the integration test for the expected controlled situation where the file would not exist - showing the buggy output, then reconfiguring, and seeing the correct output - and we can't really expect people to not be in old versions... This code will, unfortunately, be there until Jammy goes EOL :/

Revision history for this message
Robie Basak (racb) wrote :

On Wed, Sep 21, 2022 at 01:41:04PM -0000, Renan Rodrigo wrote:
> About the CIS comment, the same would happen to help or CLI hints. We discussed that with Lech and got response that it is fine to have `pro` in the text, as it is the preferred name, even if the user calls `ua`. `ua` should be there just for the backwards compatibility, so people don't need to rush changing scripts and such.

Sure - entirely up to you and Lech as to what's acceptable to you.

> About the logs:
> - we do logrotate our logs
> - the timers list won't add that much to the tarball size
> I'm adding a task to revisit this in the future, but so far we think this is ok.

Some users might see this as outside the scope of debugging ua-tools
though, and therefore a privacy leak. It's a really minor thing but one
that erodes trust. I think the boundary of what is gathered should be
limited to what can be justified as actually needed.

> For the postinst change, we added the integration test for the expected controlled situation where the file would not exist - showing the buggy output, then reconfiguring, and seeing the correct output - and we can't really expect people to not be in old versions... This code will, unfortunately, be there until Jammy goes EOL :/

Sure, but my point is that by that time nobody will remember the
details; it's easier to remove legacy upgrade path code if the code
itself is very obviously gated on an upgrade from an (at the time)
obsolete version. That saves developers at that time from having the
spend the time to ensure that removal won't have any side effect.

Revision history for this message
Renan Rodrigo (renanrodrigo) wrote :

> Some users might see this as outside the scope of debugging ua-tools
> though, and therefore a privacy leak. It's a really minor thing but one
> that erodes trust. I think the boundary of what is gathered should be
> limited to what can be justified as actually needed.

We have a card there to revisit this in the future, and in further releases we can remove what is essentially not needed.

> Sure, but my point is that by that time nobody will remember the
> details; it's easier to remove legacy upgrade path code if the code
> itself is very obviously gated on an upgrade from an (at the time)
> obsolete version. That saves developers at that time from having the
> spend the time to ensure that removal won't have any side effect.

To best effort we can add a comment there stating in which version the change happened.

Revision history for this message
Renan Rodrigo (renanrodrigo) wrote :

This has been merged with a commit matching the same as HEAD from this changeset

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.github/workflows/ci-integration.yaml b/.github/workflows/ci-integration.yaml
2index 972eeeb..fa698df 100644
3--- a/.github/workflows/ci-integration.yaml
4+++ b/.github/workflows/ci-integration.yaml
5@@ -24,10 +24,10 @@ jobs:
6 name: Packaging
7 needs: check-secrets
8 if: ${{ needs.check-secrets.outputs.has-secrets == 'true' }}
9- runs-on: ubuntu-20.04
10+ runs-on: ubuntu-22.04
11 strategy:
12 matrix:
13- release: ['xenial', 'bionic', 'focal', 'jammy']
14+ release: ['xenial', 'bionic', 'focal', 'jammy', 'kinetic']
15 steps:
16 - name: Prepare build tools
17 env:
18@@ -41,6 +41,9 @@ jobs:
19 - name: Git checkout
20 uses: actions/checkout@v2
21 - name: Build package
22+ env:
23+ DEBFULLNAME: GitHub CI Auto Builder
24+ DEBEMAIL: nobody@nowhere.invalid
25 run: |
26 gbp dch --ignore-branch --snapshot --distribution=${{ matrix.release }}
27 dch --local=~${{ matrix.release }} ""
28@@ -69,6 +72,8 @@ jobs:
29 platform: awspro
30 - release: bionic
31 platform: gcppro
32+ - release: bionic
33+ platform: awspro-fips
34 steps:
35 - name: Prepare test tools
36 run: |
37@@ -99,7 +104,7 @@ jobs:
38 UACLIENT_BEHAVE_DEBS_PATH: '${{ runner.temp }}'
39 UACLIENT_BEHAVE_ARTIFACT_DIR: '${{ runner.temp }}/artifacts/behave-${{ matrix.platform }}-${{ matrix.release }}'
40 UACLIENT_BEHAVE_SNAPSHOT_STRATEGY: '1'
41- UACLIENT_BEHAVE_BUILD_PR: '1'
42+ UACLIENT_BEHAVE_INSTALL_FROM: 'local'
43 UACLIENT_BEHAVE_CONTRACT_TOKEN: '${{ secrets.UACLIENT_BEHAVE_CONTRACT_TOKEN }}'
44 UACLIENT_BEHAVE_CONTRACT_TOKEN_STAGING: '${{ secrets.UACLIENT_BEHAVE_CONTRACT_TOKEN_STAGING }}'
45 UACLIENT_BEHAVE_CONTRACT_TOKEN_STAGING_EXPIRED: '${{ secrets.UACLIENT_BEHAVE_CONTRACT_TOKEN_STAGING_EXPIRED }}'
46diff --git a/.github/workflows/cla-check.yaml b/.github/workflows/cla-check.yaml
47new file mode 100644
48index 0000000..67923a7
49--- /dev/null
50+++ b/.github/workflows/cla-check.yaml
51@@ -0,0 +1,12 @@
52+---
53+
54+name: cla-check
55+
56+on: [pull_request_target]
57+
58+jobs:
59+ cla-check:
60+ runs-on: ubuntu-latest
61+ steps:
62+ - name: Check if CLA signed
63+ uses: canonical/has-signed-canonical-cla@v1
64diff --git a/.readthedocs.yaml b/.readthedocs.yaml
65new file mode 100644
66index 0000000..5090ca0
67--- /dev/null
68+++ b/.readthedocs.yaml
69@@ -0,0 +1,14 @@
70+version: 2
71+
72+sphinx:
73+ configuration: docs/conf.py
74+
75+build:
76+ os: ubuntu-22.04
77+ tools:
78+ python: "3.10"
79+
80+python:
81+ install:
82+ - requirements: docs-requirements.txt
83+ - requirements: requirements.txt
84diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
85index 229cf47..724e330 100644
86--- a/CONTRIBUTING.md
87+++ b/CONTRIBUTING.md
88@@ -11,6 +11,8 @@ from the architecture of the project to how you should test any code changes.
89 * [How to run the code formatting tools](./dev-docs/howtoguides/code_formatting.md)
90 * [How to run the tests](./dev-docs/howtoguides/testing.md)
91 * [How to release a new version of UA](./dev-docs/howtoguides/how_to_release_a_new_version_of_ua.md)
92+* [How to use the contract staging environment](./dev-docs/howtoguides/use_staging_environment.md)
93+* [How to use the magic attach endpoints](./dev-docs/howtoguides/how_to_use_magic_attach_endpoints.md)
94
95 ### Reference
96
97@@ -26,3 +28,7 @@ from the architecture of the project to how you should test any code changes.
98 * [Directory layout](./dev-docs/references/directory_layout.md)
99 * [Daily Builds](./dev-docs/references/daily_builds.md)
100 * [Version String Formatting](./contributing-docs/references/version_string_formatting.md)
101+
102+### Explanation
103+
104+* [How auto-attach works](./dev-docs/explanations/how_auto_attach_works.md)
105diff --git a/Makefile b/Makefile
106index d5ca5c8..a08c890 100644
107--- a/Makefile
108+++ b/Makefile
109@@ -8,6 +8,7 @@ clean:
110 rm -f *.build *.buildinfo *.changes .coverage *.deb *.dsc *.tar.gz *.tar.xz
111 rm -f azure-*-uaclient-ci-* ec2-uaclient-ci-* gcp-*-uaclient-ci-* lxd-container-*-uaclient-ci-* lxd-virtual-machine-*-uaclient-ci-*
112 rm -rf *.egg-info/ .tox/ .cache/ .mypy_cache/
113+ rm -rf docs/build/
114 find . -type f -name '*.pyc' -delete
115 find . -type d -name '*__pycache__' -delete
116 $(MAKE) -C apt-hook clean
117diff --git a/README.md b/README.md
118index ca80474..866f7bd 100644
119--- a/README.md
120+++ b/README.md
121@@ -15,7 +15,7 @@
122 ![Released Focal Version](https://img.shields.io/ubuntu/v/ubuntu-advantage-tools/focal?label=Focal&logo=ubuntu&logoColor=white)
123 ![Released Jammy Version](https://img.shields.io/ubuntu/v/ubuntu-advantage-tools/jammy?label=Jammy&logo=ubuntu&logoColor=white)
124
125-The Ubuntu Advantage (UA) Client is the offical tool to enable Canonical offerings on your
126+The Ubuntu Advantage (UA) Client is the official tool to enable Canonical offerings on your
127 system.
128
129 UA provides support to view, enable, and disable the following Canonical services:
130@@ -23,8 +23,8 @@ UA provides support to view, enable, and disable the following Canonical service
131 - [Common Criteria EAL2 Certification Tooling](https://ubuntu.com/security/cc)
132 - [CIS Benchmark Audit Tooling](https://ubuntu.com/security/cis)
133 - [Ubuntu Security Guide (USG) Tooling](https://ubuntu.com/security/certifications/docs/usg)
134-- [Ubuntu Extended Security Maintenance (ESM)](https://ubuntu.com/security/esm)
135-- [Robot Operating System (ROS) Extended Security Maintenance](https://ubuntu.com/robotics/ros-esm)
136+- [Ubuntu Expanded Security Maintenance (ESM)](https://ubuntu.com/security/esm)
137+- [Robot Operating System (ROS) Expanded Security Maintenance](https://ubuntu.com/robotics/ros-esm)
138 - [FIPS 140-2 Certified Modules (and optional non-certified patches)](https://ubuntu.com/security/fips)
139 - [Livepatch Service](https://ubuntu.com/security/livepatch)
140
141@@ -36,44 +36,45 @@ Furthermore, UA is already installed on every Ubuntu system. Try it out by runni
142
143 ### Tutorials
144
145-* [Getting started with UA](./docs/tutorials/basic_ua_commands.md)
146-* [Create a FIPS compliant Ubuntu Docker image](./docs/tutorials/create_a_fips_docker_image.md)
147-* [Fixing vulnerabilities by CVE or USN using `ua fix`](./docs/tutorials/ua_fix_scenarios.md)
148+* [Getting started with UA](./docs/source/tutorials/basic_ua_commands.md)
149+* [Create a FIPS compliant Ubuntu Docker image](./docs/source/tutorials/create_a_fips_docker_image.md)
150+* [Fixing vulnerabilities by CVE or USN using `ua fix`](./docs/source/tutorials/ua_fix_scenarios.md)
151+* [Create a Custom Ubuntu Pro Cloud Image with FIPS Updates](./docs/source/tutorials/create_a_fips_updates_pro_cloud_image.md)
152
153 ### How To Guides
154
155-* [How to get an UA token and attach to a subscription](./docs/howtoguides/get_token_and_attach.md)
156-* [How to Configure Proxies](./docs/howtoguides/configure_proxies.md)
157-* [How to Enable Ubuntu Advantage Services in a Dockerfile](./docs/howtoguides/enable_ua_in_dockerfile.md)
158-* [How to Create a custom Golden Image based on Ubuntu Pro](./docs/howtoguides/create_pro_golden_image.md)
159-* [How to Manually update MOTD and APT messages](./docs/howtoguides/update_motd_messages.md)
160-* [How to enable CIS](./docs/howtoguides/enable_cis.md)
161-* [How to enable CC EAL](./docs/howtoguides/enable_cc.md)
162-* [How to enable ESM Infra](./docs/howtoguides/enable_esm_infra.md)
163-* [How to enable FIPS](./docs/howtoguides/enable_fips.md)
164-* [How to enable Livepatch](./docs/howtoguides/enable_livepatch.md)
165-* [How to configure a timer job](./docs/howtoguides/configuring_timer_jobs.md)
166-* [How to attach with a configuration file](./docs/howtoguides/how_to_attach_with_config_file.md)
167-* [How to collect UA logs](./docs/howtoguides/how_to_collect_ua_logs.md)
168-* [How to Simulate attach operation](./docs/howtoguides/how_to_simulate_attach.md)
169-* [How to run ua fix in dry-run mode](./docs/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md)
170+* [How to get an UA token and attach to a subscription](./docs/source/howtoguides/get_token_and_attach.md)
171+* [How to Configure Proxies](./docs/howtoguides/source/configure_proxies.md)
172+* [How to Enable Ubuntu Advantage Services in a Dockerfile](./docs/source/howtoguides/enable_ua_in_dockerfile.md)
173+* [How to Create a custom Golden Image based on Ubuntu Pro](./docs/source/howtoguides/create_pro_golden_image.md)
174+* [How to Manually update MOTD and APT messages](./docs/source/howtoguides/update_motd_messages.md)
175+* [How to enable CIS](./docs/source/howtoguides/enable_cis.md)
176+* [How to enable CC EAL](./docs/source/howtoguides/enable_cc.md)
177+* [How to enable ESM Infra](./docs/source/howtoguides/enable_esm_infra.md)
178+* [How to enable FIPS](./docs/source/howtoguides/enable_fips.md)
179+* [How to enable Livepatch](./docs/source/howtoguides/enable_livepatch.md)
180+* [How to configure a timer job](./docs/source/howtoguides/configuring_timer_jobs.md)
181+* [How to attach with a configuration file](./docs/source/howtoguides/how_to_attach_with_config_file.md)
182+* [How to collect UA logs](./docs/source/howtoguides/how_to_collect_ua_logs.md)
183+* [How to Simulate attach operation](./docs/source/howtoguides/how_to_simulate_attach.md)
184+* [How to run ua fix in dry-run mode](./docs/source/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md)
185
186 ### Reference
187
188-* [Ubuntu Release and Architecture Support Matrix](./docs/references/support_matrix.md)
189-* [UA Network Requirements](./docs/references/network_requirements.md)
190-* [PPAs with different versions of `ua`](./docs/references/ppas.md)
191+* [Ubuntu Release and Architecture Support Matrix](./docs/source/references/support_matrix.md)
192+* [UA Network Requirements](./docs/source/references/network_requirements.md)
193+* [PPAs with different versions of `ua`](./docs/source/references/ppas.md)
194
195 ### Explanation
196
197-* [What is the daemon for? (And how to disable it)](./docs/explanations/what_is_the_daemon.md)
198-* [What is Ubuntu PRO?](./docs/explanations/what_is_ubuntu_pro.md)
199-* [What is the ubuntu-advantage-pro package?](./docs/explanations/what_is_the_ubuntu_advantage_pro_package.md)
200-* [What are the timer jobs?](./docs/explanations/what_are_the_timer_jobs.md)
201-* [What are the UA related MOTD messages?](./docs/explanations/motd_messages.md)
202-* [What are the UA related APT messages?](./docs/explanations/apt_messages.md)
203-* [How to interpret the security-status command](./docs/explanations/how_to_interpret_the_security_status_command.md)
204-* [Why Trusty (14.04) is no longer supported](./docs/explanations/why_trusty_is_no_longer_supported.md)
205+* [What is the daemon for? (And how to disable it)](./docs/source/explanations/what_is_the_daemon.md)
206+* [What is Ubuntu PRO?](./docs/source/explanations/what_is_ubuntu_pro.md)
207+* [What is the ubuntu-advantage-pro package?](./docs/source/explanations/what_is_the_ubuntu_advantage_pro_package.md)
208+* [What are the timer jobs?](./docs/source/explanations/what_are_the_timer_jobs.md)
209+* [What are the UA related MOTD messages?](./docs/source/explanations/motd_messages.md)
210+* [What are the UA related APT messages?](./docs/source/explanations/apt_messages.md)
211+* [How to interpret the security-status command](./docs/source/explanations/how_to_interpret_the_security_status_command.md)
212+* [Why Trusty (14.04) is no longer supported](./docs/source/explanations/why_trusty_is_no_longer_supported.md)
213
214 ## Project and community
215
216diff --git a/apport/source_ubuntu-advantage-tools.py b/apport/source_ubuntu-advantage-tools.py
217new file mode 100644
218index 0000000..193d557
219--- /dev/null
220+++ b/apport/source_ubuntu-advantage-tools.py
221@@ -0,0 +1,29 @@
222+import os
223+import tempfile
224+
225+from apport.hookutils import attach_file_if_exists
226+from uaclient.actions import collect_logs
227+from uaclient.config import UAConfig
228+
229+
230+def add_info(report, ui=None):
231+ report["LaunchpadPrivate"] = "1"
232+ report["LaunchpadSubscribe"] = "ua-client"
233+ cfg = UAConfig()
234+ with tempfile.TemporaryDirectory() as output_dir:
235+ collect_logs(cfg, output_dir)
236+ auto_include_log_files = [
237+ "cloud-id.txt",
238+ "cloud-id.txt-error",
239+ "ua-status.json",
240+ "ua-status.json-error",
241+ "livepatch-status.txt",
242+ "livepatch-status.txt-error",
243+ os.path.basename(cfg.cfg_path),
244+ os.path.basename(cfg.log_file),
245+ os.path.basename(cfg.timer_log_file),
246+ os.path.basename(cfg.daemon_log_file),
247+ os.path.basename(cfg.data_path("jobs-status")),
248+ ]
249+ for f in auto_include_log_files:
250+ attach_file_if_exists(report, os.path.join(output_dir, f), key=f)
251diff --git a/apt-hook/hook.cc b/apt-hook/hook.cc
252index f0589d2..156e1c3 100644
253--- a/apt-hook/hook.cc
254+++ b/apt-hook/hook.cc
255@@ -50,7 +50,6 @@
256 #define APT_PRE_INVOKE_INFRA_PKGS_TEMPLATE_PATH "/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra.tmpl"
257 #define APT_PRE_INVOKE_INFRA_PKGS_STATIC_PATH "/var/lib/ubuntu-advantage/messages/apt-pre-invoke-packages-infra"
258 #define APT_PRE_INVOKE_MESSAGE_STATIC_PATH "/var/lib/ubuntu-advantage/messages/apt-pre-invoke-esm-service-status"
259-#define UBUNTU_NO_WARRANTY_STATIC_PATH "/var/lib/ubuntu-advantage/messages/ubuntu-no-warranty"
260
261
262 #define ESM_APPS_PKGS_COUNT_TEMPLATE_VAR "{ESM_APPS_PKG_COUNT}"
263@@ -273,15 +272,13 @@ static void process_all_templates(
264 APT_PRE_INVOKE_INFRA_PKGS_STATIC_PATH,
265 MOTD_INFRA_PKGS_STATIC_PATH,
266 };
267- std::array<std::string, 3> apt_static_files = {
268+ std::array<std::string, 2> apt_static_files = {
269 APT_PRE_INVOKE_APPS_PKGS_STATIC_PATH,
270 APT_PRE_INVOKE_INFRA_PKGS_STATIC_PATH,
271- UBUNTU_NO_WARRANTY_STATIC_PATH
272 };
273- std::array<std::string, 3> motd_static_files = {
274+ std::array<std::string, 2> motd_static_files = {
275 MOTD_APPS_PKGS_STATIC_PATH,
276 MOTD_INFRA_PKGS_STATIC_PATH,
277- UBUNTU_NO_WARRANTY_STATIC_PATH
278 };
279
280 std::vector<std::string> template_file_names;
281@@ -315,7 +312,6 @@ static void process_all_templates(
282 for (uint i = 0; i < apt_static_files.size(); i++) {
283 std::ifstream message_file(apt_static_files[i]);
284 if (message_file.is_open()) {
285- apt_pre_invoke_msg << std::endl;
286 apt_pre_invoke_msg << message_file.rdbuf();
287 message_file.close();
288 };
289diff --git a/apt-hook/json-hook.cc b/apt-hook/json-hook.cc
290index 20946e5..0efaa81 100644
291--- a/apt-hook/json-hook.cc
292+++ b/apt-hook/json-hook.cc
293@@ -147,7 +147,6 @@ bool count_security_packages_from_apt_stats_json(json_object *stats, security_pa
294
295 std::string create_count_message(security_package_counts &counts) {
296 std::vector<std::string> count_msgs;
297- bool wrote_security = false;
298
299 if (counts.standard + counts.esm_infra + counts.esm_apps == 0) {
300 return "";
301@@ -155,32 +154,24 @@ std::string create_count_message(security_package_counts &counts) {
302
303 if (counts.standard > 0) {
304 std::stringstream ss;
305- ss << counts.standard << " standard security update";
306+ ss << counts.standard << " standard LTS security update";
307 if (counts.standard != 1) {
308 ss << "s";
309 }
310 count_msgs.push_back(ss.str());
311- wrote_security = true;
312 }
313 if (counts.esm_infra > 0) {
314 std::stringstream ss;
315- ss << counts.esm_infra << " esm-infra ";
316- if (!wrote_security) {
317- ss << "security ";
318- }
319+ ss << counts.esm_infra << " esm-infra security ";
320 ss << "update";
321 if (counts.esm_infra != 1) {
322 ss << "s";
323 }
324 count_msgs.push_back(ss.str());
325- wrote_security = true;
326 }
327 if (counts.esm_apps > 0) {
328 std::stringstream ss;
329- ss << counts.esm_apps << " esm-apps ";
330- if (!wrote_security) {
331- ss << "security ";
332- }
333+ ss << counts.esm_apps << " esm-apps security ";
334 ss << "update";
335 if (counts.esm_apps != 1) {
336 ss << "s";
337diff --git a/apt-hook/json-hook.test.cc b/apt-hook/json-hook.test.cc
338index 8df9738..eeeca37 100644
339--- a/apt-hook/json-hook.test.cc
340+++ b/apt-hook/json-hook.test.cc
341@@ -21,29 +21,29 @@ BOOST_AUTO_TEST_CASE(Test1) { count_message_test(0, 0, 0, ""); }
342 BOOST_AUTO_TEST_CASE(Test2) { count_message_test(0, 0, 1, "1 esm-apps security update"); }
343 BOOST_AUTO_TEST_CASE(Test3) { count_message_test(0, 0, 2, "2 esm-apps security updates"); }
344 BOOST_AUTO_TEST_CASE(Test4) { count_message_test(0, 1, 0, "1 esm-infra security update"); }
345-BOOST_AUTO_TEST_CASE(Test5) { count_message_test(0, 1, 1, "1 esm-infra security update and 1 esm-apps update"); }
346-BOOST_AUTO_TEST_CASE(Test6) { count_message_test(0, 1, 2, "1 esm-infra security update and 2 esm-apps updates"); }
347+BOOST_AUTO_TEST_CASE(Test5) { count_message_test(0, 1, 1, "1 esm-infra security update and 1 esm-apps security update"); }
348+BOOST_AUTO_TEST_CASE(Test6) { count_message_test(0, 1, 2, "1 esm-infra security update and 2 esm-apps security updates"); }
349 BOOST_AUTO_TEST_CASE(Test7) { count_message_test(0, 2, 0, "2 esm-infra security updates"); }
350-BOOST_AUTO_TEST_CASE(Test8) { count_message_test(0, 2, 1, "2 esm-infra security updates and 1 esm-apps update"); }
351-BOOST_AUTO_TEST_CASE(Test9) { count_message_test(0, 2, 2, "2 esm-infra security updates and 2 esm-apps updates"); }
352-BOOST_AUTO_TEST_CASE(Test10) { count_message_test(1, 0, 0, "1 standard security update"); }
353-BOOST_AUTO_TEST_CASE(Test11) { count_message_test(1, 0, 1, "1 standard security update and 1 esm-apps update"); }
354-BOOST_AUTO_TEST_CASE(Test12) { count_message_test(1, 0, 2, "1 standard security update and 2 esm-apps updates"); }
355-BOOST_AUTO_TEST_CASE(Test13) { count_message_test(1, 1, 0, "1 standard security update and 1 esm-infra update"); }
356-BOOST_AUTO_TEST_CASE(Test14) { count_message_test(1, 1, 1, "1 standard security update, 1 esm-infra update and 1 esm-apps update"); }
357-BOOST_AUTO_TEST_CASE(Test15) { count_message_test(1, 1, 2, "1 standard security update, 1 esm-infra update and 2 esm-apps updates"); }
358-BOOST_AUTO_TEST_CASE(Test16) { count_message_test(1, 2, 0, "1 standard security update and 2 esm-infra updates"); }
359-BOOST_AUTO_TEST_CASE(Test17) { count_message_test(1, 2, 1, "1 standard security update, 2 esm-infra updates and 1 esm-apps update"); }
360-BOOST_AUTO_TEST_CASE(Test18) { count_message_test(1, 2, 2, "1 standard security update, 2 esm-infra updates and 2 esm-apps updates"); }
361-BOOST_AUTO_TEST_CASE(Test19) { count_message_test(2, 0, 0, "2 standard security updates"); }
362-BOOST_AUTO_TEST_CASE(Test20) { count_message_test(2, 0, 1, "2 standard security updates and 1 esm-apps update"); }
363-BOOST_AUTO_TEST_CASE(Test21) { count_message_test(2, 0, 2, "2 standard security updates and 2 esm-apps updates"); }
364-BOOST_AUTO_TEST_CASE(Test22) { count_message_test(2, 1, 0, "2 standard security updates and 1 esm-infra update"); }
365-BOOST_AUTO_TEST_CASE(Test23) { count_message_test(2, 1, 1, "2 standard security updates, 1 esm-infra update and 1 esm-apps update"); }
366-BOOST_AUTO_TEST_CASE(Test24) { count_message_test(2, 1, 2, "2 standard security updates, 1 esm-infra update and 2 esm-apps updates"); }
367-BOOST_AUTO_TEST_CASE(Test25) { count_message_test(2, 2, 0, "2 standard security updates and 2 esm-infra updates"); }
368-BOOST_AUTO_TEST_CASE(Test26) { count_message_test(2, 2, 1, "2 standard security updates, 2 esm-infra updates and 1 esm-apps update"); }
369-BOOST_AUTO_TEST_CASE(Test27) { count_message_test(2, 2, 2, "2 standard security updates, 2 esm-infra updates and 2 esm-apps updates"); }
370+BOOST_AUTO_TEST_CASE(Test8) { count_message_test(0, 2, 1, "2 esm-infra security updates and 1 esm-apps security update"); }
371+BOOST_AUTO_TEST_CASE(Test9) { count_message_test(0, 2, 2, "2 esm-infra security updates and 2 esm-apps security updates"); }
372+BOOST_AUTO_TEST_CASE(Test10) { count_message_test(1, 0, 0, "1 standard LTS security update"); }
373+BOOST_AUTO_TEST_CASE(Test11) { count_message_test(1, 0, 1, "1 standard LTS security update and 1 esm-apps security update"); }
374+BOOST_AUTO_TEST_CASE(Test12) { count_message_test(1, 0, 2, "1 standard LTS security update and 2 esm-apps security updates"); }
375+BOOST_AUTO_TEST_CASE(Test13) { count_message_test(1, 1, 0, "1 standard LTS security update and 1 esm-infra security update"); }
376+BOOST_AUTO_TEST_CASE(Test14) { count_message_test(1, 1, 1, "1 standard LTS security update, 1 esm-infra security update and 1 esm-apps security update"); }
377+BOOST_AUTO_TEST_CASE(Test15) { count_message_test(1, 1, 2, "1 standard LTS security update, 1 esm-infra security update and 2 esm-apps security updates"); }
378+BOOST_AUTO_TEST_CASE(Test16) { count_message_test(1, 2, 0, "1 standard LTS security update and 2 esm-infra security updates"); }
379+BOOST_AUTO_TEST_CASE(Test17) { count_message_test(1, 2, 1, "1 standard LTS security update, 2 esm-infra security updates and 1 esm-apps security update"); }
380+BOOST_AUTO_TEST_CASE(Test18) { count_message_test(1, 2, 2, "1 standard LTS security update, 2 esm-infra security updates and 2 esm-apps security updates"); }
381+BOOST_AUTO_TEST_CASE(Test19) { count_message_test(2, 0, 0, "2 standard LTS security updates"); }
382+BOOST_AUTO_TEST_CASE(Test20) { count_message_test(2, 0, 1, "2 standard LTS security updates and 1 esm-apps security update"); }
383+BOOST_AUTO_TEST_CASE(Test21) { count_message_test(2, 0, 2, "2 standard LTS security updates and 2 esm-apps security updates"); }
384+BOOST_AUTO_TEST_CASE(Test22) { count_message_test(2, 1, 0, "2 standard LTS security updates and 1 esm-infra security update"); }
385+BOOST_AUTO_TEST_CASE(Test23) { count_message_test(2, 1, 1, "2 standard LTS security updates, 1 esm-infra security update and 1 esm-apps security update"); }
386+BOOST_AUTO_TEST_CASE(Test24) { count_message_test(2, 1, 2, "2 standard LTS security updates, 1 esm-infra security update and 2 esm-apps security updates"); }
387+BOOST_AUTO_TEST_CASE(Test25) { count_message_test(2, 2, 0, "2 standard LTS security updates and 2 esm-infra security updates"); }
388+BOOST_AUTO_TEST_CASE(Test26) { count_message_test(2, 2, 1, "2 standard LTS security updates, 2 esm-infra security updates and 1 esm-apps security update"); }
389+BOOST_AUTO_TEST_CASE(Test27) { count_message_test(2, 2, 2, "2 standard LTS security updates, 2 esm-infra security updates and 2 esm-apps security updates"); }
390
391 BOOST_AUTO_TEST_SUITE_END()
392
393diff --git a/debian/changelog b/debian/changelog
394index 99e1d33..0d85b03 100644
395--- a/debian/changelog
396+++ b/debian/changelog
397@@ -1,3 +1,63 @@
398+ubuntu-advantage-tools (27.11~22.10.1) kinetic; urgency=medium
399+
400+ * d/control:
401+ - Update VCS references
402+ * d/links:
403+ - add usr/bin/pro as an alias to ubuntu-advantage
404+ * d/postinst:
405+ - include root_mode parameter when creating UAConfig instances
406+ - change calls to add_notice to notice_file.add
407+ - create public machine-token file if it does not exist
408+ * New upstream release 27.11 (LP: #1989279)
409+ - api:
410+ + new `pro api` command to access the public client API
411+ + 'version' endpoint returning version information
412+ + 'should auto attach' endpoint informing if a system should run
413+ auto-attach on startup
414+ + 'full auto attach' endpoint performing auto-attach
415+ + 'magic attach' endpoints for the Magic Attach flow
416+ - auto-attach:
417+ + better errors for invalid pro images (GH: #2180, #1833)
418+ + don't detach on already auto-attached instances
419+ + no-op when ubuntu-advantage information is present on cloud-init
420+ userdata
421+ + change systemd unit to run after cloud-config
422+ - cli:
423+ + cli: better error message on unrecognized flags (GH: #672)
424+ - collect-logs:
425+ + can now be executed as a non-root user
426+ + is executed automatically and result is appended when using apport to
427+ report a bug
428+ - docs: now formatted to be built with sphinx, and published in readthedocs
429+ - enable:
430+ + new access-only flag for usecases where auto-install is undesired
431+ + fix apt auth line replacement (LP: #1985863)
432+ - esm-apps: generally available as non-beta as part of Ubuntu Pro
433+ - fix: check if livepatch has already fixed a CVE before attempting a fix
434+ - jobs: new timer job to check if the release reached end of support
435+ - pro:
436+ + Ubuntu Pro is released as a product
437+ + make `pro` the recommended executable for the client
438+ + client, apt and motd messages updated/rewritten to show Pro
439+ information
440+ + base URL changed from /advantage to /pro
441+ + ESM services renamed as part of Pro
442+ - ros: released as a non-beta entitlement
443+ - security-status
444+ + does not require the --format flag anymore
445+ + human readable output added based on ubuntu-security-status
446+ + machine readable output contains CVEs fixed by Livepatch
447+ + package counts include all esm-infra and esm-apps repositories
448+ - status:
449+ + don't show unavailable services by default (GH: #2156, #2159)
450+ + expiry date formatted based on timezone (GH: #695)
451+ + non-root users get the current status instead of a cached version
452+ + --wait flag now working for non-root users
453+ - version: warn about new available versions of the client in CLI command
454+ output and API calls
455+
456+ -- Renan Rodrigo <renanrodrigo@canonical.com> Thu, 08 Sep 2022 18:02:55 -0300
457+
458 ubuntu-advantage-tools (27.10.1~22.10.1) kinetic; urgency=medium
459
460 * apt-hook: Fix missing import warning when compiling
461diff --git a/debian/control b/debian/control
462index c754ed1..2572d32 100644
463--- a/debian/control
464+++ b/debian/control
465@@ -26,8 +26,8 @@ Build-Depends: bash-completion,
466 python3-yaml
467 Standards-Version: 4.5.1
468 Homepage: https://ubuntu.com/advantage
469-Vcs-Git: https://github.com/CanonicalLtd/ubuntu-advantage-script.git
470-Vcs-Browser: https://github.com/CanonicalLtd/ubuntu-advantage-script
471+Vcs-Git: https://github.com/canonical/ubuntu-advantage-client.git
472+Vcs-Browser: https://github.com/canonical/ubuntu-advantage-client
473 Rules-Requires-Root: no
474
475 Package: ubuntu-advantage-tools
476diff --git a/debian/ubuntu-advantage-tools.links b/debian/ubuntu-advantage-tools.links
477index 7a4416e..dd31a08 100644
478--- a/debian/ubuntu-advantage-tools.links
479+++ b/debian/ubuntu-advantage-tools.links
480@@ -1,2 +1,4 @@
481 usr/bin/ubuntu-advantage usr/bin/ua
482+usr/bin/ubuntu-advantage usr/bin/pro
483 usr/share/man/man1/ubuntu-advantage.1 usr/share/man/man1/ua.1
484+usr/share/man/man1/ubuntu-advantage.1 usr/share/man/man1/pro.1
485diff --git a/debian/ubuntu-advantage-tools.postinst b/debian/ubuntu-advantage-tools.postinst
486index 2f26afc..4330448 100644
487--- a/debian/ubuntu-advantage-tools.postinst
488+++ b/debian/ubuntu-advantage-tools.postinst
489@@ -54,6 +54,9 @@ SYSTEMD_HELPER_ENABLED_WANTS_LINK="/var/lib/systemd/deb-systemd-helper-enabled/m
490 REBOOT_CMD_MARKER_FILE="/var/lib/ubuntu-advantage/marker-reboot-cmds-required"
491 OLD_LICENSE_CHECK_MARKER_FILE="/var/lib/ubuntu-advantage/marker-license-check"
492
493+MACHINE_TOKEN_FILE="/var/lib/ubuntu-advantage/private/machine-token.json"
494+PUBLIC_MACHINE_TOKEN_FILE="/var/lib/ubuntu-advantage/machine-token.json"
495+
496
497 # Rename apt config files for ua services removing ubuntu release names
498 redact_ubuntu_release_from_ua_apt_filenames() {
499@@ -118,7 +121,7 @@ check_service_is_beta() {
500 from uaclient.config import UAConfig
501 from uaclient.entitlements import entitlement_factory
502 try:
503- cfg = UAConfig()
504+ cfg = UAConfig(root_mode=True)
505 ent_cls = entitlement_factory(cfg=cfg, name='${service_name}')
506 allow_beta = cfg.features.get('allow_beta', False)
507 print(all([ent_cls.is_beta, not allow_beta]))
508@@ -245,8 +248,8 @@ add_notice() {
509 /usr/bin/python3 -c "
510 from uaclient.config import UAConfig
511 from uaclient.messages import ${msg_name}
512-cfg = UAConfig()
513-cfg.add_notice(label='', description=${msg_name})
514+cfg = UAConfig(root_mode=True)
515+cfg.notice_file.add(label='', description=${msg_name})
516 "
517 }
518
519@@ -368,6 +371,19 @@ remove_old_systemd_units() {
520 fi
521 }
522
523+create_public_machine_token_file() {
524+ # When we perform the write operation through
525+ # MachineTokenFile we already write the public
526+ # version of the machine-token file with all the
527+ # sensitive data removed.
528+ /usr/bin/python3 -c "
529+from uaclient.files import MachineTokenFile
530+machine_token_file = MachineTokenFile()
531+content = machine_token_file.read()
532+machine_token_file.write(content=content)
533+"
534+}
535+
536 case "$1" in
537 configure)
538 PREVIOUS_PKG_VER=$2
539@@ -439,6 +455,13 @@ case "$1" in
540 disable_new_timer_if_old_timer_already_disabled $PREVIOUS_PKG_VER
541 remove_old_systemd_units $PREVIOUS_PKG_VER
542 /usr/lib/ubuntu-advantage/cloud-id-shim.sh || true
543+
544+ # On old version of ubuntu-advantange-tools, we don't have a public
545+ # machine_token.json file on attached machines. Since the non-root
546+ # status now needs that file, we need to create it during the upgrade
547+ if [ -f $MACHINE_TOKEN_FILE ] && [ ! -f $PUBLIC_MACHINE_TOKEN_FILE ]; then
548+ create_public_machine_token_file
549+ fi
550 ;;
551 esac
552
553diff --git a/dev-docs/explanations/how_auto_attach_works.md b/dev-docs/explanations/how_auto_attach_works.md
554new file mode 100644
555index 0000000..3350c8d
556--- /dev/null
557+++ b/dev-docs/explanations/how_auto_attach_works.md
558@@ -0,0 +1,57 @@
559+# How auto-attach works
560+
561+The `pro auto-attach` command follows a specific flow on every **Ubuntu Pro** image:
562+
563+1. Identify which cloud the command is running on. This is achieved by running
564+ the `cloud-id` command provided by the [cloud-init](https://cloudinit.readthedocs.io/en/latest/)
565+ package. Currently, we only support the following clouds when
566+ running the command: AWS, Azure and GCP. The command will fail if performed on other
567+ cloud types.
568+
569+2. Fetch the cloud metadata. This metadata is a cryptographically signed json blob
570+ that provides the necessary information for the contract server to validate
571+ the machine and return a valid pro token. To fetch that metadata, every cloud
572+ provide a different endpoint to reach it:
573+
574+ * **AWS**: http://169.254.169.254/latest/dynamic/instance-identity/pkcs7
575+ * **Azure**: http://169.254.169.254/metadata/attested/document?api-version=2020-09-01
576+ * **GCP**: http://metadata/computeMetadata/v1/instance/service-accounts/default/identity
577+
578+> **Note**
579+> On some instances, like AWS, we can also use the IPv6 address to fetch the metadata
580+
581+3. Send this metadata json blob to the contract server at:
582+
583+ * https://contracts.canonical.com/v1/clouds/CLOUD-TYPE/token
584+
585+ Where CLOUD-TYPE is the cloud name we identified on step 1.
586+
587+ The contract server will verify if the metadata is signed correctly based on the cloud
588+ it is stored. Additionally, some other checks are performed to see if the metadata is valid.
589+ For example, the contract server checks the product id provided in the metadata is a
590+ valid product. If any problems is found on the metadata, the contract server will produce
591+ an error response.
592+
593+4. After the contract server validates the metadata, it returns a token that will be used
594+ to attach the machine to a pro subscription. To attach the machine we will reach the
595+ following contract server endpoint:
596+
597+ * https://contracts.canonical.com/v1/context/machines/token
598+
599+ We will pass the token provided on step 3 as header bearer token for this request
600+
601+5. The contract returns a json specification based on the provided token. This json
602+ contains all the directives the pro client needs to setup the machine and enable
603+ the necessary services the token is associated with.
604+
605+6. Disable the ubuntu-advantage [daemon](../explanations/what_is_the_daemon.md).
606+ If the machine is detached, this daemon will be started again.
607+
608+Additionally, you can disable the `pro auto-attach` command by adding
609+the following lines on your `uaclient.conf` configuration file, (by default located at
610+`/etc/ubuntu-advantage/uaclient.conf`):
611+
612+```bash
613+features:
614+ disable_auto_attach: true
615+```
616diff --git a/dev-docs/howtoguides/how_to_use_magic_attach_endpoints.md b/dev-docs/howtoguides/how_to_use_magic_attach_endpoints.md
617new file mode 100644
618index 0000000..9d30b28
619--- /dev/null
620+++ b/dev-docs/howtoguides/how_to_use_magic_attach_endpoints.md
621@@ -0,0 +1,168 @@
622+# How to use magic attach API endpoints
623+
624+> **Notice:**
625+> Minimum version: 27.11
626+
627+Th UA Client provides three distinct endpoints to make it easier to perform
628+the magic attach flow. They are:
629+
630+* u.pro.attach.magic.initiate.v1
631+* u.pro.attach.magic.wait.v1
632+* u.pro.attach.magic.revoke.v1
633+
634+We will explain how to use each endpoint and what is the expected output for each of them.
635+
636+## Initiate endpoint
637+
638+To start the magic attach flow, we need to create a token for it. The initiate endpoint
639+will perform exactly that. When you run:
640+
641+```console
642+$ ua api u.pro.attach.magic.initiate.v1
643+```
644+
645+It is expected for you to see the following json response:
646+
647+```json
648+{
649+ "_schema_version": "v1",
650+ "data": {
651+ "meta": {
652+ "environment_vars": []}
653+ },
654+ "attributes": {
655+ "expires": "EXPIRE_DATE",
656+ "expires_in": 10000,
657+ "token": "MAGIC_ATTACH_TOKEN",
658+ "user_code": "USER_CODE"
659+ }
660+ "type": "MagicAttachInitiate"
661+ },
662+ "errors": [],
663+ "result": "success",
664+ "version": "UA CLIENT VERSION",
665+ "warnings": []
666+}
667+```
668+
669+It is noteworthy here that the `attributes` contain both the `user_code` and `token`. The `user_code`
670+is the information that will be presented to the user, which it will make possible for the user
671+to validate the magic attach on the advantage portal. Additionally, the `token` information is required
672+for the other two API endpoints which will be described next.
673+
674+
675+## Wait endpoint
676+
677+After we initiate the magic attach procedure, the user must go to the advantage portal and validate
678+the `user_code` it received. Once that is done, a ua token will be generated for the user, allowing
679+the attach procedure to begin. The wait endpoint will wait for the user to perform all of those
680+steps on the advantage portal. To call it, use:
681+
682+```console
683+$ ua api u.pro.attach.magic.wait.v1 --args magic_token=MAGIC_ATTACH_TOKEN
684+```
685+
686+Note here that the command requires the `token` that was generated in the initiate step. This command
687+will block and poll the server until there are any updates for that token. If the
688+user successfully performed the necessary steps on the advantage portal, we should see the following
689+response:
690+
691+```json
692+{
693+ "_schema_version": "v1",
694+ "data": {
695+ "attributes": {
696+ "contract_id": "CONTRACT_ID",
697+ "contract_token": "CONTRACT_TOKEN",
698+ "expires": "EXPIRE_DATE",
699+ "expires_in": 10000,
700+ "token": "MAGIC_ATTACH_TOKEN",
701+ "user_code": "USER_CODE"
702+ }
703+ "type": "MagicAttachInitiate"
704+ },
705+ "errors": [],
706+ "result": "success",
707+ "version": "UA CLIENT VERSION",
708+ "warnings": []
709+}
710+```
711+
712+The `contract_token` is the token that can be used to perform an attach operation.
713+
714+If the provided token is invalid or has expired, we will see the following response:
715+
716+```json
717+{
718+ "_schema_version": "v1",
719+ "data": {
720+ "meta": {
721+ "environment_vars": []
722+ }
723+ },
724+ "errors": [
725+ {
726+ "code": "magic-attach-token-error",
727+ "meta": {},
728+ "title": "The magic attach token is invalid, has expired or never existed"
729+ }
730+ ],
731+ "result": "failure",
732+ "version": "UA CLIENT VERSION",
733+ "warnings": []
734+}
735+```
736+
737+It is expected that the token will be valid for about 10 minutes. Therefore, we expect the wait
738+command to keep polling for about that amount of time.
739+
740+
741+## Revoke
742+
743+If we want to revoke the token created during the initiate call, we can use the revoke command:
744+
745+```console
746+$ ua api u.pro.attach.magic.revoke.v1 --args magic_token=MAGIC_ATTACH_TOKEN
747+```
748+
749+If the token is valid, we should see the following output:
750+
751+```json
752+{
753+ "_schema_version": "v1",
754+ "data": {
755+ "attributes": {},
756+ "meta": {
757+ "environment_vars": []
758+ },
759+ "type": "MagicAttachRevoke"
760+ },
761+ "errors": [],
762+ "result": "success",
763+ "version": "PRO CLIENT VERSION",
764+ "warnings": []
765+}
766+```
767+
768+However, if the token is already expired or even invalid, we will see the following output:
769+
770+```json
771+{
772+ "_schema_version": "v1",
773+ "data": {
774+ "meta": {
775+ "environment_vars": []
776+ }
777+ },
778+ "errors": [
779+ {
780+ "code": "magic-attach-token-error",
781+ "meta": {},
782+ "title": "The magic attach token is invalid, has expired or never existed"
783+ }
784+ ],
785+ "result": "failure",
786+ "version": "PRO CLIENT VERSION",
787+ "warnings": []
788+}
789+```
790diff --git a/dev-docs/howtoguides/testing.md b/dev-docs/howtoguides/testing.md
791index 78791e6..d7c3cf3 100644
792--- a/dev-docs/howtoguides/testing.md
793+++ b/dev-docs/howtoguides/testing.md
794@@ -38,10 +38,18 @@ By default, integration tests will do the following on a given cloud platform:
795 * Install the appropriate ubuntu-advantage-tools and ubuntu-advantage-pro deb
796 * Run the integration tests on that instance.
797
798-The testing can be overridden to run using a local copy of the ubuntu-advantage-client source code instead of the daily PPA by providing the following environment variable to the behave test runner:
799-```UACLIENT_BEHAVE_BUILD_PR=1```
800+The testing can be overridden to install ubuntu-advantage-tools from other sources instead of the daily PPA by providing `UACLIENT_BEHAVE_INSTALL_FROM` to the behave test runner. The default is `UACLIENT_BEHAVE_INSTALL_FROM=daily`, and the other available options are:
801
802-> Note that, by default, we cache the source even when `UACLIENT_BEHAVE_BUILD_PR=1`. This means that if you change the python code locally and want to run the behave tests against your new version, you need to either delete the cache (`rm /tmp/uaclient_behave`) or also set `UACLIENT_BEHAVE_CACHE_SOURCE=0`.
803+- `staging`: install from the [staging PPA](https://code.launchpad.net/~ua-client/+archive/ubuntu/staging)
804+- `stable`: install from the [stable PPA](https://code.launchpad.net/~ua-client/+archive/ubuntu/stable)
805+- `archive`: install the latest version available in the archive, not adding any PPA
806+- `proposed`: install the package from the -proposed pocket - specially useful for SRU testing (see [the release guide](how_to_release_a_new_version_of_ua.md))
807+- `custom`: install from a custom provided PPA. If set, then two other variables need to be set: `UACLIENT_BEHAVE_CUSTOM_PPA=<PPA URL>` and `UACLIENT_BEHAVE_CUSTOM_PPA_KEYID=<signing key for the PPA>`.
808+- `local`: install from a local copy of the ubuntu-advantage-client source code
809+
810+`local` is particularly useful, as it runs the suite against the local code, thus including and validating the latest changes made. It is advised to run any related integration tests against local code changes before pushing them to be reviewed.
811+
812+> Note that we cache the source when running with `UACLIENT_BEHAVE_INSTALL_FROM=local` based on a hash, calculated from the repository state. If you change the python code locally and run the behave tests against your new version, there will be new debs in the cache source with the new repo state hash.
813
814 To run the tests, you can use `tox`:
815
816@@ -59,8 +67,8 @@ tox -e behave-lxd-20.04 features/unattached_commands.feature:55
817 As can be seen, this will run behave tests only for release 20.04 (Focal Fossa). We are currently
818 supporting 5 distinct releases:
819
820+* 21.10 (Kinetic Kudu)
821 * 22.04 (Jammy Jellyfish)
822-* 21.10 (Impish Indri)
823 * 20.04 (Focal Fossa)
824 * 18.04 (Bionic Beaver)
825 * 16.04 (Xenial Xerus)
826diff --git a/dev-docs/howtoguides/use_staging_environment.md b/dev-docs/howtoguides/use_staging_environment.md
827new file mode 100644
828index 0000000..b616fce
829--- /dev/null
830+++ b/dev-docs/howtoguides/use_staging_environment.md
831@@ -0,0 +1,13 @@
832+# Use the contracts staging environment
833+
834+You can change the contract server that the Pro Client will use by setting the
835+following option in your `uaclient.conf` configuration file, (by default located at
836+`/etc/ubuntu-advantage/uaclient.conf`).
837+
838+```yaml
839+contract_url: https://contracts.staging.canonical.com
840+```
841+
842+> **Note**
843+> You might be using a local `uaclient.conf` file when running the pro client.
844+> If that is the case, remember to change that file instead.
845diff --git a/dev-docs/references/directory_layout.md b/dev-docs/references/directory_layout.md
846index 4978673..69c9ee7 100644
847--- a/dev-docs/references/directory_layout.md
848+++ b/dev-docs/references/directory_layout.md
849@@ -17,4 +17,15 @@ The following describes the intent of UA client related directories:
850 | ./apt-conf.d/ | apt config files delivered to /etc/apt/apt-conf.d to automatically allow unattended upgrades of ESM security-related components. If apt proxy settings are configured, an additional apt config file will be placed here to configure the apt proxy. |
851 | /etc/ubuntu-advantage/uaclient.conf | Configuration file for the UA client.|
852 | /var/lib/ubuntu-advantage/private | `root` read-only directory containing Contract API responses, machine-tokens and service credentials |
853+| /var/lib/ubuntu-advantage/machine-token.json | `world` readable file containing redacted Contract API responses, machine-tokens and service credentials |
854 | /var/log/ubuntu-advantage.log | `root` read-only log of ubuntu-advantage operations |
855+
856+## Note
857+
858+We have two `machine-token.json` files, located at:
859+- /var/lib/ubuntu-advantage/private/machine-token.json
860+- /var/lib/ubuntu-advantage/machine-token.json
861+
862+The first file, located in the `private` directory, is root read-only. We have another world readable file in the `/var/lib/ubuntu-advantage` directory.
863+
864+The latter is currently being used when calling the `pro status` command as a non-root user. This file is redacted to remove any sensitive user data.
865diff --git a/dev-docs/references/what_happens_during_attach.md b/dev-docs/references/what_happens_during_attach.md
866index 232e033..ceb5221 100644
867--- a/dev-docs/references/what_happens_during_attach.md
868+++ b/dev-docs/references/what_happens_during_attach.md
869@@ -9,6 +9,7 @@ After running the command `ua attach TOKEN`, UA will perform the following steps
870 token, service credentials, affordances, directives and obligations to allow
871 enabling and disabling Ubuntu Advantage services
872 * UA client writes the machine token API response to the root-readonly
873- /var/lib/ubuntu-advantage/private/machine-token.json
874+ /var/lib/ubuntu-advantage/private/machine-token.json and a version with secrets redacted to the world-readable
875+ file /var/lib/ubuntu-advantage/machine-token.json.
876 * UA client auto-enables any services defined with
877 `obligations:{enableByDefault: true}`
878diff --git a/docs-requirements.txt b/docs-requirements.txt
879new file mode 100644
880index 0000000..b2a85a8
881--- /dev/null
882+++ b/docs-requirements.txt
883@@ -0,0 +1,4 @@
884+sphinx==5.1.1
885+m2r2
886+myst-parser
887+sphinx_rtd_theme
888diff --git a/docs/README.md b/docs/README.md
889new file mode 100644
890index 0000000..ccdc9e2
891--- /dev/null
892+++ b/docs/README.md
893@@ -0,0 +1,11 @@
894+# How to generate Ubuntu Advantage user documentation
895+
896+To build the docs for Ubuntu Advantage, you can use a dedicated `tox` command for it.
897+You can install `tox` on your machine by running the `make test` command. Once tox is
898+installed just run the command:
899+
900+```console
901+$ tox -e docs
902+```
903+
904+The command will generate the html pages inside `docs/build`
905diff --git a/docs/conf.py b/docs/conf.py
906new file mode 100644
907index 0000000..d90095e
908--- /dev/null
909+++ b/docs/conf.py
910@@ -0,0 +1,52 @@
911+# Configuration file for the Sphinx documentation builder.
912+#
913+# This file only contains a selection of the most common options. For a full
914+# list see the documentation:
915+# https://www.sphinx-doc.org/en/master/usage/configuration.html
916+
917+# -- Path setup --------------------------------------------------------------
918+
919+# If extensions (or modules to document with autodoc) are in another directory,
920+# add these directories to sys.path here. If the directory is relative to the
921+# documentation root, use os.path.abspath to make it absolute, like shown here.
922+#
923+# import os
924+# import sys
925+# sys.path.insert(0, os.path.abspath('.'))
926+
927+
928+# -- Project information -----------------------------------------------------
929+
930+project = "Ubuntu Advantage Client"
931+copyright = "2022, Canonical Ltd."
932+
933+
934+# -- General configuration ---------------------------------------------------
935+
936+# Add any Sphinx extension module names here, as strings. They can be
937+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
938+# ones.
939+extensions = [
940+ "myst_parser",
941+]
942+
943+# Add any paths that contain templates here, relative to this directory.
944+templates_path = ["_templates"]
945+
946+# List of patterns, relative to source directory, that match files and
947+# directories to ignore when looking for source files.
948+# This pattern also affects html_static_path and html_extra_path.
949+exclude_patterns = []
950+
951+
952+# -- Options for HTML output -------------------------------------------------
953+
954+# The theme to use for HTML and HTML Help pages. See the documentation for
955+# a list of builtin themes.
956+#
957+html_theme = "sphinx_rtd_theme"
958+
959+# Add any paths that contain custom static files (such as style sheets) here,
960+# relative to this directory. They are copied after the builtin static files,
961+# so a file named "default.css" will overwrite the builtin "default.css".
962+html_static_path = ["_static"]
963diff --git a/docs/explanations/apt_messages.md b/docs/explanations/apt_messages.md
964index 04ff1f1..dc9a0b8 100644
965--- a/docs/explanations/apt_messages.md
966+++ b/docs/explanations/apt_messages.md
967@@ -17,22 +17,17 @@ where we deliver those messages are:
968 The following package was automatically installed and is no longer required:
969 libfreetype6
970 Use 'apt autoremove' to remove it.
971-
972- *The following packages could receive security updates with UA Infra: ESM service enabled:
973- libpam0g libpam-modules openssl ntfs-3g git-man libsystemd0 squashfs-tools git
974- openssh-sftp-server udev libpam-runtime isc-dhcp-common libx11-6 libudev1 apport
975- python3-apport systemd-sysv liblz4-1 libpam-systemd systemd libpam-modules-bin openssh-server
976- libx11-data openssh-client libxml2 curl isc-dhcp-client python3-problem-report
977- libcurl3-gnutls libssl1.0.0
978- Learn more about UA Infra: ESM service for Ubuntu 16.04 at https://ubuntu.com/16-04
979+ The following security updates require Ubuntu Pro with 'esm-infra' enabled:
980+ libpam0g libpam-modules openssl ntfs-3g git-man libsystemd0 squashfs-tools git openssh-sftp-server udev libpam-runtime isc-dhcp-common libx11-6 libudev1 apport python3-apport systemd-sysv liblz4-1 libpam-systemd systemd libpam-modules-bin openssh-server libx11-data openssh-client libxml2 curl isc-dhcp-client python3-problem-report libcurl3-gnutls libssl1.0.0
981+ Learn more about Ubuntu Pro for 16.04 at https://ubuntu.com/16-04
982 ```
983
984 Note that the ESM message is located in the middle of the `apt-get` command output. Additionally,
985 if there are no packages to upgrade at the moment, we would instead deliver:
986
987 ```
988- Enable UA Infra: ESM to receive additional future security updates.
989- See https://ubuntu.com/16-04 or run: sudo ua status
990+ Receive additional future security updates with Ubuntu Pro.
991+ Learn more about Ubuntu Pro for 16.04 at https://ubuntu.com/16-04
992 ```
993
994 > **Note**
995@@ -42,46 +37,41 @@ where we deliver those messages are:
996 we deliver a package count related to each service near the end of the `apt-get` command:
997
998 ```
999- 1 standard security update, 29 esm-infra updates and 8 esm-apps updates
1000+ 1 standard LTS security update, 29 esm-infra security updates and 8 esm-apps security updates
1001 ```
1002
1003 We only deliver that message if the service is enabled and we did upgrade packages related
1004 to it. For example, if we had no `esm-infra` package upgrades, the message would be:
1005
1006 ```
1007- 1 standard security updates and 8 esm-apps updates
1008+ 1 standard LTS security update and 8 esm-apps security updates
1009 ```
1010
1011 * **expired contract**: If we detect that your contract is expired, we will deliver the following
1012 message advertising `esm-infra` in the middle of the `apt` command:
1013
1014 ```
1015- *Your UA Infra: ESM subscription has EXPIRED*
1016- Enabling UA Infra: ESM service would provide security updates for following packages:
1017- libpam0g libpam-modules openssl ntfs-3g git-man libsystemd0 squashfs-tools git
1018- openssh-sftp-server udev libpam-runtime isc-dhcp-common libx11-6 libudev1 apport python3-apport
1019- systemd-sysv liblz4-1 libpam-systemd systemd libpam-modules-bin openssh-server libx11-data
1020- openssh-client libxml2 curl isc-dhcp-client python3-problem-report libcurl3-gnutls libssl1.0.0
1021- 30 esm-infra security update(s) NOT APPLIED. Renew your UA services at
1022- https://ubuntu.com/advantage
1023+ *Your Ubuntu Pro subscription has EXPIRED*
1024+ The following security updates require Ubuntu Pro with 'esm-infra' enabled:
1025+ libpam0g libpam-modules openssl ntfs-3g git-man libsystemd0 squashfs-tools git openssh-sftp-server udev libpam-runtime isc-dhcp-common libx11-6 libudev1 apport python3-apport systemd-sysv liblz4-1 libpam-systemd systemd libpam-modules-bin openssh-server libx11-data openssh-client libxml2 curl isc-dhcp-client python3-problem-report libcurl3-gnutls libssl1.0.0
1026+ Renew your service at https://ubuntu.com/pro
1027 ```
1028
1029 Note that if we don't have any package to upgrade related to `esm-infra`, we would deliver instead
1030 the message:
1031
1032 ```
1033- *Your UA Infra: ESM subscription has EXPIRED*
1034- Enable UA Infra: ESM to receive additional future security updates.
1035- See https://ubuntu.com/advantage or run: sudo ua status
1036+ *Your Ubuntu Pro subscription has EXPIRED*
1037+ Renew your service at https://ubuntu.com/pro
1038 ```
1039
1040 * **contract is about to expire**: Similarly, if we detect that your contract is about to expire,
1041 we deliver the following message in the middle of the `apt-get` command:
1042
1043 ```
1044- CAUTION: Your UA Infra: ESM service will expire in 14 days.
1045- Renew UA subscription at https://ubuntu.com/advantage to ensure
1046- continued security coverage for your applications.
1047+ CAUTION: Your Ubuntu Pro subscription will expire in 2 days.
1048+ Renew your subscription at https://ubuntu.com/pro to ensure continued security
1049+ coverage for your applications.
1050 ```
1051
1052 * **contract expired, but in grace period**: Additionally, if we detect that the contract is
1053@@ -89,9 +79,9 @@ where we deliver those messages are:
1054 of the `apt-get` command:
1055
1056 ```
1057- CAUTION: Your UA Infra: ESM service expired on 10 Sep 2021.
1058- Renew UA subscription at https://ubuntu.com/advantage to ensure
1059- continued security coverage for your applications.
1060+ CAUTION: Your Ubuntu Pro subscription expired on 10 Sep 2021.
1061+ Renew your subscription at https://ubuntu.com/pro to ensure continued security
1062+ coverage for your applications.
1063 Your grace period will expire in 8 days.
1064 ```
1065
1066diff --git a/docs/explanations/how_to_interpret_the_security_status_command.md b/docs/explanations/how_to_interpret_the_security_status_command.md
1067index 2237245..9fd282d 100644
1068--- a/docs/explanations/how_to_interpret_the_security_status_command.md
1069+++ b/docs/explanations/how_to_interpret_the_security_status_command.md
1070@@ -36,6 +36,10 @@ packages:
1071 status: upgrade_available
1072 version: 1:1.2.8.dfsg-2ubuntu4.3+esm1
1073 download_size: 123456
1074+livepatch:
1075+ fixed_cves:
1076+ - Name: cve-2013-1798
1077+ Patched: true
1078 ```
1079
1080 Let's understand what each key mean on the output of the `ua security-status` command:
1081@@ -101,3 +105,6 @@ Let's understand what each key mean on the output of the `ua security-status` co
1082 the service which provides the upgrade.
1083 * **`version`**: The update version.
1084 * **`download_size`**: The number of bytes that would be downloaded in order to install the update.
1085+
1086+* **`livepatch`**: Livepatch related information. Currently, the only information
1087+presented is **`fixed_cves`** - a list of CVEs that were fixed by Livepatches applied to the kernel.
1088diff --git a/docs/explanations/motd_messages.md b/docs/explanations/motd_messages.md
1089index 56221bc..04a5f14 100644
1090--- a/docs/explanations/motd_messages.md
1091+++ b/docs/explanations/motd_messages.md
1092@@ -14,7 +14,7 @@ Those messages are generated directly by two different sources:
1093 those services are enabled:
1094
1095 ```
1096- UA Apps: Extended Security Maintenance (ESM) is enabled.
1097+ UA Apps: Expanded Security Maintenance (ESM) is enabled.
1098
1099 11 updates can be applied immediately.
1100 5 of these updates are UA Apps: ESM security updates.
1101@@ -27,7 +27,7 @@ Those messages are generated directly by two different sources:
1102 advertised:
1103
1104 ```
1105- UA Infra: Extended Security Maintenance (ESM) is enabled.
1106+ UA Infra: Expanded Security Maintenance (ESM) is enabled.
1107
1108 11 updates can be applied immediately.
1109 5 of these updates are UA Apps: ESM security updates.
1110@@ -40,7 +40,7 @@ Those messages are generated directly by two different sources:
1111 `esm-apps` was not enabled, the output will be:
1112
1113 ```
1114- UA Apps: Extended Security Maintenance (ESM) is not enabled.
1115+ UA Apps: Expanded Security Maintenance (ESM) is not enabled.
1116
1117 6 updates can be applied immediately.
1118 1 of these updates is a UA Infra: ESM security update.
1119@@ -66,21 +66,18 @@ Those messages are generated directly by two different sources:
1120 message after the `update-notifier` message:
1121
1122 ```
1123- *Your UA Infra: ESM subscription has EXPIRED*
1124-
1125- 2 additional security updates could have been applied via UA Apps: ESM.
1126- Renew your UA services at https://ubuntu.com/advantage
1127-
1128- Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
1129+ *Your Ubuntu Pro subscription has EXPIRED*
1130+ 2 additional security update(s) require Ubuntu Pro with 'esm-infra' enabled.
1131+ Renew your service at https://ubuntu.com/pro
1132 ```
1133
1134 * **subscription about to expire**: When the UA subscription is about to expire, we deliver the
1135 following message after the `update-notifier` message:
1136
1137 ```
1138- CAUTION: Your UA Infra: ESM service will expire in 5 days.
1139- Renew UA subscription at https://ubuntu.com/advantage to ensure
1140- continued security coverage for your applications.
1141+ CAUTION: Your Ubuntu Pro subscription will expire in 2 days.
1142+ Renew your subscription at https://ubuntu.com/pro to ensure continued security
1143+ coverage for your applications.
1144 ```
1145
1146 * **subscription expired but within grace period**: When the UA subscription is expired, but is
1147@@ -88,9 +85,9 @@ Those messages are generated directly by two different sources:
1148 script:
1149
1150 ```
1151- CAUTION: Your UA Infra: ESM service expired on 10 Sep 2021.
1152- Renew UA subscription at https://ubuntu.com/advantage to ensure
1153- continued security coverage for your applications.
1154+ CAUTION: Your Ubuntu Pro subscription expired on 10 Sep 2021.
1155+ Renew your subscription at https://ubuntu.com/pro to ensure continued security
1156+ coverage for your applications.
1157 Your grace period will expire in 9 days.
1158 ```
1159
1160@@ -99,9 +96,9 @@ Those messages are generated directly by two different sources:
1161 `update-notifier` message:
1162
1163 ```
1164- * Introducing Extended Security Maintenance for Applications.
1165- Receive updates to over 30,000 software packages with your
1166- Ubuntu Advantage subscription. Free for personal use
1167+ * Introducing Expanded Security Maintenance for Applications.
1168+ Receive updates to over 25,000 software packages with your
1169+ Ubuntu Pro subscription. Free for personal use
1170
1171 https://ubuntu.com/16-04
1172 ```
1173diff --git a/docs/explanations/status_columns.md b/docs/explanations/status_columns.md
1174index d6848fe..b09007f 100644
1175--- a/docs/explanations/status_columns.md
1176+++ b/docs/explanations/status_columns.md
1177@@ -7,7 +7,7 @@ When unattached, users will see the status table containing only three columns:
1178 SERVICE AVAILABLE DESCRIPTION
1179 cc-eal no Common Criteria EAL2 Provisioning Packages
1180 cis no Security compliance and audit tools
1181-esm-infra yes UA Infra: Extended Security Maintenance (ESM)
1182+esm-infra yes Expanded Security Maintenance for Infrastructure
1183 fips no NIST-certified core packages
1184 fips-updates no NIST-certified core packages with priority security updates
1185 livepatch yes Canonical Livepatch service
1186@@ -25,8 +25,7 @@ However, if we run the same command when attached, we have an output with 4 colu
1187 ```
1188 SERVICE ENTITLED STATUS DESCRIPTION
1189 cis yes disabled Center for Internet Security Audit Tools
1190-esm-apps yes enabled UA Apps: Extended Security Maintenance (ESM)
1191-esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM)
1192+esm-infra yes enabled Expanded Security Maintenance for Infrastructure
1193 fips yes n/a NIST-certified core packages
1194 fips-updates yes n/a NIST-certified core packages with priority security updates
1195 livepatch yes n/a Canonical Livepatch service
1196diff --git a/docs/explanations/what_are_the_timer_jobs.md b/docs/explanations/what_are_the_timer_jobs.md
1197index 4a818c7..348920a 100644
1198--- a/docs/explanations/what_are_the_timer_jobs.md
1199+++ b/docs/explanations/what_are_the_timer_jobs.md
1200@@ -20,4 +20,4 @@ packages or security updates.
1201 - The `update_status` job makes sure the `ua status` command will have the latest
1202 information even when executed by a non-root user, updating the
1203 `/var/lib/ubuntu-advantage/status.json` file.
1204-- The `metering` will inform Canonical on which services are enable on the machine.
1205+- The `metering` will inform Canonical on which services are enabled on the machine.
1206diff --git a/docs/howtoguides/create_pro_golden_image.md b/docs/howtoguides/create_pro_golden_image.md
1207index a5d297a..dc6b835 100644
1208--- a/docs/howtoguides/create_pro_golden_image.md
1209+++ b/docs/howtoguides/create_pro_golden_image.md
1210@@ -1,19 +1,9 @@
1211-# Remastering custom golden images based on Ubuntu PRO
1212+# How to create a customized Cloud Ubuntu Pro image
1213
1214-Vendors who wish to provide custom images based on Ubuntu PRO images can
1215-follow the procedure below:
1216-
1217-* Launch the Ubuntu PRO golden image
1218-* Customize your golden image as you see fit
1219-* If `ua status` shows attached, remove the UA artifacts to allow clean
1220- auto-attach on subsequent cloned VM launches
1221-```bash
1222-sudo ua detach
1223-sudo rm -rf /var/log/ubuntu-advantage.log # to remove credentials and tokens from logs
1224-```
1225-* Remove `cloud-init` first boot artifacts so the cloned VM boot is seen as a first boot
1226-```bash
1227-sudo cloud-init clean --logs
1228-sudo shutdown -h now
1229-```
1230+* Launch a Ubuntu Pro instance on your cloud of choice
1231+* Customize the instance as you see fit
1232+* `sudo rm /etc/machine-id`
1233 * Use your cloud platform to clone or snapshot this VM as a golden image
1234+
1235+> **Note**
1236+> Prior to version 27.11 - when launching instances based on this instance, you will need to re-enable any non-standard UA services that you enabled on the image. This will be faster on the new instance because it was already enabled on the image. You will not need to reboot for e.g. `fips` or `fips-updates`.
1237diff --git a/docs/howtoguides/enable_cc.md b/docs/howtoguides/enable_cc.md
1238index 02e46ff..23709f4 100644
1239--- a/docs/howtoguides/enable_cc.md
1240+++ b/docs/howtoguides/enable_cc.md
1241@@ -7,6 +7,8 @@ point releases.
1242 Common Criteria is supported only on 16.04 and 18.04. For more information on it,
1243 please see https://ubuntu.com/security/cc
1244
1245+## Enable and auto-install
1246+
1247 To enable it through UA, please run:
1248
1249 ```console
1250@@ -22,3 +24,29 @@ Installing CC EAL2 packages
1251 CC EAL2 enabled
1252 Please follow instructions in /usr/share/doc/ubuntu-commoncriteria/README to configure EAL2
1253 ```
1254+
1255+## Enable and manually install
1256+
1257+> **Note**
1258+> The --access-only flag is introduced in version 27.11
1259+
1260+If you would like to enable access to the CC EAL apt repository but not install the packages right away, use the `--access-only` flag while enabling.
1261+
1262+```console
1263+$ sudo ua enable cc-eal --access-only
1264+```
1265+
1266+With that extra flag you'll see output like the following:
1267+
1268+```
1269+One moment, checking your subscription first
1270+Updating package lists
1271+Skipping installing packages: ubuntu-commoncriteria
1272+CC EAL2 access enabled
1273+```
1274+
1275+To install the packages you can then run:
1276+
1277+```console
1278+$ sudo apt install ubuntu-commoncriteria
1279+```
1280diff --git a/docs/howtoguides/enable_realtime_kernel.md b/docs/howtoguides/enable_realtime_kernel.md
1281new file mode 100644
1282index 0000000..626513e
1283--- /dev/null
1284+++ b/docs/howtoguides/enable_realtime_kernel.md
1285@@ -0,0 +1,62 @@
1286+# How to enable Real-Time Kernel
1287+
1288+> **Warning**:
1289+> Real-Time Kernel is currently in beta.
1290+
1291+Real-Time Kernel is supported only on 22.04. For more information on it,
1292+please see https://ubuntu.com/realtime-kernel
1293+
1294+## Enable and auto-install
1295+
1296+To enable it through UA, please run:
1297+
1298+```console
1299+$ sudo ua enable realtime-kernel --beta
1300+```
1301+
1302+You'll need to acknowledge a warning and then you should see output like the following, indicating that the Real-Time Kernel package has been installed.
1303+
1304+```
1305+One moment, checking your subscription first
1306+The real-time kernel is a beta version of the 22.04 Ubuntu kernel with the
1307+PREEMPT_RT patchset integrated for x86_64 and ARM64.
1308+
1309+This will change your kernel. You will need to manually configure grub to
1310+revert back to your original kernel after enabling real-time.
1311+
1312+Do you want to continue? [ default = Yes ]: (Y/n) yes
1313+Updating package lists
1314+Installing Real-Time Kernel packages
1315+Real-Time Kernel enabled
1316+A reboot is required to complete install.
1317+```
1318+
1319+After rebooting you'll be running the Real-Time Kernel!
1320+
1321+## Enable and manually install
1322+
1323+> **Note**
1324+> The --access-only flag is introduced in version 27.11
1325+
1326+If you would like to enable access to the Real-Time Kernel apt repository but not install the kernel right away, use the `--access-only` flag while enabling.
1327+
1328+```console
1329+$ sudo ua enable realtime-kernel --beta --access-only
1330+```
1331+
1332+With that extra flag you'll see output like the following:
1333+
1334+```
1335+One moment, checking your subscription first
1336+Updating package lists
1337+Skipping installing packages: ubuntu-realtime
1338+Real-Time Kernel access enabled
1339+```
1340+
1341+To install the kernel you can then run:
1342+
1343+```console
1344+$ sudo apt install ubuntu-realtime
1345+```
1346+
1347+You'll need to reboot after installing to boot into the Real-Time Kernel.
1348diff --git a/docs/howtoguides/enable_ua_in_dockerfile.md b/docs/howtoguides/enable_ua_in_dockerfile.md
1349index 9ca0302..e371337 100644
1350--- a/docs/howtoguides/enable_ua_in_dockerfile.md
1351+++ b/docs/howtoguides/enable_ua_in_dockerfile.md
1352@@ -2,7 +2,7 @@
1353
1354 > Requires at least UA Client version 27.7
1355
1356-Ubuntu Advantage (UA) comes with several services, some of which can be useful in docker. For example, Extended Security Maintenance of packages and FIPS certified packages may be desirable in a docker image. In this how-to-guide, we show how you can use the `ua` tool to take advantage of these services in your Dockerfile.
1357+Ubuntu Advantage (UA) comes with several services, some of which can be useful in docker. For example, Expanded Security Maintenance of packages and FIPS certified packages may be desirable in a docker image. In this how-to-guide, we show how you can use the `ua` tool to take advantage of these services in your Dockerfile.
1358
1359
1360 ## Step 1: Create a UA Attach Config file
1361diff --git a/docs/howtoguides/get_token_and_attach.md b/docs/howtoguides/get_token_and_attach.md
1362index eb1e3ce..4cb49eb 100644
1363--- a/docs/howtoguides/get_token_and_attach.md
1364+++ b/docs/howtoguides/get_token_and_attach.md
1365@@ -21,7 +21,7 @@ This machine is now attached to 'UA Infra - Essential (Virtual)'
1366
1367 SERVICE ENTITLED STATUS DESCRIPTION
1368 cis yes disabled Center for Internet Security Audit Tools
1369-esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM)
1370+esm-infra yes enabled Expanded Security Maintenance for Infrastructure
1371 fips yes n/a NIST-certified FIPS modules
1372 fips-updates yes n/a Uncertified security updates to FIPS modules
1373 livepatch yes n/a Canonical Livepatch service
1374diff --git a/docs/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md b/docs/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md
1375index b792eeb..e53e4f9 100644
1376--- a/docs/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md
1377+++ b/docs/howtoguides/how_to_run_ua_fix_in_dry_run_mode.md
1378@@ -13,7 +13,7 @@ https://ubuntu.com/security/CVE-2021-22946
1379 https://ubuntu.com/security/CVE-2021-22947
1380 1 affected source package is installed: curl
1381 (1/1) curl:
1382-A fix is available in UA Infra.
1383+A fix is available in Ubuntu Pro: ESM Infra.
1384 The machine is not attached to an Ubuntu Advantage (UA) subscription.
1385 To proceed with the fix, a prompt would ask for a valid UA token.
1386 { ua attach TOKEN }
1387diff --git a/docs/howtoguides/how_to_simulate_attach.md b/docs/howtoguides/how_to_simulate_attach.md
1388index 0a3aa14..2de4923 100644
1389--- a/docs/howtoguides/how_to_simulate_attach.md
1390+++ b/docs/howtoguides/how_to_simulate_attach.md
1391@@ -14,7 +14,7 @@ one:
1392 SERVICE AVAILABLE ENTITLED AUTO_ENABLED DESCRIPTION
1393 cc-eal yes yes no Common Criteria EAL2 Provisioning Packages
1394 cis yes yes no Security compliance and audit tools
1395-esm-infra yes yes yes UA Infra: Extended Security Maintenance (ESM)
1396+esm-infra yes yes yes Expanded Security Maintenance for Infrastructure
1397 fips yes yes no NIST-certified core packages
1398 fips-updates yes yes no NIST-certified core packages with priority security updates
1399 livepatch yes yes yes Canonical Livepatch service
1400diff --git a/docs/index.rst b/docs/index.rst
1401new file mode 100644
1402index 0000000..06cf94e
1403--- /dev/null
1404+++ b/docs/index.rst
1405@@ -0,0 +1,58 @@
1406+Ubuntu Advantage Client
1407+===================================
1408+
1409+The Ubuntu Advantage (UA) Client is the offical tool to enable Canonical offerings on your
1410+system.
1411+
1412+UA provides support to view, enable, and disable the following Canonical services:
1413+
1414+- `Common Criteria EAL2 Certification Tooling <https://ubuntu.com/security/cc>`_
1415+- `CIS Benchmark Audit Tooling <https://ubuntu.com/security/cis>`_
1416+- `Ubuntu Security Guide (USG) Tooling <https://ubuntu.com/security/certifications/docs/usg>`_
1417+- `Ubuntu Expanded Security Maintenance (ESM) <https://ubuntu.com/security/esm>`_
1418+- `Robot Operating System (ROS) Expanded Security Maintenance <https://ubuntu.com/robotics/ros-esm>`_
1419+- `FIPS 140-2 Certified Modules (and optional non-certified patches <https://ubuntu.com/security/fips>`_
1420+- `Livepatch <https://ubuntu.com/security/livepatch>`_
1421+
1422+If you need any of those services for your machine, UA is the right tool for you.
1423+Furthermore, UA is already installed on every Ubuntu system. Try it out by running ``ua help``!
1424+
1425+Getting help
1426+************
1427+
1428+Having trouble? We would like to help!
1429+
1430+- Ask a question in the ``#ubuntu-server`` IRC channel on Libera
1431+- Find a bug? `Report bugs on Launchpad <https://bugs.launchpad.net/ubuntu-advantage-tools/+filebug>`_
1432+
1433+.. toctree::
1434+ :hidden:
1435+ :titlesonly:
1436+ :caption: Tutorials
1437+ :glob:
1438+
1439+ tutorials/*
1440+
1441+.. toctree::
1442+ :hidden:
1443+ :titlesonly:
1444+ :caption: How to guides
1445+ :glob:
1446+
1447+ howtoguides/*
1448+
1449+.. toctree::
1450+ :hidden:
1451+ :titlesonly:
1452+ :caption: Explanations
1453+ :glob:
1454+
1455+ explanations/*
1456+
1457+.. toctree::
1458+ :hidden:
1459+ :titlesonly:
1460+ :caption: References
1461+ :glob:
1462+
1463+ references/*
1464diff --git a/docs/references/support_matrix.md b/docs/references/support_matrix.md
1465index 9935665..cdf4e97 100644
1466--- a/docs/references/support_matrix.md
1467+++ b/docs/references/support_matrix.md
1468@@ -14,6 +14,8 @@ Below is a list of platforms and releases ubuntu-advantage-tools supports
1469 | Focal | amd64, arm64, armhf, ppc64el, riscv64, s390x | Active SRU of all features |
1470 | Groovy | amd64, arm64, armhf, ppc64el, riscv64, s390x | Last release 27.1 |
1471 | Hirsute | amd64, arm64, armhf, ppc64el, riscv64, s390x | Last release 27.5 |
1472-| Impish | amd64, arm64, armhf, ppc64el, riscv64, s390x | Active SRU of all features |
1473+| Impish | amd64, arm64, armhf, ppc64el, riscv64, s390x | Last release 27.9 |
1474+| Jammy | amd64, arm64, armhf, ppc64el, riscv64, s390x | Active SRU of all features |
1475+| Kinetic | amd64, arm64, armhf, ppc64el, riscv64, s390x | Active SRU of all features |
1476
1477 Note: ppc64el will not have all APT messaging due to insufficient golang support
1478diff --git a/docs/tutorials/basic_ua_commands.md b/docs/tutorials/basic_ua_commands.md
1479index b856541..6304fdf 100644
1480--- a/docs/tutorials/basic_ua_commands.md
1481+++ b/docs/tutorials/basic_ua_commands.md
1482@@ -1,4 +1,4 @@
1483-# Tutorial: cover base UA commands
1484+# Getting Started with UA
1485
1486 The Ubuntu Advantage (UA) Tools provides users with a simple mechanism to
1487 view, enable, and disable offerings from Canonical on their system. In this tutorial
1488@@ -59,7 +59,7 @@ It is expected for you to see an output similar to this one:
1489 ```
1490 SERVICE AVAILABLE DESCRIPTION
1491 cis yes Center for Internet Security Audit Tools
1492-esm-infra yes UA Infra: Extended Security Maintenance (ESM)
1493+esm-infra yes Expanded Security Maintenance for Infrastructure
1494 fips yes NIST-certified core packages
1495 fips-updates yes NIST-certified core packages with priority security updates
1496 livepatch yes Canonical Livepatch service
1497@@ -96,12 +96,12 @@ It is expected for you to see an output similar to this one:
1498 ```
1499 Enabling default service esm-infra
1500 Updating package lists
1501-UA Infra: ESM enabled
1502+Ubuntu Pro: ESM Infra enabled
1503 This machine is now attached to 'USER ACCOUNT'
1504
1505 SERVICE ENTITLED STATUS DESCRIPTION
1506 cis yes disabled Center for Internet Security Audit Tools
1507-esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM)
1508+esm-infra yes enabled Expanded Security Maintenance for Infrastructure
1509 fips yes n/a NIST-certified core packages
1510 fips-updates yes n/a NIST-certified core packages with priority security updates
1511 livepatch yes n/a Canonical Livepatch service
1512@@ -194,7 +194,7 @@ And you should see:
1513 ```
1514 SERVICE ENTITLED STATUS DESCRIPTION
1515 cis yes enabled Center for Internet Security Audit Tools
1516-esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM)
1517+esm-infra yes enabled Expanded Security Maintenance for Infrastructure
1518 fips yes n/a NIST-certified core packages
1519 fips-updates yes n/a NIST-certified core packages with priority security updates
1520 livepatch yes n/a Canonical Livepatch service
1521@@ -217,8 +217,7 @@ After running that command, let's now run `ua status` to see what happened to `c
1522 ```
1523 SERVICE ENTITLED STATUS DESCRIPTION
1524 cis yes disabled Center for Internet Security Audit Tools
1525-esm-apps yes enabled UA Apps: Extended Security Maintenance (ESM)
1526-esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM)
1527+esm-infra yes enabled Expanded Security Maintenance for Infrastructure
1528 fips yes n/a NIST-certified core packages
1529 fips-updates yes n/a NIST-certified core packages with priority security updates
1530 livepatch yes n/a Canonical Livepatch service
1531diff --git a/docs/tutorials/create_a_fips_updates_pro_cloud_image.md b/docs/tutorials/create_a_fips_updates_pro_cloud_image.md
1532new file mode 100644
1533index 0000000..51a566a
1534--- /dev/null
1535+++ b/docs/tutorials/create_a_fips_updates_pro_cloud_image.md
1536@@ -0,0 +1,65 @@
1537+# Create a customized Cloud Ubuntu Pro image with FIPS Updates
1538+
1539+## Step 1: Launch an Ubuntu Pro instance on your cloud
1540+
1541+See the following links for up to date information for each supported cloud:
1542+* https://ubuntu.com/aws/pro
1543+* https://ubuntu.com/azure/pro
1544+* https://ubuntu.com/gcp/pro
1545+
1546+## Step 2: Enable FIPS Updates
1547+
1548+First wait for the standard Ubuntu Pro services to be set up.
1549+
1550+```bash
1551+sudo ua status --wait
1552+```
1553+
1554+Then use [the enable command](../howtoguides/enable_fips.md) to setup FIPS Updates.
1555+```bash
1556+sudo ua enable fips-updates --assume-yes
1557+```
1558+
1559+Now reboot the instance
1560+```bash
1561+sudo reboot
1562+```
1563+
1564+And verify that `fips-updates` is enabled in the output of `ua status`
1565+```bash
1566+sudo ua status
1567+```
1568+
1569+Also remove the machine-id so that it is regenerated for each instance launch from the snapshot.
1570+```bash
1571+sudo rm /etc/machine-id
1572+```
1573+
1574+## Step 3: Snapshot the instance as a cloud image
1575+
1576+Cloud-specific instructions are here:
1577+* [AWS](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/tkv-create-ami-from-instance.html)
1578+* [Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource)
1579+* [GCP](https://cloud.google.com/compute/docs/machine-images/create-machine-images)
1580+
1581+## Step 4: Launch your custom image!
1582+
1583+Use your specific cloud to launch a new instance from your custom image.
1584+
1585+> **Note**
1586+> For versions prior to 27.11, you will need to re-enable fips-updates on each instance that is launched from the custom image.
1587+>
1588+> This won't require a reboot and is only necessary to ensure the instance gets updates to fips packages when they become available.
1589+>
1590+> ```bash
1591+> sudo ua enable fips-updates --assume-yes
1592+> ```
1593+>
1594+> You can easily script this using [cloud-init user-data](https://cloudinit.readthedocs.io/en/latest/topics/modules.html#runcmd) at launch time
1595+> ```yaml
1596+> #cloud-config
1597+> # Enable fips-updates after pro auto-attach and reboot after cloud-init completes
1598+> runcmd:
1599+> - 'ua status --wait'
1600+> - 'ua enable fips-updates --assume-yes'
1601+> ```
1602diff --git a/docs/tutorials/ua_fix_scenarios.md b/docs/tutorials/ua_fix_scenarios.md
1603index d66e004..4be0eec 100644
1604--- a/docs/tutorials/ua_fix_scenarios.md
1605+++ b/docs/tutorials/ua_fix_scenarios.md
1606@@ -161,7 +161,7 @@ https://ubuntu.com/security/CVE-2021-22946
1607 https://ubuntu.com/security/CVE-2021-22947
1608 1 affected package is installed: curl
1609 (1/1) curl:
1610-A fix is available in UA Infra.
1611+A fix is available in Ubuntu Pro: ESM Infra.
1612 The update is not installed because this system is not attached to a
1613 subscription.
1614
1615@@ -187,7 +187,7 @@ https://ubuntu.com/security/CVE-2021-22946
1616 https://ubuntu.com/security/CVE-2021-22947
1617 1 affected package is installed: curl
1618 (1/1) curl:
1619-A fix is available in UA Infra.
1620+A fix is available in Ubuntu Pro: ESM Infra.
1621 The update is not installed because this system is not attached to a
1622 subscription.
1623
1624@@ -200,12 +200,12 @@ Enter your token (from https://ubuntu.com/advantage) to attach this system:
1625 { ua attach TOKEN }
1626 Enabling default service esm-infra
1627 Updating package lists
1628-UA Infra: ESM enabled
1629+Ubuntu Pro: ESM Infra enabled
1630 This machine is now attached to 'SUBSCRIPTION'
1631
1632 SERVICE ENTITLED STATUS DESCRIPTION
1633 cis yes disabled Center for Internet Security Audit Tools
1634-esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM)
1635+esm-infra yes enabled Expanded Security Maintenance for Infrastructure
1636 fips yes n/a NIST-certified core packages
1637 fips-updates yes n/a NIST-certified core packages with priority security updates
1638 livepatch yes n/a Canonical Livepatch service
1639@@ -234,7 +234,7 @@ https://ubuntu.com/security/CVE-2021-22946
1640 https://ubuntu.com/security/CVE-2021-22947
1641 1 affected package is installed: curl
1642 (1/1) curl:
1643-A fix is available in UA Infra.
1644+A fix is available in Ubuntu Pro: ESM Infra.
1645 The update is already installed.
1646 ✔ USN-5079-2 is resolved.
1647 ```
1648@@ -268,7 +268,7 @@ CVE-2021-44731: snapd vulnerabilities
1649 https://ubuntu.com/security/CVE-2021-44731
1650 1 affected package is installed: snapd
1651 (1/1) snapd:
1652-A fix is available in UA Infra.
1653+A fix is available in Ubuntu Pro: ESM Infra.
1654 The update is not installed because this system does not have
1655 esm-infra enabled.
1656
1657@@ -277,7 +277,7 @@ Choose: [E]nable esm-infra [C]ancel
1658 { ua enable esm-infra }
1659 One moment, checking your subscription first
1660 Updating package lists
1661-UA Infra: ESM enabled
1662+Ubuntu Pro: ESM Infra enabled
1663 { apt update && apt install --only-upgrade -y ubuntu-core-launcher snapd }
1664 ✔ CVE-2021-44731 is resolved.
1665 ```
1666@@ -304,7 +304,7 @@ VE-2022-0778: OpenSSL vulnerability
1667 https://ubuntu.com/security/CVE-2022-0778
1668 1 affected package is installed: openssl
1669 (1/1) openssl:
1670-A fix is available in UA Infra.
1671+A fix is available in Ubuntu Pro: ESM Infra.
1672 { apt update && apt install --only-upgrade -y libssl1.0.0 openssl }
1673 A reboot is required to complete fix operation.
1674 ✘ CVE-2022-0778 is not resolved.
1675@@ -317,7 +317,7 @@ CVE-2022-0778: OpenSSL vulnerability
1676 https://ubuntu.com/security/CVE-2022-0778
1677 1 affected package is installed: openssl
1678 (1/1) openssl:
1679-A fix is available in UA Infra.
1680+A fix is available in Ubuntu Pro: ESM Infra.
1681 The update is already installed.
1682 ✔ CVE-2022-0778 is resolved.
1683 ```
1684diff --git a/features/_version.feature b/features/_version.feature
1685index 42454c2..7a0633b 100644
1686--- a/features/_version.feature
1687+++ b/features/_version.feature
1688@@ -1,4 +1,4 @@
1689-Feature: UA is expected version
1690+Feature: Pro is expected version
1691
1692 @series.all
1693 @uses.config.check_version
1694@@ -13,14 +13,14 @@ Feature: UA is expected version
1695 @uses.config.machine_type.gcp.generic
1696 @uses.config.machine_type.gcp.pro
1697 @uses.config.machine_type.gcp.pro.fips
1698- Scenario Outline: Check ua version
1699+ Scenario Outline: Check pro version
1700 Given a `<release>` machine with ubuntu-advantage-tools installed
1701 When I run `dpkg-query --showformat='${Version}' --show ubuntu-advantage-tools` with sudo
1702 Then I will see the following on stdout
1703 """
1704 {UACLIENT_BEHAVE_CHECK_VERSION}
1705 """
1706- When I run `ua version` with sudo
1707+ When I run `pro version` with sudo
1708 Then I will see the following on stdout
1709 """
1710 {UACLIENT_BEHAVE_CHECK_VERSION}
1711@@ -30,21 +30,21 @@ Feature: UA is expected version
1712 | xenial |
1713 | bionic |
1714 | focal |
1715- | impish |
1716 | jammy |
1717+ | kinetic |
1718
1719 @series.all
1720 @uses.config.check_version
1721 @uses.config.machine_type.lxd.container
1722 @upgrade
1723- Scenario Outline: Check ua version
1724+ Scenario Outline: Check pro version
1725 Given a `<release>` machine with ubuntu-advantage-tools installed
1726 When I run `dpkg-query --showformat='${Version}' --show ubuntu-advantage-tools` with sudo
1727 Then I will see the following on stdout
1728 """
1729 {UACLIENT_BEHAVE_CHECK_VERSION}
1730 """
1731- When I run `ua version` with sudo
1732+ When I run `pro version` with sudo
1733 Then I will see the following on stdout
1734 """
1735 {UACLIENT_BEHAVE_CHECK_VERSION}
1736@@ -54,5 +54,5 @@ Feature: UA is expected version
1737 | xenial |
1738 | bionic |
1739 | focal |
1740- | impish |
1741- | jammy |
1742+ | jammy |
1743+ | kinetic |
1744diff --git a/features/api.feature b/features/api.feature
1745new file mode 100644
1746index 0000000..ad4ee97
1747--- /dev/null
1748+++ b/features/api.feature
1749@@ -0,0 +1,52 @@
1750+Feature: Client behaviour for the API endpoints
1751+
1752+ @series.all
1753+ @uses.config.machine_type.lxd.container
1754+ Scenario Outline: API invalid endpoint or args
1755+ Given a `<release>` machine with ubuntu-advantage-tools installed
1756+ When I verify that running `pro api invalid.endpoint` `with sudo` exits `1`
1757+ Then stdout matches regexp:
1758+ """
1759+ {\"_schema_version\": \"v1\", \"data\": {\"meta\": {\"environment_vars\": \[]}}, \"errors\": \[{\"code\": \"api\-invalid\-endpoint", \"meta\": {}, \"title\": \"'invalid\.endpoint' is not a valid endpoint\"}], \"result\": \"failure\", \"version\": \".*\", \"warnings\": \[]}
1760+ """
1761+ When I verify that running `pro api u.pro.version.v1 --args extra=arg` `with sudo` exits `1`
1762+ Then stdout matches regexp:
1763+ """
1764+ {\"_schema_version\": \"v1\", \"data\": {\"meta\": {\"environment_vars\": \[]}}, \"errors\": \[{\"code\": \"api\-no\-argument\-for\-endpoint\", \"meta\": {}, \"title\": \"u\.pro\.version\.v1 accepts no arguments\"}], \"result\": \"failure\", \"version\": \".*\", \"warnings\": \[]}
1765+ """
1766+
1767+ Examples: ubuntu release
1768+ | release |
1769+ | bionic |
1770+ | focal |
1771+ | xenial |
1772+ | jammy |
1773+ | kinetic |
1774+
1775+ @series.all
1776+ @uses.config.machine_type.lxd.container
1777+ Scenario Outline: Basic endpoints
1778+ Given a `<release>` machine with ubuntu-advantage-tools installed
1779+ When I run `pro api u.pro.version.v1` with sudo
1780+ Then stdout matches regexp:
1781+ """
1782+ {\"_schema_version\": \"v1\", \"data\": {\"attributes\": {\"installed_version\": \".*\"}, \"meta\": {\"environment_vars\": \[]}, \"type\": \"Version\"}, \"errors\": \[], \"result\": \"success\", \"version\": \".*\", \"warnings\": \[]}
1783+ """
1784+ When I run `UA_LOG_FILE=/tmp/some_file OTHER_ENVVAR=not_there pro api u.pro.version.v1` with sudo
1785+ Then stdout matches regexp:
1786+ """
1787+ {\"_schema_version\": \"v1\", \"data\": {\"attributes\": {\"installed_version\": \".*\"}, \"meta\": {\"environment_vars\": \[{\"name\": \"UA_LOG_FILE\", \"value\": \"\/tmp\/some_file\"}]}, \"type\": \"Version\"}, \"errors\": \[], \"result\": \"success\", \"version\": \".*\", \"warnings\": \[]}
1788+ """
1789+ When I run `ua api u.pro.attach.auto.should_auto_attach.v1` with sudo
1790+ Then stdout matches regexp:
1791+ """
1792+ {"_schema_version": "v1", "data": {"attributes": {"should_auto_attach": false}, "meta": {"environment_vars": \[\]}, "type": "ShouldAutoAttach"}, "errors": \[\], "result": "success", "version": ".*", "warnings": \[\]}
1793+ """
1794+
1795+ Examples: ubuntu release
1796+ | release |
1797+ | bionic |
1798+ | focal |
1799+ | xenial |
1800+ | jammy |
1801+ | kinetic |
1802diff --git a/features/api_full_auto_attach.feature b/features/api_full_auto_attach.feature
1803new file mode 100644
1804index 0000000..1aac22e
1805--- /dev/null
1806+++ b/features/api_full_auto_attach.feature
1807@@ -0,0 +1,39 @@
1808+Feature: Full Auto-Attach Endpoint
1809+
1810+ @series.lts
1811+ @uses.config.machine_type.aws.pro
1812+ @uses.config.machine_type.azure.pro
1813+ @uses.config.machine_type.gcp.pro
1814+ Scenario Outline: Run auto-attach on cloud instance.
1815+ Given a `<release>` machine with ubuntu-advantage-tools installed
1816+ When I create the file `/etc/ubuntu-advantage/uaclient.conf` with the following:
1817+ """
1818+ contract_url: 'https://contracts.canonical.com'
1819+ data_dir: /var/lib/ubuntu-advantage
1820+ log_level: debug
1821+ log_file: /var/log/ubuntu-advantage.log
1822+ """
1823+ When I create the file `/tmp/full_auto_attach.py` with the following:
1824+ """
1825+ from uaclient.api.u.pro.attach.auto.full_auto_attach.v1 import full_auto_attach, FullAutoAttachOptions
1826+
1827+ full_auto_attach(FullAutoAttachOptions(enable=["esm-infra", "esm-apps"]))
1828+ """
1829+ And I run `python3 /tmp/full_auto_attach.py` with sudo
1830+ And I run `pro status --all` with sudo
1831+ Then stdout matches regexp:
1832+ """
1833+ esm-apps +yes +enabled +Expanded Security Maintenance for Applications
1834+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
1835+ """
1836+ Then stdout matches regexp:
1837+ """
1838+ livepatch +yes +disabled +Canonical Livepatch service
1839+ """
1840+ Examples:
1841+ | release |
1842+ | xenial |
1843+ | bionic |
1844+ | focal |
1845+ | jammy |
1846+
1847diff --git a/features/api_magic_attach.feature b/features/api_magic_attach.feature
1848new file mode 100644
1849index 0000000..4ab6592
1850--- /dev/null
1851+++ b/features/api_magic_attach.feature
1852@@ -0,0 +1,74 @@
1853+Feature: Magic Attach endpoints
1854+
1855+ @series.lts
1856+ @uses.config.machine_type.lxd.container
1857+ Scenario Outline: Call magic attach endpoints
1858+ Given a `<release>` machine with ubuntu-advantage-tools installed
1859+ When I change contract to staging with sudo
1860+ And I verify that running `pro api u.pro.attach.magic.revoke.v1` `as non-root` exits `1`
1861+ Then stdout is a json matching the `api_response` schema
1862+ And stdout matches regexp:
1863+ """
1864+ {"_schema_version": "v1", "data": {"meta": {\"environment_vars\": \[]}}, "errors": \[{"code": "api-missing-argument", "meta": {}, "title": "Missing argument \'magic_token\' for endpoint u.pro.attach.magic.revoke.v1"}\], "result": "failure", "version": ".*", "warnings": \[\]}
1865+ """
1866+ When I verify that running `pro api u.pro.attach.magic.wait.v1 --args magic_token=INVALID` `as non-root` exits `1`
1867+ Then stdout is a json matching the `api_response` schema
1868+ And stdout matches regexp:
1869+ """
1870+ {"_schema_version": "v1", "data": {"meta": {"environment_vars": \[\]}}, "errors": \[{"code": "magic-attach-token-error", "meta": {}, "title": "The magic attach token is invalid, has expired or never existed"}\], "result": "failure", "version": ".*", "warnings": \[\]}
1871+ """
1872+ When I verify that running `pro api u.pro.attach.magic.revoke.v1 --args magic_token=INVALID` `as non-root` exits `1`
1873+ Then stdout is a json matching the `api_response` schema
1874+ And stdout matches regexp:
1875+ """
1876+ {"_schema_version": "v1", "data": {"meta": {"environment_vars": \[\]}}, "errors": \[{"code": "magic-attach-token-error", "meta": {}, "title": "The magic attach token is invalid, has expired or never existed"}\], "result": "failure", "version": ".*", "warnings": \[\]}
1877+ """
1878+ When I initiate the magic attach flow
1879+ Then stdout is a json matching the `api_response` schema
1880+ And the json API response data matches the `magic_attach` schema
1881+ And stdout matches regexp:
1882+ """
1883+ {"_schema_version": "v1", "data": {"attributes": {"expires": ".*", "expires_in": .*, "token": ".*", "user_code": ".*"}, "meta": {\"environment_vars\": \[]}, "type": "MagicAttachInitiate"}, "errors": \[\], "result": "success", "version": ".*", "warnings": \[\]}
1884+ """
1885+ When I create the file `/tmp/response-overlay.json` with the following:
1886+ """
1887+ {
1888+ "https://contracts.staging.canonical.com/v1/magic-attach": [
1889+ {
1890+ "code": 200,
1891+ "response": {
1892+ "userCode": "123",
1893+ "token": "testToken",
1894+ "expires": "expire-date",
1895+ "expiresIn": 2000,
1896+ "contractID": "test-contract-id",
1897+ "contractToken": "contract-token"
1898+ }
1899+ }]
1900+ }
1901+ """
1902+ And I append the following on uaclient config:
1903+ """
1904+ features:
1905+ serviceclient_url_responses: "/tmp/response-overlay.json"
1906+ """
1907+ And I wait for the magic attach token to be activated
1908+ Then stdout is a json matching the `api_response` schema
1909+ And the json API response data matches the `magic_attach` schema
1910+ And stdout matches regexp:
1911+ """
1912+ {"_schema_version": "v1", "data": {"attributes": {"contract_id": "test-contract-id", "contract_token": "contract-token", "expires": "expire-date", "expires_in": 2000, "token": "testToken", "user_code": "123"}, "meta": {\"environment_vars\": \[]}, "type": "MagicAttachWait"}, "errors": \[\], "result": "success", "version": ".*", "warnings": \[\]}
1913+ """
1914+ When I revoke the magic attach token
1915+ Then stdout is a json matching the `api_response` schema
1916+ And stdout matches regexp:
1917+ """
1918+ {"_schema_version": "v1", "data": {"attributes": {}, "meta": {\"environment_vars\": \[]}, "type": "MagicAttachRevoke"}, "errors": \[\], "result": "success", "version": ".*", "warnings": \[\]}
1919+ """
1920+
1921+ Examples: ubuntu release
1922+ | release |
1923+ | xenial |
1924+ | bionic |
1925+ | focal |
1926+ | jammy |
1927diff --git a/features/apt_json_hook.feature b/features/apt_json_hook.feature
1928deleted file mode 100644
1929index 5a1317e..0000000
1930--- a/features/apt_json_hook.feature
1931+++ /dev/null
1932@@ -1,99 +0,0 @@
1933-Feature: APT JSON Hook
1934-
1935- @series.xenial
1936- @uses.config.machine_type.lxd.container
1937- Scenario Outline: APT JSON Hook prints package counts correctly on xenial
1938- Given a `<release>` machine with ubuntu-advantage-tools installed
1939- When I attach `contract_token` with sudo
1940- When I run `apt-get update` with sudo
1941- When I run `apt-get upgrade -y` with sudo
1942-
1943- When I run `apt-get install -y --allow-downgrades <standard-pkg>` with sudo
1944- When I run `apt-get upgrade -y` with sudo
1945- Then stdout matches regexp:
1946- """
1947- 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1948- 2 standard security updates
1949-
1950- """
1951-
1952- When I run `apt-get install -y --allow-downgrades <infra-pkg>` with sudo
1953- When I run `apt-get upgrade -y` with sudo
1954- Then stdout matches regexp:
1955- """
1956- 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1957- 2 esm-infra security updates
1958-
1959- """
1960-
1961- When I run `apt-get install -y --allow-downgrades <apps-pkg>` with sudo
1962- When I run `apt-get upgrade -y` with sudo
1963- Then stdout matches regexp:
1964- """
1965- 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1966- 1 esm-apps security update
1967-
1968- """
1969-
1970- When I run `apt-get install -y --allow-downgrades <standard-pkg>` with sudo
1971- When I run `apt-get install -y --allow-downgrades <infra-pkg>` with sudo
1972- When I run `apt-get upgrade -y` with sudo
1973- Then stdout matches regexp:
1974- """
1975- 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1976- 2 standard security updates and 2 esm-infra updates
1977-
1978- """
1979-
1980- When I run `apt-get install -y --allow-downgrades <standard-pkg>` with sudo
1981- When I run `apt-get install -y --allow-downgrades <apps-pkg>` with sudo
1982- When I run `apt-get upgrade -y` with sudo
1983- Then stdout matches regexp:
1984- """
1985- 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1986- 2 standard security updates and 1 esm-apps update
1987-
1988- """
1989-
1990- When I run `apt-get install -y --allow-downgrades <infra-pkg>` with sudo
1991- When I run `apt-get install -y --allow-downgrades <apps-pkg>` with sudo
1992- When I run `apt-get upgrade -y` with sudo
1993- Then stdout matches regexp:
1994- """
1995- 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1996- 2 esm-infra security updates and 1 esm-apps update
1997-
1998- """
1999-
2000- When I run `apt-get install -y --allow-downgrades <standard-pkg>` with sudo
2001- When I run `apt-get install -y --allow-downgrades <infra-pkg>` with sudo
2002- When I run `apt-get install -y --allow-downgrades <apps-pkg>` with sudo
2003- When I run `apt-get upgrade -y` with sudo
2004- Then stdout matches regexp:
2005- """
2006- 5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2007- 2 standard security updates, 2 esm-infra updates and 1 esm-apps update
2008-
2009- """
2010-
2011- When I run `apt-get upgrade -y` with sudo
2012- Then stdout matches regexp:
2013- """
2014- 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2015- """
2016- Then stdout does not match regexp:
2017- """
2018- standard security update
2019- """
2020- Then stdout does not match regexp:
2021- """
2022- esm-infra
2023- """
2024- Then stdout does not match regexp:
2025- """
2026- esm-apps
2027- """
2028-
2029- Examples: ubuntu release
2030- | release | standard-pkg | infra-pkg | apps-pkg |
2031- | xenial | accountsservice=0.6.40-2ubuntu10 libaccountsservice0=0.6.40-2ubuntu10 | curl=7.47.0-1ubuntu2 libcurl3-gnutls=7.47.0-1ubuntu2 | libzstd1=1.3.1+dfsg-1~ubuntu0.16.04.1 |
2032diff --git a/features/apt_messages.feature b/features/apt_messages.feature
2033new file mode 100644
2034index 0000000..af9b17e
2035--- /dev/null
2036+++ b/features/apt_messages.feature
2037@@ -0,0 +1,328 @@
2038+Feature: APT Messages
2039+
2040+ @series.xenial
2041+ @uses.config.machine_type.lxd.container
2042+ Scenario Outline: APT JSON Hook prints package counts correctly on xenial
2043+ Given a `<release>` machine with ubuntu-advantage-tools installed
2044+ When I attach `contract_token` with sudo
2045+ When I run `apt-get update` with sudo
2046+ When I run `apt-get upgrade -y` with sudo
2047+
2048+ When I run `apt-get install -y --allow-downgrades <standard-pkg>` with sudo
2049+ When I run `apt-get upgrade -y` with sudo
2050+ Then stdout matches regexp:
2051+ """
2052+ 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2053+ 2 standard LTS security updates
2054+
2055+ """
2056+
2057+ When I run `apt-get install -y --allow-downgrades <infra-pkg>` with sudo
2058+ When I run `apt-get upgrade -y` with sudo
2059+ Then stdout matches regexp:
2060+ """
2061+ 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2062+ 2 esm-infra security updates
2063+
2064+ """
2065+
2066+ When I run `apt-get install -y --allow-downgrades <apps-pkg>` with sudo
2067+ When I run `apt-get upgrade -y` with sudo
2068+ Then stdout matches regexp:
2069+ """
2070+ 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2071+ 1 esm-apps security update
2072+
2073+ """
2074+
2075+ When I run `apt-get install -y --allow-downgrades <standard-pkg>` with sudo
2076+ When I run `apt-get install -y --allow-downgrades <infra-pkg>` with sudo
2077+ When I run `apt-get upgrade -y` with sudo
2078+ Then stdout matches regexp:
2079+ """
2080+ 4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2081+ 2 standard LTS security updates and 2 esm-infra security updates
2082+
2083+ """
2084+
2085+ When I run `apt-get install -y --allow-downgrades <standard-pkg>` with sudo
2086+ When I run `apt-get install -y --allow-downgrades <apps-pkg>` with sudo
2087+ When I run `apt-get upgrade -y` with sudo
2088+ Then stdout matches regexp:
2089+ """
2090+ 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2091+ 2 standard LTS security updates and 1 esm-apps security update
2092+
2093+ """
2094+
2095+ When I run `apt-get install -y --allow-downgrades <infra-pkg>` with sudo
2096+ When I run `apt-get install -y --allow-downgrades <apps-pkg>` with sudo
2097+ When I run `apt-get upgrade -y` with sudo
2098+ Then stdout matches regexp:
2099+ """
2100+ 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2101+ 2 esm-infra security updates and 1 esm-apps security update
2102+
2103+ """
2104+
2105+ When I run `apt-get install -y --allow-downgrades <standard-pkg>` with sudo
2106+ When I run `apt-get install -y --allow-downgrades <infra-pkg>` with sudo
2107+ When I run `apt-get install -y --allow-downgrades <apps-pkg>` with sudo
2108+ When I run `apt-get upgrade -y` with sudo
2109+ Then stdout matches regexp:
2110+ """
2111+ 5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2112+ 2 standard LTS security updates, 2 esm-infra security updates and 1 esm-apps security update
2113+
2114+ """
2115+
2116+ When I run `apt-get upgrade -y` with sudo
2117+ Then stdout matches regexp:
2118+ """
2119+ 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2120+ """
2121+ Then stdout does not match regexp:
2122+ """
2123+ standard LTS security update
2124+ """
2125+ Then stdout does not match regexp:
2126+ """
2127+ esm-infra
2128+ """
2129+ Then stdout does not match regexp:
2130+ """
2131+ esm-apps
2132+ """
2133+
2134+ Examples: ubuntu release
2135+ | release | standard-pkg | infra-pkg | apps-pkg |
2136+ | xenial | accountsservice=0.6.40-2ubuntu10 libaccountsservice0=0.6.40-2ubuntu10 | curl=7.47.0-1ubuntu2 libcurl3-gnutls=7.47.0-1ubuntu2 | hello=2.10-1 |
2137+
2138+ @series.xenial
2139+ @uses.config.machine_type.lxd.container
2140+ Scenario Outline: APT Hook advertises esm-infra on upgrade
2141+ Given a `<release>` machine with ubuntu-advantage-tools installed
2142+ When I run `apt-get update` with sudo
2143+ When I run `apt-get -y upgrade` with sudo
2144+ When I run `apt-get -y autoremove` with sudo
2145+ When I run `pro refresh messages` with sudo
2146+ When I run `apt-get upgrade` with sudo
2147+ Then stdout matches regexp:
2148+ """
2149+ Reading package lists...
2150+ Building dependency tree...
2151+ Reading state information...
2152+ Calculating upgrade...
2153+ The following security updates require Ubuntu Pro with 'esm-infra' enabled:
2154+ .*
2155+ Learn more about Ubuntu Pro for 16\.04 at https:\/\/ubuntu\.com\/16-04
2156+ 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded\.
2157+ """
2158+ When I attach `contract_token` with sudo
2159+ When I run `apt-get upgrade --dry-run` with sudo
2160+ Then stdout matches regexp:
2161+ """
2162+ Reading package lists...
2163+ Building dependency tree...
2164+ Reading state information...
2165+ Calculating upgrade...
2166+ The following packages will be upgraded:
2167+ """
2168+ When I update contract to use `effectiveTo` as `days=+2`
2169+ When I run `pro refresh messages` with sudo
2170+ When I run `apt-get upgrade --dry-run` with sudo
2171+ Then stdout matches regexp:
2172+ """
2173+ Reading package lists...
2174+ Building dependency tree...
2175+ Reading state information...
2176+ Calculating upgrade...
2177+
2178+ CAUTION: Your Ubuntu Pro subscription will expire in 2 days.
2179+ Renew your subscription at https:\/\/ubuntu.com\/pro to ensure continued security
2180+ coverage for your applications.
2181+
2182+ The following packages will be upgraded:
2183+ """
2184+ When I update contract to use `effectiveTo` as `days=-3`
2185+ When I run `pro refresh messages` with sudo
2186+ When I run `apt-get upgrade --dry-run` with sudo
2187+ Then stdout matches regexp:
2188+ """
2189+ Reading package lists...
2190+ Building dependency tree...
2191+ Reading state information...
2192+ Calculating upgrade...
2193+
2194+ CAUTION: Your Ubuntu Pro subscription expired on \d+ \w+ \d+.
2195+ Renew your subscription at https:\/\/ubuntu.com\/pro to ensure continued security
2196+ coverage for your applications.
2197+ Your grace period will expire in 11 days.
2198+
2199+ The following packages will be upgraded:
2200+ """
2201+ When I update contract to use `effectiveTo` as `days=-20`
2202+ When I run `pro refresh messages` with sudo
2203+ When I run `apt-get upgrade --dry-run` with sudo
2204+ Then stdout matches regexp:
2205+ """
2206+ Reading package lists...
2207+ Building dependency tree...
2208+ Reading state information...
2209+ Calculating upgrade...
2210+
2211+ \*Your Ubuntu Pro subscription has EXPIRED\*
2212+ The following security updates require Ubuntu Pro with 'esm-infra' enabled:
2213+ .*
2214+ Renew your service at https:\/\/ubuntu.com\/pro
2215+
2216+ The following packages will be upgraded:
2217+ """
2218+ When I run `apt-get upgrade -y` with sudo
2219+ When I run `apt-get upgrade` with sudo
2220+ Then stdout matches regexp:
2221+ """
2222+ Reading package lists...
2223+ Building dependency tree...
2224+ Reading state information...
2225+ Calculating upgrade...
2226+
2227+ \*Your Ubuntu Pro subscription has EXPIRED\*
2228+ Renew your service at https:\/\/ubuntu.com\/pro
2229+
2230+ 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded\.
2231+ """
2232+ When I run `pro detach --assume-yes` with sudo
2233+ When I run `pro refresh messages` with sudo
2234+ When I run `apt-get upgrade` with sudo
2235+ Then stdout matches regexp:
2236+ """
2237+ Reading package lists...
2238+ Building dependency tree...
2239+ Reading state information...
2240+ Calculating upgrade...
2241+ Receive additional future security updates with Ubuntu Pro.
2242+ Learn more about Ubuntu Pro for 16\.04 at https:\/\/ubuntu\.com\/16-04
2243+ 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded\.
2244+ """
2245+ Examples: ubuntu release
2246+ | release |
2247+ | xenial |
2248+
2249+ @series.focal
2250+ @uses.config.machine_type.lxd.container
2251+ Scenario Outline: APT Hook advertises esm-apps on upgrade
2252+ Given a `<release>` machine with ubuntu-advantage-tools installed
2253+ When I run `apt-get update` with sudo
2254+ When I run `apt-get -y upgrade` with sudo
2255+ When I run `apt-get -y autoremove` with sudo
2256+ When I run `apt-get install hello` with sudo
2257+ When I run `pro refresh messages` with sudo
2258+ When I run `apt-get upgrade` with sudo
2259+ Then I will see the following on stdout:
2260+ """
2261+ Reading package lists...
2262+ Building dependency tree...
2263+ Reading state information...
2264+ Calculating upgrade...
2265+ The following security updates require Ubuntu Pro with 'esm-apps' enabled:
2266+ hello
2267+ Learn more about Ubuntu Pro at https://ubuntu.com/pro
2268+ 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2269+ """
2270+ When I attach `contract_token` with sudo
2271+ When I run `apt-get upgrade --dry-run` with sudo
2272+ Then stdout matches regexp:
2273+ """
2274+ Reading package lists...
2275+ Building dependency tree...
2276+ Reading state information...
2277+ Calculating upgrade...
2278+ The following packages will be upgraded:
2279+ hello
2280+ """
2281+ When I update contract to use `effectiveTo` as `days=-20`
2282+ When I run `pro refresh messages` with sudo
2283+ When I run `apt-get upgrade --dry-run` with sudo
2284+ Then stdout matches regexp:
2285+ """
2286+ Reading package lists...
2287+ Building dependency tree...
2288+ Reading state information...
2289+ Calculating upgrade...
2290+
2291+ \*Your Ubuntu Pro subscription has EXPIRED\*
2292+ The following security updates require Ubuntu Pro with 'esm-apps' enabled:
2293+ hello
2294+ Renew your service at https:\/\/ubuntu.com\/pro
2295+
2296+ The following packages will be upgraded:
2297+ """
2298+ When I run `apt-get upgrade -y` with sudo
2299+ When I run `pro detach --assume-yes` with sudo
2300+ When I run `pro refresh messages` with sudo
2301+ When I run `apt-get upgrade` with sudo
2302+ Then stdout matches regexp:
2303+ """
2304+ Reading package lists...
2305+ Building dependency tree...
2306+ Reading state information...
2307+ Calculating upgrade...
2308+ Receive additional future security updates with Ubuntu Pro.
2309+ Learn more about Ubuntu Pro at https:\/\/ubuntu\.com\/pro
2310+ 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded\.
2311+ """
2312+ Examples: ubuntu release
2313+ | release |
2314+ | focal |
2315+
2316+ @series.xenial
2317+ @series.bionic
2318+ @uses.config.machine_type.aws.generic
2319+ Scenario Outline: AWS URLs
2320+ Given a `<release>` machine with ubuntu-advantage-tools installed
2321+ When I run `apt-get update` with sudo
2322+ When I run `pro refresh messages` with sudo
2323+ When I run `apt-get upgrade --dry-run` with sudo
2324+ Then stdout matches regexp:
2325+ """
2326+ <msg>
2327+ """
2328+ Examples: ubuntu release
2329+ | release | msg |
2330+ | xenial | Learn more about Ubuntu Pro for 16\.04 at https:\/\/ubuntu\.com\/16-04 |
2331+ | bionic | Learn more about Ubuntu Pro on AWS at https:\/\/ubuntu\.com\/aws\/pro |
2332+
2333+ @series.xenial
2334+ @series.bionic
2335+ @uses.config.machine_type.azure.generic
2336+ Scenario Outline: Azure URLs
2337+ Given a `<release>` machine with ubuntu-advantage-tools installed
2338+ When I run `apt-get update` with sudo
2339+ When I run `pro refresh messages` with sudo
2340+ When I run `apt-get upgrade --dry-run` with sudo
2341+ Then stdout matches regexp:
2342+ """
2343+ <msg>
2344+ """
2345+ Examples: ubuntu release
2346+ | release | msg |
2347+ | xenial | Learn more about Ubuntu Pro for 16\.04 on Azure at https:\/\/ubuntu\.com\/16-04\/azure |
2348+ | bionic | Learn more about Ubuntu Pro on Azure at https:\/\/ubuntu\.com\/azure\/pro |
2349+
2350+ @series.xenial
2351+ @series.bionic
2352+ @uses.config.machine_type.gcp.generic
2353+ Scenario Outline: GCP URLs
2354+ Given a `<release>` machine with ubuntu-advantage-tools installed
2355+ When I run `apt-get update` with sudo
2356+ When I run `pro refresh messages` with sudo
2357+ When I run `apt-get upgrade --dry-run` with sudo
2358+ Then stdout matches regexp:
2359+ """
2360+ <msg>
2361+ """
2362+ Examples: ubuntu release
2363+ | release | msg |
2364+ | xenial | Learn more about Ubuntu Pro for 16\.04 at https:\/\/ubuntu\.com\/16-04 |
2365+ | bionic | Learn more about Ubuntu Pro on GCP at https:\/\/ubuntu\.com\/gcp\/pro |
2366diff --git a/features/attach_invalidtoken.feature b/features/attach_invalidtoken.feature
2367index 5c552fc..95cc47d 100644
2368--- a/features/attach_invalidtoken.feature
2369+++ b/features/attach_invalidtoken.feature
2370@@ -1,25 +1,25 @@
2371 Feature: Command behaviour when trying to attach a machine to an Ubuntu
2372- Advantage subscription using an invalid token
2373+ Pro subscription using an invalid token
2374
2375 @series.all
2376 @uses.config.machine_type.lxd.container
2377 Scenario Outline: Attach command failure on invalid token
2378 Given a `<release>` machine with ubuntu-advantage-tools installed
2379- When I verify that running `ua attach INVALID_TOKEN` `with sudo` exits `1`
2380+ When I verify that running `pro attach INVALID_TOKEN` `with sudo` exits `1`
2381 Then stderr matches regexp:
2382 """
2383- Invalid token. See https://ubuntu.com/advantage
2384+ Invalid token. See https://ubuntu.com/pro
2385 """
2386- When I verify that running `ua attach INVALID_TOKEN` `as non-root` exits `1`
2387+ When I verify that running `pro attach INVALID_TOKEN` `as non-root` exits `1`
2388 Then I will see the following on stderr:
2389 """
2390 This command must be run as root (try using sudo).
2391 """
2392- When I verify that running `ua attach invalid-token --format json` `with sudo` exits `1`
2393+ When I verify that running `pro attach invalid-token --format json` `with sudo` exits `1`
2394 Then stdout is a json matching the `ua_operation` schema
2395 And I will see the following on stdout:
2396 """
2397- {"_schema_version": "0.1", "errors": [{"message": "Invalid token. See https://ubuntu.com/advantage", "message_code": "attach-invalid-token", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
2398+ {"_schema_version": "0.1", "errors": [{"message": "Invalid token. See https://ubuntu.com/pro", "message_code": "attach-invalid-token", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
2399 """
2400
2401 Examples: ubuntu release
2402@@ -27,8 +27,8 @@ Feature: Command behaviour when trying to attach a machine to an Ubuntu
2403 | xenial |
2404 | bionic |
2405 | focal |
2406- | impish |
2407 | jammy |
2408+ | kinetic |
2409
2410 @series.all
2411 @uses.config.machine_type.lxd.container
2412@@ -40,13 +40,13 @@ Feature: Command behaviour when trying to attach a machine to an Ubuntu
2413 """
2414 Attach denied:
2415 Contract ".*" .*
2416- Visit https://ubuntu.com/advantage to manage contract tokens.
2417+ Visit https://ubuntu.com/pro to manage contract tokens.
2418 """
2419 When I verify that running attach `with sudo` using expired token with json response fails
2420 Then stdout is a json matching the `ua_operation` schema
2421 And I will see the following on stdout:
2422 """
2423- {"_schema_version": "0.1", "errors": [{"additional_info": {"contract_expiry_date": "12-31-2019", "contract_id": "cAJ4NHcl2qAld2CbJt5cufzZNHgVZ0YTPIH96Ihsy4bU"}, "message": "Attach denied:\nContract \"cAJ4NHcl2qAld2CbJt5cufzZNHgVZ0YTPIH96Ihsy4bU\" expired on December 31, 2019\nVisit https://ubuntu.com/advantage to manage contract tokens.", "message_code": "attach-forbidden-expired", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
2424+ {"_schema_version": "0.1", "errors": [{"additional_info": {"contract_expiry_date": "12-31-2019", "contract_id": "cAJ4NHcl2qAld2CbJt5cufzZNHgVZ0YTPIH96Ihsy4bU"}, "message": "Attach denied:\nContract \"cAJ4NHcl2qAld2CbJt5cufzZNHgVZ0YTPIH96Ihsy4bU\" expired on December 31, 2019\nVisit https://ubuntu.com/pro to manage contract tokens.", "message_code": "attach-forbidden-expired", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
2425 """
2426
2427 Examples: ubuntu release
2428@@ -54,5 +54,5 @@ Feature: Command behaviour when trying to attach a machine to an Ubuntu
2429 | xenial |
2430 | bionic |
2431 | focal |
2432- | impish |
2433 | jammy |
2434+ | kinetic |
2435diff --git a/features/attach_validtoken.feature b/features/attach_validtoken.feature
2436index 1223f25..ea0d05b 100644
2437--- a/features/attach_validtoken.feature
2438+++ b/features/attach_validtoken.feature
2439@@ -1,20 +1,20 @@
2440 @uses.config.contract_token
2441-Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2442+Feature: Command behaviour when attaching a machine to an Ubuntu Pro
2443 subscription using a valid token
2444
2445- @series.impish
2446+ @series.kinetic
2447 @uses.config.machine_type.lxd.container
2448 Scenario Outline: Attached command in a non-lts ubuntu machine
2449 Given a `<release>` machine with ubuntu-advantage-tools installed
2450 When I attach `contract_token` with sudo
2451- And I run `ua status --all` as non-root
2452+ And I run `pro status --all` as non-root
2453 Then stdout matches regexp:
2454 """
2455 SERVICE +ENTITLED STATUS DESCRIPTION
2456 cc-eal +yes +n/a +Common Criteria EAL2 Provisioning Packages
2457 cis +yes +n/a +Security compliance and audit tools
2458- esm-apps +yes +n/a +UA Apps: Extended Security Maintenance \(ESM\)
2459- esm-infra +yes +n/a +UA Infra: Extended Security Maintenance \(ESM\)
2460+ esm-apps +yes +n/a +Expanded Security Maintenance for Applications
2461+ esm-infra +yes +n/a +Expanded Security Maintenance for Infrastructure
2462 fips +yes +n/a +NIST-certified core packages
2463 fips-updates +yes +n/a +NIST-certified core packages with priority security updates
2464 livepatch +yes +n/a +Canonical Livepatch service
2465@@ -22,7 +22,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2466
2467 Examples: ubuntu release
2468 | release |
2469- | impish |
2470+ | kinetic |
2471
2472 @series.lts
2473 @uses.config.machine_type.lxd.container
2474@@ -31,10 +31,10 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2475 When I run `apt-get update` with sudo, retrying exit [100]
2476 And I run `apt install update-motd` with sudo, retrying exit [100]
2477 And I run `DEBIAN_FRONTEND=noninteractive apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y <downrev_pkg>` with sudo, retrying exit [100]
2478- And I run `ua refresh messages` with sudo
2479+ And I run `pro refresh messages` with sudo
2480 Then stdout matches regexp:
2481 """
2482- Successfully updated UA related APT and MOTD messages.
2483+ Successfully updated Ubuntu Pro related APT and MOTD messages.
2484 """
2485 When I run `update-motd` with sudo
2486 Then if `<release>` in `xenial` and stdout matches regexp:
2487@@ -54,7 +54,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2488 When I attach `contract_token` with sudo
2489 Then stdout matches regexp:
2490 """
2491- UA Infra: ESM enabled
2492+ Ubuntu Pro: ESM Infra enabled
2493 """
2494 And stdout matches regexp:
2495 """
2496@@ -62,110 +62,18 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2497 """
2498 And stdout matches regexp:
2499 """
2500- SERVICE +ENTITLED STATUS DESCRIPTION
2501- cc-eal +yes +<cc_status> +Common Criteria EAL2 Provisioning Packages
2502- """
2503- And stdout matches regexp:
2504- """
2505- esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\)
2506- esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\)
2507- fips +yes +<fips> +NIST-certified core packages
2508- fips-updates +yes +<fips> +NIST-certified core packages with priority security updates
2509- livepatch +yes +n/a +<livepatch_desc>
2510- """
2511- And stdout matches regexp:
2512- """
2513- <cis_or_usg> +yes +<cis> +Security compliance and audit tools
2514+ esm-apps +yes +enabled +Expanded Security Maintenance for Applications
2515+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
2516 """
2517 And stderr matches regexp:
2518 """
2519 Enabling default service esm-infra
2520 """
2521- When I verify that running `ua attach contract_token` `with sudo` exits `2`
2522+ When I verify that running `pro attach contract_token` `with sudo` exits `2`
2523 Then stderr matches regexp:
2524 """
2525 This machine is already attached to '.+'
2526- To use a different subscription first run: sudo ua detach.
2527- """
2528- When I run `ua disable esm-apps --assume-yes` with sudo
2529- When I append the following on uaclient config:
2530- """
2531- features:
2532- allow_beta: true
2533- """
2534- And I run `apt update` with sudo
2535- And I run `ua refresh messages` with sudo
2536- And I run `update-motd` with sudo
2537- Then if `<release>` in `focal` and stdout matches regexp:
2538- """
2539- \* Introducing Extended Security Maintenance for Applications.
2540- +Receive updates to over 30,000 software packages with your
2541- +Ubuntu Advantage subscription. Free for personal use.
2542-
2543- +https:\/\/ubuntu.com\/esm
2544-
2545- \d+ update(s)? can be applied immediately.
2546- \d+ of these updates (is|are) (a|an)? UA Infra: ESM security update(s)?.
2547- (\d+ of these updates (is a|are) standard security update(s)?.)?
2548- ?To see these additional updates run: apt list --upgradable
2549- """
2550- Then if `<release>` in `bionic` and stdout matches regexp:
2551- """
2552- \* Introducing Extended Security Maintenance for Applications.
2553- +Receive updates to over 30,000 software packages with your
2554- +Ubuntu Advantage subscription. Free for personal use.
2555-
2556- +https:\/\/ubuntu.com\/esm
2557-
2558- \d+ update(s)? can be applied immediately.
2559- \d+ of these updates (is a|are) standard security update(s)?.
2560- To see these additional updates run: apt list --upgradable
2561- """
2562- Then if `<release>` in `xenial` and stdout matches regexp:
2563- """
2564- \* Introducing Extended Security Maintenance for Applications.
2565- +Receive updates to over 30,000 software packages with your
2566- +Ubuntu Advantage subscription. Free for personal use.
2567-
2568- +https:\/\/ubuntu.com\/16-04
2569-
2570- UA Infra: Extended Security Maintenance \(ESM\) is enabled.
2571-
2572- \d+ update(s)? can be applied immediately.
2573- \d+ of these updates (is|are) UA Infra: ESM security update(s)?.
2574- \d+ of these updates (is a|are) standard security update(s)?.
2575- To see these additional updates run: apt list --upgradable
2576- """
2577- When I update contract to use `effectiveTo` as `days=-20`
2578- And I delete the file `/var/lib/ubuntu-advantage/jobs-status.json`
2579- And I run `python3 /usr/lib/ubuntu-advantage/timer.py` with sudo
2580- And I run `update-motd` with sudo
2581- Then if `<release>` in `xenial` and stdout matches regexp:
2582- """
2583-
2584- \*Your UA Infra: ESM subscription has EXPIRED\*
2585-
2586- \d+ additional security update\(s\) could have been applied via UA Infra: ESM.
2587-
2588- Renew your UA services at https:\/\/ubuntu.com\/advantage
2589-
2590- """
2591- Then if `<release>` in `xenial` and stdout matches regexp:
2592- """
2593-
2594- Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
2595- applicable law.
2596-
2597- """
2598- When I run `apt upgrade --dry-run` with sudo
2599- Then if `<release>` in `xenial` and stdout matches regexp:
2600- """
2601- \*Your UA Infra: ESM subscription has EXPIRED\*
2602- Enabling UA Infra: ESM service would provide security updates for following packages:
2603- .*
2604- \d+ esm-infra security update\(s\) NOT APPLIED. Renew your UA services at
2605- https:\/\/ubuntu.com\/advantage
2606-
2607+ To use a different subscription first run: sudo pro detach.
2608 """
2609
2610 Examples: ubuntu release packages
2611@@ -185,7 +93,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2612 token: <contract_token>
2613 """
2614 When I replace `<contract_token>` in `/tmp/attach.yaml` with token `contract_token`
2615- When I run `ua attach --attach-config /tmp/attach.yaml` with sudo
2616+ When I run `pro attach --attach-config /tmp/attach.yaml` with sudo
2617 Then stdout matches regexp:
2618 """
2619 esm-apps +yes +enabled
2620@@ -198,9 +106,9 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2621 """
2622 <cis_or_usg> +yes +disabled
2623 """
2624- When I run `ua detach --assume-yes` with sudo
2625+ When I run `pro detach --assume-yes` with sudo
2626 # don't allow both token on cli and config
2627- Then I verify that running `ua attach TOKEN --attach-config /tmp/attach.yaml` `with sudo` exits `1`
2628+ Then I verify that running `pro attach TOKEN --attach-config /tmp/attach.yaml` `with sudo` exits `1`
2629 Then stderr matches regexp:
2630 """
2631 Do not pass the TOKEN arg if you are using --attach-config.
2632@@ -215,7 +123,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2633 - <cis_or_usg>
2634 """
2635 When I replace `<contract_token>` in `/tmp/attach.yaml` with token `contract_token`
2636- When I run `ua attach --attach-config /tmp/attach.yaml` with sudo
2637+ When I run `pro attach --attach-config /tmp/attach.yaml` with sudo
2638 Then stdout matches regexp:
2639 """
2640 esm-apps +yes +enabled
2641@@ -228,7 +136,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2642 """
2643 <cis_or_usg> +yes +enabled
2644 """
2645- When I run `ua detach --assume-yes` with sudo
2646+ When I run `pro detach --assume-yes` with sudo
2647 # missing token
2648 When I create the file `/tmp/attach.yaml` with the following
2649 """
2650@@ -236,7 +144,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2651 - esm-apps
2652 - <cis_or_usg>
2653 """
2654- Then I verify that running `ua attach --attach-config /tmp/attach.yaml` `with sudo` exits `1`
2655+ Then I verify that running `pro attach --attach-config /tmp/attach.yaml` `with sudo` exits `1`
2656 Then stderr matches regexp:
2657 """
2658 Error while reading /tmp/attach.yaml: Got value with incorrect type for field
2659@@ -249,7 +157,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2660 enable_services: {cis: true}
2661 """
2662 When I replace `<contract_token>` in `/tmp/attach.yaml` with token `contract_token`
2663- Then I verify that running `ua attach --attach-config /tmp/attach.yaml` `with sudo` exits `1`
2664+ Then I verify that running `pro attach --attach-config /tmp/attach.yaml` `with sudo` exits `1`
2665 Then stderr matches regexp:
2666 """
2667 Error while reading /tmp/attach.yaml: Got value with incorrect type for field
2668@@ -265,7 +173,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2669 - nonexistent2
2670 """
2671 When I replace `<contract_token>` in `/tmp/attach.yaml` with token `contract_token`
2672- Then I verify that running `ua attach --attach-config /tmp/attach.yaml` `with sudo` exits `1`
2673+ Then I verify that running `pro attach --attach-config /tmp/attach.yaml` `with sudo` exits `1`
2674 Then stdout matches regexp:
2675 """
2676 esm-apps +yes +enabled
2677@@ -311,7 +219,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2678 And I attach `contract_token` with sudo
2679 Then stdout matches regexp:
2680 """
2681- UA Infra: ESM enabled
2682+ Ubuntu Pro: ESM Infra enabled
2683 """
2684 And stdout matches regexp:
2685 """
2686@@ -319,19 +227,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2687 """
2688 And stdout matches regexp:
2689 """
2690- SERVICE +ENTITLED STATUS DESCRIPTION
2691- cc-eal +yes +<cc_status> +Common Criteria EAL2 Provisioning Packages
2692- """
2693- And stdout matches regexp:
2694- """
2695- esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\)
2696- fips +yes +<fips_status> +NIST-certified core packages
2697- fips-updates +yes +<fips_status> +NIST-certified core packages with priority security updates
2698- livepatch +yes +<lp_status> +<lp_desc>
2699- """
2700- And stdout matches regexp:
2701- """
2702- <cis_or_usg> +yes +<cis_status> +Security compliance and audit tools
2703+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
2704 """
2705 And stderr matches regexp:
2706 """
2707@@ -372,7 +268,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2708 And I attach `contract_token` with sudo
2709 Then stdout matches regexp:
2710 """
2711- UA Infra: ESM enabled
2712+ Ubuntu Pro: ESM Infra enabled
2713 """
2714 And stdout matches regexp:
2715 """
2716@@ -380,19 +276,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2717 """
2718 And stdout matches regexp:
2719 """
2720- SERVICE +ENTITLED STATUS DESCRIPTION
2721- cc-eal +yes +<cc_status> +Common Criteria EAL2 Provisioning Packages
2722- """
2723- And stdout matches regexp:
2724- """
2725- esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\)
2726- fips +yes +<fips_status> +NIST-certified core packages
2727- fips-updates +yes +<fips_status> +NIST-certified core packages with priority security updates
2728- livepatch +yes +<lp_status> +Canonical Livepatch service
2729- """
2730- And stdout matches regexp:
2731- """
2732- <cis_or_usg> +yes +<cis_status> +Security compliance and audit tools
2733+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
2734 """
2735 And stderr matches regexp:
2736 """
2737@@ -433,7 +317,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2738 And I attach `contract_token` with sudo
2739 Then stdout matches regexp:
2740 """
2741- UA Infra: ESM enabled
2742+ Ubuntu Pro: ESM Infra enabled
2743 """
2744 And stdout matches regexp:
2745 """
2746@@ -441,19 +325,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2747 """
2748 And stdout matches regexp:
2749 """
2750- SERVICE +ENTITLED STATUS DESCRIPTION
2751- cc-eal +yes +<cc_status> +Common Criteria EAL2 Provisioning Packages
2752- """
2753- And stdout matches regexp:
2754- """
2755- esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\)
2756- fips +yes +<fips_status> +NIST-certified core packages
2757- fips-updates +yes +<fips_status> +NIST-certified core packages with priority security updates
2758- livepatch +yes +<lp_status> +Canonical Livepatch service
2759- """
2760- And stdout matches regexp:
2761- """
2762- <cis_or_usg> +yes +<cis_status> +Security compliance and audit tools
2763+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
2764 """
2765 And stderr matches regexp:
2766 """
2767@@ -481,16 +353,11 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2768 """
2769 {"_schema_version": "0.1", "errors": [], "failed_services": [], "needs_reboot": false, "processed_services": ["esm-apps", "esm-infra"], "result": "success", "warnings": []}
2770 """
2771- When I run `ua status` with sudo
2772+ When I run `pro status` with sudo
2773 Then stdout matches regexp:
2774 """
2775- SERVICE +ENTITLED STATUS DESCRIPTION
2776- cc-eal +yes +<cc-eal> +Common Criteria EAL2 Provisioning Packages
2777- """
2778- And stdout matches regexp:
2779- """
2780- esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\)
2781- esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\)
2782+ esm-apps +yes +enabled +Expanded Security Maintenance for Applications
2783+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
2784 """
2785
2786 Examples: ubuntu release
2787@@ -507,7 +374,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2788 When I attach `contract_token` with sudo
2789 Then stdout matches regexp:
2790 """
2791- UA Infra: ESM enabled
2792+ Ubuntu Pro: ESM Infra enabled
2793 """
2794 And stdout matches regexp:
2795 """
2796@@ -515,7 +382,7 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2797 """
2798 And stdout matches regexp:
2799 """
2800- esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\)
2801+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
2802 """
2803 When I create the file `/tmp/machine-token-overlay.json` with the following:
2804 """
2805@@ -532,23 +399,23 @@ Feature: Command behaviour when attaching a machine to an Ubuntu Advantage
2806 features:
2807 machine_token_overlay: "/tmp/machine-token-overlay.json"
2808 """
2809- When I run `ua status` with sudo
2810+ When I run `pro status` with sudo
2811 Then stdout matches regexp:
2812 """
2813 A change has been detected in your contract.
2814- Please run `sudo ua refresh`.
2815+ Please run `sudo pro refresh`.
2816 """
2817- When I run `ua refresh contract` with sudo
2818+ When I run `pro refresh contract` with sudo
2819 Then stdout matches regexp:
2820 """
2821 Successfully refreshed your subscription.
2822 """
2823 When I run `sed -i '/^.*machine_token_overlay:/d' /etc/ubuntu-advantage/uaclient.conf` with sudo
2824- And I run `ua status` with sudo
2825+ And I run `pro status` with sudo
2826 Then stdout does not match regexp:
2827 """
2828 A change has been detected in your contract.
2829- Please run `sudo ua refresh`.
2830+ Please run `sudo pro refresh`.
2831 """
2832
2833 Examples: ubuntu release livepatch status
2834diff --git a/features/attached_commands.feature b/features/attached_commands.feature
2835index 2707f5c..faa8d52 100644
2836--- a/features/attached_commands.feature
2837+++ b/features/attached_commands.feature
2838@@ -1,37 +1,37 @@
2839 @uses.config.contract_token
2840-Feature: Command behaviour when attached to an UA subscription
2841+Feature: Command behaviour when attached to an Ubuntu Pro subscription
2842
2843 @series.all
2844 @uses.config.machine_type.lxd.container
2845 Scenario Outline: Attached refresh in a ubuntu machine
2846 Given a `<release>` machine with ubuntu-advantage-tools installed
2847 When I attach `contract_token` with sudo
2848- Then I verify that running `ua refresh` `as non-root` exits `1`
2849+ Then I verify that running `pro refresh` `as non-root` exits `1`
2850 And stderr matches regexp:
2851 """
2852 This command must be run as root \(try using sudo\).
2853 """
2854- When I run `ua refresh` with sudo
2855+ When I run `pro refresh` with sudo
2856 Then I will see the following on stdout:
2857 """
2858- Successfully processed your ua configuration.
2859+ Successfully processed your pro configuration.
2860 Successfully refreshed your subscription.
2861- Successfully updated UA related APT and MOTD messages.
2862+ Successfully updated Ubuntu Pro related APT and MOTD messages.
2863 """
2864- When I run `ua refresh config` with sudo
2865+ When I run `pro refresh config` with sudo
2866 Then I will see the following on stdout:
2867 """
2868- Successfully processed your ua configuration.
2869+ Successfully processed your pro configuration.
2870 """
2871- When I run `ua refresh contract` with sudo
2872+ When I run `pro refresh contract` with sudo
2873 Then I will see the following on stdout:
2874 """
2875 Successfully refreshed your subscription.
2876 """
2877- When I run `ua refresh messages` with sudo
2878+ When I run `pro refresh messages` with sudo
2879 Then I will see the following on stdout:
2880 """
2881- Successfully updated UA related APT and MOTD messages.
2882+ Successfully updated Ubuntu Pro related APT and MOTD messages.
2883 """
2884 When I run `python3 /usr/lib/ubuntu-advantage/timer.py` with sudo
2885 And I run `sh -c "ls /var/log/ubuntu-advantage* | sort -d"` as non-root
2886@@ -55,25 +55,24 @@ Feature: Command behaviour when attached to an UA subscription
2887 | bionic |
2888 | focal |
2889 | xenial |
2890- | impish |
2891 | jammy |
2892-
2893+ | kinetic |
2894
2895 @series.all
2896 @uses.config.machine_type.lxd.container
2897 Scenario Outline: Attached disable of an already disabled service in a ubuntu machine
2898 Given a `<release>` machine with ubuntu-advantage-tools installed
2899 When I attach `contract_token` with sudo
2900- Then I verify that running `ua disable livepatch` `as non-root` exits `1`
2901+ Then I verify that running `pro disable livepatch` `as non-root` exits `1`
2902 And stderr matches regexp:
2903 """
2904 This command must be run as root \(try using sudo\).
2905 """
2906- And I verify that running `ua disable livepatch` `with sudo` exits `1`
2907+ And I verify that running `pro disable livepatch` `with sudo` exits `1`
2908 And I will see the following on stdout:
2909 """
2910 Livepatch is not currently enabled
2911- See: sudo ua status
2912+ See: sudo pro status
2913 """
2914
2915 Examples: ubuntu release
2916@@ -81,52 +80,52 @@ Feature: Command behaviour when attached to an UA subscription
2917 | bionic |
2918 | focal |
2919 | xenial |
2920- | impish |
2921 | jammy |
2922+ | kinetic |
2923
2924 @series.lts
2925 @uses.config.machine_type.lxd.container
2926 Scenario Outline: Attached disable with json format
2927 Given a `<release>` machine with ubuntu-advantage-tools installed
2928 When I attach `contract_token` with sudo
2929- Then I verify that running `ua disable foobar --format json` `as non-root` exits `1`
2930+ Then I verify that running `pro disable foobar --format json` `as non-root` exits `1`
2931 And stdout is a json matching the `ua_operation` schema
2932 And I will see the following on stdout:
2933 """
2934 {"_schema_version": "0.1", "errors": [{"message": "json formatted response requires --assume-yes flag.", "message_code": "json-format-require-assume-yes", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
2935 """
2936- Then I verify that running `ua disable foobar --format json` `with sudo` exits `1`
2937+ Then I verify that running `pro disable foobar --format json` `with sudo` exits `1`
2938 And stdout is a json matching the `ua_operation` schema
2939 And I will see the following on stdout:
2940 """
2941 {"_schema_version": "0.1", "errors": [{"message": "json formatted response requires --assume-yes flag.", "message_code": "json-format-require-assume-yes", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
2942 """
2943- Then I verify that running `ua disable foobar --format json --assume-yes` `as non-root` exits `1`
2944+ Then I verify that running `pro disable foobar --format json --assume-yes` `as non-root` exits `1`
2945 And stdout is a json matching the `ua_operation` schema
2946 And I will see the following on stdout:
2947 """
2948 {"_schema_version": "0.1", "errors": [{"message": "This command must be run as root (try using sudo).", "message_code": "nonroot-user", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
2949 """
2950- And I verify that running `ua disable foobar --format json --assume-yes` `with sudo` exits `1`
2951+ And I verify that running `pro disable foobar --format json --assume-yes` `with sudo` exits `1`
2952 And stdout is a json matching the `ua_operation` schema
2953 And I will see the following on stdout:
2954 """
2955 {"_schema_version": "0.1", "errors": [{"message": "Cannot disable unknown service 'foobar'.\nTry <valid_services>", "message_code": "invalid-service-or-failure", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
2956 """
2957- And I verify that running `ua disable livepatch --format json --assume-yes` `with sudo` exits `1`
2958+ And I verify that running `pro disable livepatch --format json --assume-yes` `with sudo` exits `1`
2959 And stdout is a json matching the `ua_operation` schema
2960 And I will see the following on stdout:
2961 """
2962- {"_schema_version": "0.1", "errors": [{"message": "Livepatch is not currently enabled\nSee: sudo ua status", "message_code": "service-already-disabled", "service": "livepatch", "type": "service"}], "failed_services": ["livepatch"], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
2963+ {"_schema_version": "0.1", "errors": [{"message": "Livepatch is not currently enabled\nSee: sudo pro status", "message_code": "service-already-disabled", "service": "livepatch", "type": "service"}], "failed_services": ["livepatch"], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
2964 """
2965- And I verify that running `ua disable esm-infra esm-apps --format json --assume-yes` `with sudo` exits `0`
2966+ And I verify that running `pro disable esm-infra esm-apps --format json --assume-yes` `with sudo` exits `0`
2967 And stdout is a json matching the `ua_operation` schema
2968 And I will see the following on stdout:
2969 """
2970 {"_schema_version": "0.1", "errors": [], "failed_services": [], "needs_reboot": false, "processed_services": ["esm-apps", "esm-infra"], "result": "success", "warnings": []}
2971 """
2972- When I run `ua enable esm-infra` with sudo
2973- Then I verify that running `ua disable esm-infra foobar --format json --assume-yes` `with sudo` exits `1`
2974+ When I run `pro enable esm-infra` with sudo
2975+ Then I verify that running `pro disable esm-infra foobar --format json --assume-yes` `with sudo` exits `1`
2976 And stdout is a json matching the `ua_operation` schema
2977 And I will see the following on stdout:
2978 """
2979@@ -147,31 +146,31 @@ Feature: Command behaviour when attached to an UA subscription
2980 Scenario Outline: Attached disable of a service in a ubuntu machine
2981 Given a `<release>` machine with ubuntu-advantage-tools installed
2982 When I attach `contract_token` with sudo
2983- Then I verify that running `ua disable foobar` `as non-root` exits `1`
2984+ Then I verify that running `pro disable foobar` `as non-root` exits `1`
2985 And stderr matches regexp:
2986 """
2987 This command must be run as root \(try using sudo\).
2988 """
2989- And I verify that running `ua disable foobar` `with sudo` exits `1`
2990+ And I verify that running `pro disable foobar` `with sudo` exits `1`
2991 And stderr matches regexp:
2992 """
2993 Cannot disable unknown service 'foobar'.
2994 <msg>
2995 """
2996- And I verify that running `ua disable esm-infra` `as non-root` exits `1`
2997+ And I verify that running `pro disable esm-infra` `as non-root` exits `1`
2998 And stderr matches regexp:
2999 """
3000 This command must be run as root \(try using sudo\).
3001 """
3002- When I run `ua disable esm-infra` with sudo
3003+ When I run `pro disable esm-infra` with sudo
3004 Then I will see the following on stdout:
3005 """
3006 Updating package lists
3007 """
3008- When I run `ua status` with sudo
3009+ When I run `pro status` with sudo
3010 Then stdout matches regexp:
3011 """
3012- esm-infra +yes +disabled +UA Infra: Extended Security Maintenance \(ESM\)
3013+ esm-infra +yes +disabled +Expanded Security Maintenance for Infrastructure
3014 """
3015 And I verify that running `apt update` `with sudo` exits `0`
3016
3017@@ -186,32 +185,32 @@ Feature: Command behaviour when attached to an UA subscription
3018 Scenario: Attached disable of a service in a ubuntu machine
3019 Given a `focal` machine with ubuntu-advantage-tools installed
3020 When I attach `contract_token` with sudo
3021- Then I verify that running `ua disable foobar` `as non-root` exits `1`
3022+ Then I verify that running `pro disable foobar` `as non-root` exits `1`
3023 And stderr matches regexp:
3024 """
3025 This command must be run as root \(try using sudo\).
3026 """
3027- And I verify that running `ua disable foobar` `with sudo` exits `1`
3028+ And I verify that running `pro disable foobar` `with sudo` exits `1`
3029 And stderr matches regexp:
3030 """
3031 Cannot disable unknown service 'foobar'.
3032 Try cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch, realtime-kernel,
3033 ros, ros-updates, usg.
3034 """
3035- And I verify that running `ua disable esm-infra` `as non-root` exits `1`
3036+ And I verify that running `pro disable esm-infra` `as non-root` exits `1`
3037 And stderr matches regexp:
3038 """
3039 This command must be run as root \(try using sudo\).
3040 """
3041- When I run `ua disable esm-infra` with sudo
3042+ When I run `pro disable esm-infra` with sudo
3043 Then I will see the following on stdout:
3044 """
3045 Updating package lists
3046 """
3047- When I run `ua status` with sudo
3048+ When I run `pro status` with sudo
3049 Then stdout matches regexp:
3050 """
3051- esm-infra +yes +disabled +UA Infra: Extended Security Maintenance \(ESM\)
3052+ esm-infra +yes +disabled +Expanded Security Maintenance for Infrastructure
3053 """
3054 And I verify that running `apt update` `with sudo` exits `0`
3055
3056@@ -221,12 +220,12 @@ Feature: Command behaviour when attached to an UA subscription
3057 Scenario Outline: Attached detach in an ubuntu machine
3058 Given a `<release>` machine with ubuntu-advantage-tools installed
3059 When I attach `contract_token` with sudo
3060- Then I verify that running `ua detach` `as non-root` exits `1`
3061+ Then I verify that running `pro detach` `as non-root` exits `1`
3062 And stderr matches regexp:
3063 """
3064 This command must be run as root \(try using sudo\).
3065 """
3066- When I run `ua detach --assume-yes` with sudo
3067+ When I run `pro detach --assume-yes` with sudo
3068 Then I will see the following on stdout:
3069 """
3070 Detach will disable the following services:
3071@@ -236,7 +235,7 @@ Feature: Command behaviour when attached to an UA subscription
3072 Updating package lists
3073 This machine is now detached.
3074 """
3075- When I run `ua status --all` as non-root
3076+ When I run `pro status --all` as non-root
3077 Then stdout matches regexp:
3078 """
3079 SERVICE +AVAILABLE DESCRIPTION
3080@@ -244,8 +243,8 @@ Feature: Command behaviour when attached to an UA subscription
3081 """
3082 Then stdout matches regexp:
3083 """
3084- esm-apps +<esm-apps> +UA Apps: Extended Security Maintenance \(ESM\)
3085- esm-infra +yes +UA Infra: Extended Security Maintenance \(ESM\)
3086+ esm-apps +<esm-apps> +Expanded Security Maintenance for Applications
3087+ esm-infra +yes +Expanded Security Maintenance for Infrastructure
3088 fips +<fips> +NIST-certified core packages
3089 fips-updates +<fips> +NIST-certified core packages with priority security updates
3090 livepatch +(yes|no) +Canonical Livepatch service
3091@@ -259,29 +258,29 @@ Feature: Command behaviour when attached to an UA subscription
3092 """
3093 And stdout matches regexp:
3094 """
3095- This machine is not attached to a UA subscription.
3096+ This machine is not attached to an Ubuntu Pro subscription.
3097 """
3098 And I verify that running `apt update` `with sudo` exits `0`
3099 When I attach `contract_token` with sudo
3100- Then I verify that running `ua enable foobar --format json` `as non-root` exits `1`
3101+ Then I verify that running `pro enable foobar --format json` `as non-root` exits `1`
3102 And stdout is a json matching the `ua_operation` schema
3103 And I will see the following on stdout:
3104 """
3105 {"_schema_version": "0.1", "errors": [{"message": "json formatted response requires --assume-yes flag.", "message_code": "json-format-require-assume-yes", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
3106 """
3107- Then I verify that running `ua enable foobar --format json` `with sudo` exits `1`
3108+ Then I verify that running `pro enable foobar --format json` `with sudo` exits `1`
3109 And stdout is a json matching the `ua_operation` schema
3110 And I will see the following on stdout:
3111 """
3112 {"_schema_version": "0.1", "errors": [{"message": "json formatted response requires --assume-yes flag.", "message_code": "json-format-require-assume-yes", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
3113 """
3114- Then I verify that running `ua detach --format json --assume-yes` `as non-root` exits `1`
3115+ Then I verify that running `pro detach --format json --assume-yes` `as non-root` exits `1`
3116 And stdout is a json matching the `ua_operation` schema
3117 And I will see the following on stdout:
3118 """
3119 {"_schema_version": "0.1", "errors": [{"message": "This command must be run as root (try using sudo).", "message_code": "nonroot-user", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
3120 """
3121- When I run `ua detach --format json --assume-yes` with sudo
3122+ When I run `pro detach --format json --assume-yes` with sudo
3123 Then stdout is a json matching the `ua_operation` schema
3124 And I will see the following on stdout:
3125 """
3126@@ -300,15 +299,15 @@ Feature: Command behaviour when attached to an UA subscription
3127 Scenario Outline: Attached auto-attach in a ubuntu machine
3128 Given a `<release>` machine with ubuntu-advantage-tools installed
3129 When I attach `contract_token` with sudo
3130- Then I verify that running `ua auto-attach` `as non-root` exits `1`
3131+ Then I verify that running `pro auto-attach` `as non-root` exits `1`
3132 And stderr matches regexp:
3133 """
3134 This command must be run as root \(try using sudo\).
3135 """
3136- When I verify that running `ua auto-attach` `with sudo` exits `2`
3137+ When I verify that running `pro auto-attach` `with sudo` exits `0`
3138 Then stderr matches regexp:
3139 """
3140- This machine is already attached
3141+ Skipping auto-attach: Instance is already attached.
3142 """
3143
3144 Examples: ubuntu release
3145@@ -316,21 +315,21 @@ Feature: Command behaviour when attached to an UA subscription
3146 | bionic |
3147 | focal |
3148 | xenial |
3149- | impish |
3150 | jammy |
3151+ | kinetic |
3152
3153 @series.all
3154 @uses.config.machine_type.lxd.container
3155 Scenario Outline: Attached show version in a ubuntu machine
3156 Given a `<release>` machine with ubuntu-advantage-tools installed
3157 When I attach `contract_token` with sudo
3158- And I run `ua version` as non-root
3159+ And I run `pro version` as non-root
3160 Then I will see the uaclient version on stdout
3161- When I run `ua version` with sudo
3162+ When I run `pro version` with sudo
3163 Then I will see the uaclient version on stdout
3164- When I run `ua --version` as non-root
3165+ When I run `pro --version` as non-root
3166 Then I will see the uaclient version on stdout
3167- When I run `ua --version` with sudo
3168+ When I run `pro --version` with sudo
3169 Then I will see the uaclient version on stdout
3170
3171 Examples: ubuntu release
3172@@ -338,8 +337,8 @@ Feature: Command behaviour when attached to an UA subscription
3173 | bionic |
3174 | focal |
3175 | xenial |
3176- | impish |
3177 | jammy |
3178+ | kinetic |
3179
3180 @series.all
3181 @uses.config.machine_type.lxd.container
3182@@ -368,7 +367,7 @@ Feature: Command behaviour when attached to an UA subscription
3183 other: false
3184 """
3185 And I attach `contract_token` with sudo
3186- And I run `ua status --all` with sudo
3187+ And I run `pro status --all` with sudo
3188 Then stdout matches regexp:
3189 """
3190 SERVICE +ENTITLED STATUS DESCRIPTION
3191@@ -381,7 +380,7 @@ Feature: Command behaviour when attached to an UA subscription
3192 machine_token_overlay: /tmp/machine-token-overlay.json
3193 other: False
3194 """
3195- When I run `ua status --all` as non-root
3196+ When I run `pro status --all` as non-root
3197 Then stdout matches regexp:
3198 """
3199 SERVICE +ENTITLED STATUS DESCRIPTION
3200@@ -394,7 +393,8 @@ Feature: Command behaviour when attached to an UA subscription
3201 machine_token_overlay: /tmp/machine-token-overlay.json
3202 other: False
3203 """
3204- When I run `ua auto-attach` with sudo
3205+ When I run `pro detach --assume-yes` with sudo
3206+ When I run `pro auto-attach` with sudo
3207 Then stdout matches regexp:
3208 """
3209 Skipping auto-attach. Config disable_auto_attach is set.
3210@@ -405,8 +405,8 @@ Feature: Command behaviour when attached to an UA subscription
3211 | bionic |
3212 | focal |
3213 | xenial |
3214- | impish |
3215 | jammy |
3216+ | kinetic |
3217
3218 @series.xenial
3219 @series.bionic
3220@@ -414,17 +414,17 @@ Feature: Command behaviour when attached to an UA subscription
3221 Scenario Outline: Attached disable of different services in a ubuntu machine
3222 Given a `<release>` machine with ubuntu-advantage-tools installed
3223 When I attach `contract_token` with sudo
3224- Then I verify that running `ua disable esm-infra livepatch foobar` `as non-root` exits `1`
3225+ Then I verify that running `pro disable esm-infra livepatch foobar` `as non-root` exits `1`
3226 And stderr matches regexp:
3227 """
3228 This command must be run as root \(try using sudo\)
3229 """
3230- And I verify that running `ua disable esm-infra livepatch foobar` `with sudo` exits `1`
3231+ And I verify that running `pro disable esm-infra livepatch foobar` `with sudo` exits `1`
3232 And I will see the following on stdout:
3233 """
3234 Updating package lists
3235 Livepatch is not currently enabled
3236- See: sudo ua status
3237+ See: sudo pro status
3238 """
3239 And stderr matches regexp:
3240 """
3241@@ -432,18 +432,18 @@ Feature: Command behaviour when attached to an UA subscription
3242 Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch,
3243 realtime-kernel, ros, ros-updates.
3244 """
3245- When I run `ua status` with sudo
3246+ When I run `pro status` with sudo
3247 Then stdout matches regexp:
3248 """
3249- esm-infra +yes +disabled +UA Infra: Extended Security Maintenance \(ESM\)
3250+ esm-infra +yes +disabled +Expanded Security Maintenance for Infrastructure
3251 """
3252 When I run `touch /var/run/reboot-required` with sudo
3253 And I run `touch /var/run/reboot-required.pkgs` with sudo
3254- And I run `ua enable esm-infra` with sudo
3255+ And I run `pro enable esm-infra` with sudo
3256 Then stdout matches regexp:
3257 """
3258 Updating package lists
3259- UA Infra: ESM enabled
3260+ Ubuntu Pro: ESM Infra enabled
3261 """
3262 And stdout does not match regexp:
3263 """
3264@@ -461,17 +461,17 @@ Feature: Command behaviour when attached to an UA subscription
3265 Scenario: Attached disable of different services in a ubuntu machine
3266 Given a `focal` machine with ubuntu-advantage-tools installed
3267 When I attach `contract_token` with sudo
3268- Then I verify that running `ua disable esm-infra livepatch foobar` `as non-root` exits `1`
3269+ Then I verify that running `pro disable esm-infra livepatch foobar` `as non-root` exits `1`
3270 And stderr matches regexp:
3271 """
3272 This command must be run as root \(try using sudo\)
3273 """
3274- And I verify that running `ua disable esm-infra livepatch foobar` `with sudo` exits `1`
3275+ And I verify that running `pro disable esm-infra livepatch foobar` `with sudo` exits `1`
3276 And I will see the following on stdout:
3277 """
3278 Updating package lists
3279 Livepatch is not currently enabled
3280- See: sudo ua status
3281+ See: sudo pro status
3282 """
3283 And stderr matches regexp:
3284 """
3285@@ -479,18 +479,18 @@ Feature: Command behaviour when attached to an UA subscription
3286 Try cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch, realtime-kernel,
3287 ros, ros-updates, usg.
3288 """
3289- When I run `ua status` with sudo
3290+ When I run `pro status` with sudo
3291 Then stdout matches regexp:
3292 """
3293- esm-infra +yes +disabled +UA Infra: Extended Security Maintenance \(ESM\)
3294+ esm-infra +yes +disabled +Expanded Security Maintenance for Infrastructure
3295 """
3296 When I run `touch /var/run/reboot-required` with sudo
3297 And I run `touch /var/run/reboot-required.pkgs` with sudo
3298- And I run `ua enable esm-infra` with sudo
3299+ And I run `pro enable esm-infra` with sudo
3300 Then stdout matches regexp:
3301 """
3302 Updating package lists
3303- UA Infra: ESM enabled
3304+ Ubuntu Pro: ESM Infra enabled
3305 """
3306 And stdout does not match regexp:
3307 """
3308@@ -502,46 +502,47 @@ Feature: Command behaviour when attached to an UA subscription
3309 Scenario Outline: Help command on an attached machine
3310 Given a `<release>` machine with ubuntu-advantage-tools installed
3311 When I attach `contract_token` with sudo
3312- And I run `ua help esm-infra` with sudo
3313+ And I run `pro help esm-infra` with sudo
3314 Then I will see the following on stdout:
3315- """
3316- Name:
3317- esm-infra
3318+ """
3319+ Name:
3320+ esm-infra
3321
3322- Entitled:
3323- yes
3324+ Entitled:
3325+ yes
3326
3327- Status:
3328- <infra-status>
3329+ Status:
3330+ <infra-status>
3331
3332- Help:
3333- esm-infra provides access to a private ppa which includes available high
3334- and critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main
3335- repository between the end of the standard Ubuntu LTS security
3336- maintenance and its end of life. It is enabled by default with
3337- Extended Security Maintenance (ESM) for UA Apps and UA Infra.
3338- You can find our more about the esm service at
3339- https://ubuntu.com/security/esm
3340- """
3341- When I run `ua help esm-infra --format json` with sudo
3342+ Help:
3343+ Expanded Security Maintenance for Infrastructure provides access
3344+ to a private ppa which includes available high and critical CVE fixes
3345+ for Ubuntu LTS packages in the Ubuntu Main repository between the end
3346+ of the standard Ubuntu LTS security maintenance and its end of life.
3347+ It is enabled by default with Ubuntu Pro. You can find out more about
3348+ the service at https://ubuntu.com/security/esm
3349+ """
3350+ When I run `pro help esm-infra --format json` with sudo
3351 Then I will see the following on stdout:
3352- """
3353- {"name": "esm-infra", "entitled": "yes", "status": "<infra-status>", "help": "esm-infra provides access to a private ppa which includes available high\nand critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main\nrepository between the end of the standard Ubuntu LTS security\nmaintenance and its end of life. It is enabled by default with\nExtended Security Maintenance (ESM) for UA Apps and UA Infra.\nYou can find our more about the esm service at\nhttps://ubuntu.com/security/esm\n"}
3354- """
3355- And I verify that running `ua help invalid-service` `with sudo` exits `1`
3356+ """
3357+ {"name": "esm-infra", "entitled": "yes", "status": "<infra-status>", "help": "Expanded Security Maintenance for Infrastructure provides access\nto a private ppa which includes available high and critical CVE fixes\nfor Ubuntu LTS packages in the Ubuntu Main repository between the end\nof the standard Ubuntu LTS security maintenance and its end of life.\nIt is enabled by default with Ubuntu Pro. You can find out more about\nthe service at https://ubuntu.com/security/esm\n"}
3358+ """
3359+ And I verify that running `pro help invalid-service` `with sudo` exits `1`
3360 And I will see the following on stderr:
3361- """
3362- No help available for 'invalid-service'
3363- """
3364- When I run `ua --help` as non-root
3365+ """
3366+ No help available for 'invalid-service'
3367+ """
3368+ When I run `pro --help` as non-root
3369 Then stdout matches regexp:
3370 """
3371- Client to manage Ubuntu Advantage services on a machine.
3372+ Client to manage Ubuntu Pro services on a machine.
3373 - cc-eal: Common Criteria EAL2 Provisioning Packages
3374 \(https://ubuntu.com/cc-eal\)
3375 - cis: Security compliance and audit tools
3376 \(https://ubuntu.com/security/certifications/docs/usg\)
3377- - esm-infra: UA Infra: Extended Security Maintenance \(ESM\)
3378+ - esm-apps: Expanded Security Maintenance for Applications
3379+ \(https://ubuntu.com/security/esm\)
3380+ - esm-infra: Expanded Security Maintenance for Infrastructure
3381 \(https://ubuntu.com/security/esm\)
3382 - fips-updates: NIST-certified core packages with priority security updates
3383 \(https://ubuntu.com/security/certifications#fips\)
3384@@ -549,16 +550,22 @@ Feature: Command behaviour when attached to an UA subscription
3385 \(https://ubuntu.com/security/certifications#fips\)
3386 - livepatch: Canonical Livepatch service
3387 \(https://ubuntu.com/security/livepatch\)
3388+ - ros-updates: All Updates for the Robot Operating System
3389+ \(https://ubuntu.com/robotics/ros-esm\)
3390+ - ros: Security Updates for the Robot Operating System
3391+ \(https://ubuntu.com/robotics/ros-esm\)
3392 """
3393- When I run `ua help` with sudo
3394+ When I run `pro help` with sudo
3395 Then stdout matches regexp:
3396 """
3397- Client to manage Ubuntu Advantage services on a machine.
3398+ Client to manage Ubuntu Pro services on a machine.
3399 - cc-eal: Common Criteria EAL2 Provisioning Packages
3400 \(https://ubuntu.com/cc-eal\)
3401 - cis: Security compliance and audit tools
3402 \(https://ubuntu.com/security/certifications/docs/usg\)
3403- - esm-infra: UA Infra: Extended Security Maintenance \(ESM\)
3404+ - esm-apps: Expanded Security Maintenance for Applications
3405+ \(https://ubuntu.com/security/esm\)
3406+ - esm-infra: Expanded Security Maintenance for Infrastructure
3407 \(https://ubuntu.com/security/esm\)
3408 - fips-updates: NIST-certified core packages with priority security updates
3409 \(https://ubuntu.com/security/certifications#fips\)
3410@@ -566,18 +573,22 @@ Feature: Command behaviour when attached to an UA subscription
3411 \(https://ubuntu.com/security/certifications#fips\)
3412 - livepatch: Canonical Livepatch service
3413 \(https://ubuntu.com/security/livepatch\)
3414+ - ros-updates: All Updates for the Robot Operating System
3415+ \(https://ubuntu.com/robotics/ros-esm\)
3416+ - ros: Security Updates for the Robot Operating System
3417+ \(https://ubuntu.com/robotics/ros-esm\)
3418 """
3419- When I run `ua help --all` as non-root
3420+ When I run `pro help --all` as non-root
3421 Then stdout matches regexp:
3422 """
3423- Client to manage Ubuntu Advantage services on a machine.
3424+ Client to manage Ubuntu Pro services on a machine.
3425 - cc-eal: Common Criteria EAL2 Provisioning Packages
3426 \(https://ubuntu.com/cc-eal\)
3427 - cis: Security compliance and audit tools
3428 \(https://ubuntu.com/security/certifications/docs/usg\)
3429- - esm-apps: UA Apps: Extended Security Maintenance \(ESM\)
3430+ - esm-apps: Expanded Security Maintenance for Applications
3431 \(https://ubuntu.com/security/esm\)
3432- - esm-infra: UA Infra: Extended Security Maintenance \(ESM\)
3433+ - esm-infra: Expanded Security Maintenance for Infrastructure
3434 \(https://ubuntu.com/security/esm\)
3435 - fips-updates: NIST-certified core packages with priority security updates
3436 \(https://ubuntu.com/security/certifications#fips\)
3437@@ -597,7 +608,7 @@ Feature: Command behaviour when attached to an UA subscription
3438 | release | infra-status |
3439 | bionic | enabled |
3440 | xenial | enabled |
3441- | impish | n/a |
3442+ | kinetic | n/a |
3443
3444 @series.jammy
3445 @series.focal
3446@@ -605,44 +616,45 @@ Feature: Command behaviour when attached to an UA subscription
3447 Scenario Outline: Help command on an attached machine
3448 Given a `<release>` machine with ubuntu-advantage-tools installed
3449 When I attach `contract_token` with sudo
3450- And I run `ua help esm-infra` with sudo
3451+ And I run `pro help esm-infra` with sudo
3452 Then I will see the following on stdout:
3453- """
3454- Name:
3455- esm-infra
3456+ """
3457+ Name:
3458+ esm-infra
3459
3460- Entitled:
3461- yes
3462+ Entitled:
3463+ yes
3464
3465- Status:
3466- enabled
3467+ Status:
3468+ enabled
3469
3470- Help:
3471- esm-infra provides access to a private ppa which includes available high
3472- and critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main
3473- repository between the end of the standard Ubuntu LTS security
3474- maintenance and its end of life. It is enabled by default with
3475- Extended Security Maintenance (ESM) for UA Apps and UA Infra.
3476- You can find our more about the esm service at
3477- https://ubuntu.com/security/esm
3478- """
3479- When I run `ua help esm-infra --format json` with sudo
3480+ Help:
3481+ Expanded Security Maintenance for Infrastructure provides access
3482+ to a private ppa which includes available high and critical CVE fixes
3483+ for Ubuntu LTS packages in the Ubuntu Main repository between the end
3484+ of the standard Ubuntu LTS security maintenance and its end of life.
3485+ It is enabled by default with Ubuntu Pro. You can find out more about
3486+ the service at https://ubuntu.com/security/esm
3487+ """
3488+ When I run `pro help esm-infra --format json` with sudo
3489 Then I will see the following on stdout:
3490- """
3491- {"name": "esm-infra", "entitled": "yes", "status": "enabled", "help": "esm-infra provides access to a private ppa which includes available high\nand critical CVE fixes for Ubuntu LTS packages in the Ubuntu Main\nrepository between the end of the standard Ubuntu LTS security\nmaintenance and its end of life. It is enabled by default with\nExtended Security Maintenance (ESM) for UA Apps and UA Infra.\nYou can find our more about the esm service at\nhttps://ubuntu.com/security/esm\n"}
3492- """
3493- And I verify that running `ua help invalid-service` `with sudo` exits `1`
3494+ """
3495+ {"name": "esm-infra", "entitled": "yes", "status": "enabled", "help": "Expanded Security Maintenance for Infrastructure provides access\nto a private ppa which includes available high and critical CVE fixes\nfor Ubuntu LTS packages in the Ubuntu Main repository between the end\nof the standard Ubuntu LTS security maintenance and its end of life.\nIt is enabled by default with Ubuntu Pro. You can find out more about\nthe service at https://ubuntu.com/security/esm\n"}
3496+ """
3497+ And I verify that running `pro help invalid-service` `with sudo` exits `1`
3498 And I will see the following on stderr:
3499- """
3500- No help available for 'invalid-service'
3501- """
3502- When I run `ua --help` as non-root
3503+ """
3504+ No help available for 'invalid-service'
3505+ """
3506+ When I run `pro --help` as non-root
3507 Then stdout matches regexp:
3508 """
3509- Client to manage Ubuntu Advantage services on a machine.
3510+ Client to manage Ubuntu Pro services on a machine.
3511 - cc-eal: Common Criteria EAL2 Provisioning Packages
3512 \(https://ubuntu.com/cc-eal\)
3513- - esm-infra: UA Infra: Extended Security Maintenance \(ESM\)
3514+ - esm-apps: Expanded Security Maintenance for Applications
3515+ \(https://ubuntu.com/security/esm\)
3516+ - esm-infra: Expanded Security Maintenance for Infrastructure
3517 \(https://ubuntu.com/security/esm\)
3518 - fips-updates: NIST-certified core packages with priority security updates
3519 \(https://ubuntu.com/security/certifications#fips\)
3520@@ -650,16 +662,22 @@ Feature: Command behaviour when attached to an UA subscription
3521 \(https://ubuntu.com/security/certifications#fips\)
3522 - livepatch: Canonical Livepatch service
3523 \(https://ubuntu.com/security/livepatch\)
3524+ - ros-updates: All Updates for the Robot Operating System
3525+ \(https://ubuntu.com/robotics/ros-esm\)
3526+ - ros: Security Updates for the Robot Operating System
3527+ \(https://ubuntu.com/robotics/ros-esm\)
3528 - usg: Security compliance and audit tools
3529 \(https://ubuntu.com/security/certifications/docs/usg\)
3530 """
3531- When I run `ua help` with sudo
3532+ When I run `pro help` with sudo
3533 Then stdout matches regexp:
3534 """
3535- Client to manage Ubuntu Advantage services on a machine.
3536+ Client to manage Ubuntu Pro services on a machine.
3537 - cc-eal: Common Criteria EAL2 Provisioning Packages
3538 \(https://ubuntu.com/cc-eal\)
3539- - esm-infra: UA Infra: Extended Security Maintenance \(ESM\)
3540+ - esm-apps: Expanded Security Maintenance for Applications
3541+ \(https://ubuntu.com/security/esm\)
3542+ - esm-infra: Expanded Security Maintenance for Infrastructure
3543 \(https://ubuntu.com/security/esm\)
3544 - fips-updates: NIST-certified core packages with priority security updates
3545 \(https://ubuntu.com/security/certifications#fips\)
3546@@ -667,18 +685,22 @@ Feature: Command behaviour when attached to an UA subscription
3547 \(https://ubuntu.com/security/certifications#fips\)
3548 - livepatch: Canonical Livepatch service
3549 \(https://ubuntu.com/security/livepatch\)
3550+ - ros-updates: All Updates for the Robot Operating System
3551+ \(https://ubuntu.com/robotics/ros-esm\)
3552+ - ros: Security Updates for the Robot Operating System
3553+ \(https://ubuntu.com/robotics/ros-esm\)
3554 - usg: Security compliance and audit tools
3555 \(https://ubuntu.com/security/certifications/docs/usg\)
3556 """
3557- When I run `ua help --all` as non-root
3558+ When I run `pro help --all` as non-root
3559 Then stdout matches regexp:
3560 """
3561- Client to manage Ubuntu Advantage services on a machine.
3562+ Client to manage Ubuntu Pro services on a machine.
3563 - cc-eal: Common Criteria EAL2 Provisioning Packages
3564 \(https://ubuntu.com/cc-eal\)
3565- - esm-apps: UA Apps: Extended Security Maintenance \(ESM\)
3566+ - esm-apps: Expanded Security Maintenance for Applications
3567 \(https://ubuntu.com/security/esm\)
3568- - esm-infra: UA Infra: Extended Security Maintenance \(ESM\)
3569+ - esm-infra: Expanded Security Maintenance for Infrastructure
3570 \(https://ubuntu.com/security/esm\)
3571 - fips-updates: NIST-certified core packages with priority security updates
3572 \(https://ubuntu.com/security/certifications#fips\)
3573@@ -706,11 +728,11 @@ Feature: Command behaviour when attached to an UA subscription
3574 Scenario Outline: Enable command with invalid repositories in user machine
3575 Given a `<release>` machine with ubuntu-advantage-tools installed
3576 When I attach `contract_token` with sudo
3577- And I run `ua disable esm-infra` with sudo
3578+ And I run `pro disable esm-infra` with sudo
3579 And I run `add-apt-repository ppa:cloud-init-dev/daily -y` with sudo, retrying exit [1]
3580 And I run `apt update` with sudo
3581 And I run `sed -i 's/ubuntu/ubun/' /etc/apt/sources.list.d/<ppa_file>.list` with sudo
3582- And I verify that running `ua enable esm-infra` `with sudo` exits `1`
3583+ And I verify that running `pro enable esm-infra` `with sudo` exits `1`
3584 Then stdout matches regexp:
3585 """
3586 One moment, checking your subscription first
3587@@ -733,7 +755,7 @@ Feature: Command behaviour when attached to an UA subscription
3588 Given a `<release>` machine with ubuntu-advantage-tools installed
3589 When I run `systemctl stop ua-timer.timer` with sudo
3590 And I attach `contract_token` with sudo
3591- Then I verify that running `ua config set update_messaging_timer=-2` `with sudo` exits `1`
3592+ Then I verify that running `pro config set update_messaging_timer=-2` `with sudo` exits `1`
3593 And stderr matches regexp:
3594 """
3595 Cannot set update_messaging_timer to -2: <value> for interval must be a positive integer.
3596@@ -748,14 +770,14 @@ Feature: Command behaviour when attached to an UA subscription
3597 """"
3598 "update_status":
3599 """
3600- When I run `ua config show` with sudo
3601+ When I run `pro config show` with sudo
3602 Then stdout matches regexp:
3603 """
3604 update_messaging_timer +21600
3605 update_status_timer +43200
3606 """
3607 When I delete the file `/var/lib/ubuntu-advantage/jobs-status.json`
3608- And I run `ua config set update_messaging_timer=0` with sudo
3609+ And I run `pro config set update_messaging_timer=0` with sudo
3610 And I run `python3 /usr/lib/ubuntu-advantage/timer.py` with sudo
3611 And I run `cat /var/lib/ubuntu-advantage/jobs-status.json` with sudo
3612 Then stdout does not match regexp:
3613@@ -821,8 +843,8 @@ Feature: Command behaviour when attached to an UA subscription
3614 | xenial |
3615 | bionic |
3616 | focal |
3617- | impish |
3618 | jammy |
3619+ | kinetic |
3620
3621 @series.lts
3622 @uses.config.machine_type.lxd.container
3623@@ -895,101 +917,28 @@ Feature: Command behaviour when attached to an UA subscription
3624 | focal |
3625 | jammy |
3626
3627- @series.xenial
3628- @series.bionic
3629+ @series.lts
3630 @uses.config.machine_type.lxd.container
3631- Scenario Outline: Run security-status on an Ubuntu machine
3632+ Scenario Outline: Run timer script to valid machine activity endpoint
3633 Given a `<release>` machine with ubuntu-advantage-tools installed
3634- When I append the following on uaclient config:
3635- """
3636- features:
3637- allow_beta: true
3638- """
3639- And I run `dpkg-reconfigure ubuntu-advantage-tools` with sudo
3640- And I run `apt-get update` with sudo
3641- When I run `ua security-status --format json` as non-root
3642- Then stdout is a json matching the `ua_security_status` schema
3643- And stdout matches regexp:
3644- """
3645- "_schema_version": "0.1"
3646- """
3647- And stdout matches regexp:
3648- """
3649- "attached": false
3650- """
3651- And stdout matches regexp:
3652- """
3653- "enabled_services": \[\]
3654- """
3655- And stdout matches regexp:
3656- """
3657- "entitled_services": \[\]
3658- """
3659- And stdout matches regexp:
3660- """
3661- "package": "<package>"
3662- """
3663- And stdout matches regexp:
3664- """
3665- "service_name": "<service>"
3666- """
3667- And stdout matches regexp:
3668- """
3669- "origin": "esm.ubuntu.com"
3670- """
3671- And stdout matches regexp:
3672- """
3673- "status": "pending_attach"
3674- """
3675- And stdout matches regexp:
3676- """
3677- "download_size": \d+
3678- """
3679 When I attach `contract_token` with sudo
3680- And I run `ua security-status --format json` as non-root
3681+ And I run `rm /var/lib/ubuntu-advantage/machine-token.json` with sudo
3682+ And I run `ua status` as non-root
3683 Then stdout matches regexp:
3684 """
3685- "_schema_version": "0.1"
3686- """
3687- And stdout matches regexp:
3688- """
3689- "attached": true
3690- """
3691- And stdout matches regexp:
3692- """
3693- "enabled_services": \["esm-apps", "esm-infra"\]
3694- """
3695- And stdout matches regexp:
3696- """
3697- "entitled_services": \["esm-apps", "esm-infra"\]
3698- """
3699- And stdout matches regexp:
3700- """
3701- "status": "upgrade_available"
3702- """
3703- And stdout matches regexp:
3704+ SERVICE +AVAILABLE +DESCRIPTION
3705 """
3706- "download_size": \d+
3707- """
3708- When I run `ua security-status --format yaml` as non-root
3709- Then stdout is a yaml matching the `ua_security_status` schema
3710- And stdout matches regexp:
3711- """
3712- _schema_version: '0.1'
3713- """
3714- When I verify that running `ua security-status --format unsupported` `as non-root` exits `2`
3715- Then I will see the following on stderr:
3716- """
3717- usage: security-status [-h] --format {json,yaml}
3718- argument --format: invalid choice: 'unsupported' (choose from 'json', 'yaml')
3719- """
3720- When I verify that running `ua security-status` `as non-root` exits `2`
3721- Then I will see the following on stderr:
3722+ When I run `dpkg-reconfigure ubuntu-advantage-tools` with sudo
3723+ Then I verify that files exist matching `/var/lib/ubuntu-advantage/machine-token.json`
3724+ When I run `ua status` as non-root
3725+ Then stdout matches regexp:
3726 """
3727- usage: security-status [-h] --format {json,yaml}
3728- the following arguments are required: --format
3729+ SERVICE +ENTITLED +STATUS +DESCRIPTION
3730 """
3731+
3732 Examples: ubuntu release
3733- | release | package | service |
3734- | xenial | apport | esm-infra |
3735- | bionic | libkrb5-3 | esm-apps |
3736+ | release |
3737+ | xenial |
3738+ | bionic |
3739+ | focal |
3740+ | jammy |
3741diff --git a/features/attached_enable.feature b/features/attached_enable.feature
3742index 03c18bf..b68f8c0 100644
3743--- a/features/attached_enable.feature
3744+++ b/features/attached_enable.feature
3745@@ -1,5 +1,5 @@
3746 @uses.config.contract_token
3747-Feature: Enable command behaviour when attached to an UA subscription
3748+Feature: Enable command behaviour when attached to an Ubuntu Pro subscription
3749
3750 @slow
3751 @series.xenial
3752@@ -8,12 +8,12 @@ Feature: Enable command behaviour when attached to an UA subscription
3753 Scenario Outline: Attached enable Common Criteria service in an ubuntu lxd container
3754 Given a `<release>` machine with ubuntu-advantage-tools installed
3755 When I attach `contract_token` with sudo
3756- Then I verify that running `ua enable cc-eal` `as non-root` exits `1`
3757+ Then I verify that running `pro enable cc-eal` `as non-root` exits `1`
3758 And I will see the following on stderr:
3759 """
3760 This command must be run as root (try using sudo).
3761 """
3762- When I run `ua enable cc-eal` with sudo
3763+ When I run `pro enable cc-eal` with sudo
3764 Then I will see the following on stdout:
3765 """
3766 One moment, checking your subscription first
3767@@ -28,18 +28,39 @@ Feature: Enable command behaviour when attached to an UA subscription
3768 | xenial |
3769 | bionic |
3770
3771+ @series.xenial
3772+ @series.bionic
3773+ @uses.config.machine_type.lxd.container
3774+ Scenario Outline: Enable cc-eal with --access-only
3775+ Given a `<release>` machine with ubuntu-advantage-tools installed
3776+ When I attach `contract_token` with sudo
3777+ When I run `pro enable cc-eal --access-only` with sudo
3778+ Then I will see the following on stdout:
3779+ """
3780+ One moment, checking your subscription first
3781+ Updating package lists
3782+ Skipping installing packages: ubuntu-commoncriteria
3783+ CC EAL2 access enabled
3784+ """
3785+ Then I verify that running `apt-get install ubuntu-commoncriteria` `with sudo` exits `0`
3786+ Examples: ubuntu release
3787+ | release |
3788+ | xenial |
3789+ | bionic |
3790+
3791 @series.focal
3792- @series.impish
3793+ @series.jammy
3794+ @series.kinetic
3795 @uses.config.machine_type.lxd.container
3796 Scenario Outline: Attached enable Common Criteria service in an ubuntu lxd container
3797 Given a `<release>` machine with ubuntu-advantage-tools installed
3798 When I attach `contract_token` with sudo
3799- Then I verify that running `ua enable cc-eal` `as non-root` exits `1`
3800+ Then I verify that running `pro enable cc-eal` `as non-root` exits `1`
3801 And I will see the following on stderr:
3802 """
3803 This command must be run as root (try using sudo).
3804 """
3805- When I verify that running `ua enable cc-eal` `with sudo` exits `1`
3806+ When I verify that running `pro enable cc-eal` `with sudo` exits `1`
3807 Then I will see the following on stdout:
3808 """
3809 One moment, checking your subscription first
3810@@ -48,8 +69,8 @@ Feature: Enable command behaviour when attached to an UA subscription
3811 Examples: ubuntu release
3812 | release | version | full_name |
3813 | focal | 20.04 LTS | Focal Fossa |
3814- | impish | 21.10 | Impish Indri |
3815- | jammy | 22.04 | Jammy Jellyfish |
3816+ | jammy | 22.04 LTS | Jammy Jellyfish |
3817+ | kinetic | 22.10 | Kinetic Kudu |
3818
3819 @series.lts
3820 @uses.config.machine_type.lxd.container
3821@@ -78,11 +99,11 @@ Feature: Enable command behaviour when attached to an UA subscription
3822 features:
3823 machine_token_overlay: "/tmp/machine-token-overlay.json"
3824 """
3825- When I verify that running `ua enable esm-infra` `with sudo` exits `1`
3826+ When I verify that running `pro enable esm-infra` `with sudo` exits `1`
3827 Then stdout matches regexp:
3828 """
3829 One moment, checking your subscription first
3830- UA Infra: ESM is not available for Ubuntu .*
3831+ Ubuntu Pro: ESM Infra is not available for Ubuntu .*
3832 """
3833 When I create the file `/tmp/machine-token-overlay.json` with the following:
3834 """
3835@@ -101,12 +122,12 @@ Feature: Enable command behaviour when attached to an UA subscription
3836 }
3837 }
3838 """
3839- When I verify that running `ua enable esm-infra` `with sudo` exits `0`
3840+ When I verify that running `pro enable esm-infra` `with sudo` exits `0`
3841 Then stdout matches regexp:
3842 """
3843 One moment, checking your subscription first
3844 Updating package lists
3845- UA Infra: ESM enabled
3846+ Ubuntu Pro: ESM Infra enabled
3847 """
3848 Examples: ubuntu release
3849 | release |
3850@@ -120,58 +141,58 @@ Feature: Enable command behaviour when attached to an UA subscription
3851 Scenario Outline: Attached enable of different services using json format
3852 Given a `<release>` machine with ubuntu-advantage-tools installed
3853 When I attach `contract_token` with sudo
3854- Then I verify that running `ua enable foobar --format json` `as non-root` exits `1`
3855+ Then I verify that running `pro enable foobar --format json` `as non-root` exits `1`
3856 And stdout is a json matching the `ua_operation` schema
3857 And I will see the following on stdout:
3858 """
3859 {"_schema_version": "0.1", "errors": [{"message": "json formatted response requires --assume-yes flag.", "message_code": "json-format-require-assume-yes", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
3860 """
3861- Then I verify that running `ua enable foobar --format json` `with sudo` exits `1`
3862+ Then I verify that running `pro enable foobar --format json` `with sudo` exits `1`
3863 And stdout is a json matching the `ua_operation` schema
3864 And I will see the following on stdout:
3865 """
3866 {"_schema_version": "0.1", "errors": [{"message": "json formatted response requires --assume-yes flag.", "message_code": "json-format-require-assume-yes", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
3867 """
3868- Then I verify that running `ua enable foobar --format json --assume-yes` `as non-root` exits `1`
3869+ Then I verify that running `pro enable foobar --format json --assume-yes` `as non-root` exits `1`
3870 And stdout is a json matching the `ua_operation` schema
3871 And I will see the following on stdout:
3872 """
3873 {"_schema_version": "0.1", "errors": [{"message": "This command must be run as root (try using sudo).", "message_code": "nonroot-user", "service": null, "type": "system"}], "failed_services": [], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
3874 """
3875- And I verify that running `ua enable foobar --format json --assume-yes` `with sudo` exits `1`
3876+ And I verify that running `pro enable foobar --format json --assume-yes` `with sudo` exits `1`
3877 And stdout is a json matching the `ua_operation` schema
3878 And I will see the following on stdout:
3879 """
3880 {"_schema_version": "0.1", "errors": [{"message": "Cannot enable unknown service 'foobar'.\nTry <valid_services>", "message_code": "invalid-service-or-failure", "service": null, "type": "system"}], "failed_services": ["foobar"], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
3881 """
3882- And I verify that running `ua enable ros foobar --format json --assume-yes` `with sudo` exits `1`
3883+ And I verify that running `pro enable realtime-kernel foobar --format json --assume-yes` `with sudo` exits `1`
3884 And stdout is a json matching the `ua_operation` schema
3885 And I will see the following on stdout:
3886 """
3887- {"_schema_version": "0.1", "errors": [{"message": "Cannot enable unknown service 'foobar, ros'.\nTry <valid_services>", "message_code": "invalid-service-or-failure", "service": null, "type": "system"}], "failed_services": ["foobar", "ros"], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
3888+ {"_schema_version": "0.1", "errors": [{"message": "Cannot enable unknown service 'foobar, realtime-kernel'.\nTry <valid_services>", "message_code": "invalid-service-or-failure", "service": null, "type": "system"}], "failed_services": ["foobar", "realtime-kernel"], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
3889 """
3890- And I verify that running `ua enable esm-infra --format json --assume-yes` `with sudo` exits `1`
3891+ And I verify that running `pro enable esm-infra --format json --assume-yes` `with sudo` exits `1`
3892 And stdout is a json matching the `ua_operation` schema
3893 Then I will see the following on stdout:
3894- """
3895- {"_schema_version": "0.1", "errors": [{"message": "UA Infra: ESM is already enabled.\nSee: sudo ua status", "message_code": "service-already-enabled", "service": "esm-infra", "type": "service"}], "failed_services": ["esm-infra"], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
3896- """
3897- When I run `ua disable esm-infra` with sudo
3898- And I run `ua enable esm-infra --format json --assume-yes` with sudo
3899+ """
3900+ {"_schema_version": "0.1", "errors": [{"message": "Ubuntu Pro: ESM Infra is already enabled.\nSee: sudo pro status", "message_code": "service-already-enabled", "service": "esm-infra", "type": "service"}], "failed_services": ["esm-infra"], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
3901+ """
3902+ When I run `pro disable esm-infra` with sudo
3903+ And I run `pro enable esm-infra --format json --assume-yes` with sudo
3904 Then stdout is a json matching the `ua_operation` schema
3905 And I will see the following on stdout:
3906 """
3907 {"_schema_version": "0.1", "errors": [], "failed_services": [], "needs_reboot": false, "processed_services": ["esm-infra"], "result": "success", "warnings": []}
3908 """
3909- When I run `ua disable esm-infra` with sudo
3910- And I verify that running `ua enable esm-infra foobar --format json --assume-yes` `with sudo` exits `1`
3911+ When I run `pro disable esm-infra` with sudo
3912+ And I verify that running `pro enable esm-infra foobar --format json --assume-yes` `with sudo` exits `1`
3913 Then stdout is a json matching the `ua_operation` schema
3914 And I will see the following on stdout:
3915 """
3916 {"_schema_version": "0.1", "errors": [{"message": "Cannot enable unknown service 'foobar'.\nTry <valid_services>", "message_code": "invalid-service-or-failure", "service": null, "type": "system"}], "failed_services": ["foobar"], "needs_reboot": false, "processed_services": ["esm-infra"], "result": "failure", "warnings": []}
3917 """
3918- When I run `ua disable esm-infra esm-apps` with sudo
3919- And I run `ua enable esm-infra esm-apps --beta --format json --assume-yes` with sudo
3920+ When I run `pro disable esm-infra esm-apps` with sudo
3921+ And I run `pro enable esm-infra esm-apps --beta --format json --assume-yes` with sudo
3922 Then stdout is a json matching the `ua_operation` schema
3923 And I will see the following on stdout:
3924 """
3925@@ -179,49 +200,49 @@ Feature: Enable command behaviour when attached to an UA subscription
3926 """
3927
3928 Examples: ubuntu release
3929- | release | valid_services |
3930- | xenial | cc-eal, cis, esm-infra, fips, fips-updates, livepatch. |
3931- | bionic | cc-eal, cis, esm-infra, fips, fips-updates, livepatch. |
3932- | focal | cc-eal, esm-infra, fips, fips-updates, livepatch, usg. |
3933- | jammy | cc-eal, esm-infra, fips, fips-updates, livepatch, usg. |
3934+ | release | valid_services |
3935+ | xenial | cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch, ros,\nros-updates. |
3936+ | bionic | cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch, ros,\nros-updates. |
3937+ | focal | cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch, ros,\nros-updates, usg. |
3938+ | jammy | cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch, ros,\nros-updates, usg. |
3939
3940 @series.lts
3941 @uses.config.machine_type.lxd.container
3942 Scenario Outline: Attached enable of a service in a ubuntu machine
3943 Given a `<release>` machine with ubuntu-advantage-tools installed
3944 When I attach `contract_token` with sudo
3945- Then I verify that running `ua enable foobar` `as non-root` exits `1`
3946+ Then I verify that running `pro enable foobar` `as non-root` exits `1`
3947 And I will see the following on stderr:
3948- """
3949- This command must be run as root (try using sudo).
3950- """
3951- And I verify that running `ua enable foobar` `with sudo` exits `1`
3952+ """
3953+ This command must be run as root (try using sudo).
3954+ """
3955+ And I verify that running `pro enable foobar` `with sudo` exits `1`
3956 And I will see the following on stdout:
3957- """
3958- One moment, checking your subscription first
3959- """
3960+ """
3961+ One moment, checking your subscription first
3962+ """
3963 And stderr matches regexp:
3964- """
3965- Cannot enable unknown service 'foobar'.
3966- Try cc-eal, cis, esm-infra, fips, fips-updates, livepatch.
3967- """
3968- And I verify that running `ua enable ros foobar` `with sudo` exits `1`
3969+ """
3970+ Cannot enable unknown service 'foobar'.
3971+ Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch, ros,\nros-updates.
3972+ """
3973+ And I verify that running `pro enable realtime-kernel foobar` `with sudo` exits `1`
3974 And I will see the following on stdout:
3975- """
3976- One moment, checking your subscription first
3977- """
3978+ """
3979+ One moment, checking your subscription first
3980+ """
3981 And stderr matches regexp:
3982- """
3983- Cannot enable unknown service 'foobar, ros'.
3984- Try cc-eal, cis, esm-infra, fips, fips-updates, livepatch.
3985- """
3986- And I verify that running `ua enable esm-infra` `with sudo` exits `1`
3987+ """
3988+ Cannot enable unknown service 'foobar, realtime-kernel'.
3989+ Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch, ros,\nros-updates.
3990+ """
3991+ And I verify that running `pro enable esm-infra` `with sudo` exits `1`
3992 And I will see the following on stdout:
3993- """
3994- One moment, checking your subscription first
3995- UA Infra: ESM is already enabled.
3996- See: sudo ua status
3997- """
3998+ """
3999+ One moment, checking your subscription first
4000+ Ubuntu Pro: ESM Infra is already enabled.
4001+ See: sudo pro status
4002+ """
4003 When I run `apt-cache policy` with sudo
4004 Then apt-cache policy for the following url has permission `500`
4005 """
4006@@ -246,38 +267,38 @@ Feature: Enable command behaviour when attached to an UA subscription
4007 Scenario: Attached enable of a service in a ubuntu machine
4008 Given a `focal` machine with ubuntu-advantage-tools installed
4009 When I attach `contract_token` with sudo
4010- Then I verify that running `ua enable foobar` `as non-root` exits `1`
4011+ Then I verify that running `pro enable foobar` `as non-root` exits `1`
4012 And I will see the following on stderr:
4013- """
4014- This command must be run as root (try using sudo).
4015- """
4016- And I verify that running `ua enable foobar` `with sudo` exits `1`
4017+ """
4018+ This command must be run as root (try using sudo).
4019+ """
4020+ And I verify that running `pro enable foobar` `with sudo` exits `1`
4021 And I will see the following on stdout:
4022- """
4023- One moment, checking your subscription first
4024- """
4025+ """
4026+ One moment, checking your subscription first
4027+ """
4028 And stderr matches regexp:
4029- """
4030- Cannot enable unknown service 'foobar'.
4031- Try cc-eal, esm-infra, fips, fips-updates, livepatch, usg.
4032- """
4033- And I verify that running `ua enable ros foobar` `with sudo` exits `1`
4034+ """
4035+ Cannot enable unknown service 'foobar'.
4036+ Try cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch, ros,\nros-updates, usg.
4037+ """
4038+ And I verify that running `pro enable realtime-kernel foobar` `with sudo` exits `1`
4039 And I will see the following on stdout:
4040- """
4041- One moment, checking your subscription first
4042- """
4043+ """
4044+ One moment, checking your subscription first
4045+ """
4046 And stderr matches regexp:
4047- """
4048- Cannot enable unknown service 'foobar, ros'.
4049- Try cc-eal, esm-infra, fips, fips-updates, livepatch, usg.
4050- """
4051- And I verify that running `ua enable esm-infra` `with sudo` exits `1`
4052+ """
4053+ Cannot enable unknown service 'foobar, realtime-kernel'.
4054+ Try cc-eal, esm-apps, esm-infra, fips, fips-updates, livepatch, ros,\nros-updates, usg.
4055+ """
4056+ And I verify that running `pro enable esm-infra` `with sudo` exits `1`
4057 Then I will see the following on stdout:
4058- """
4059- One moment, checking your subscription first
4060- UA Infra: ESM is already enabled.
4061- See: sudo ua status
4062- """
4063+ """
4064+ One moment, checking your subscription first
4065+ Ubuntu Pro: ESM Infra is already enabled.
4066+ See: sudo pro status
4067+ """
4068 When I run `apt-cache policy` with sudo
4069 Then apt-cache policy for the following url has permission `500`
4070 """
4071@@ -297,12 +318,12 @@ Feature: Enable command behaviour when attached to an UA subscription
4072 Scenario Outline: Attached enable of non-container services in a ubuntu lxd container
4073 Given a `<release>` machine with ubuntu-advantage-tools installed
4074 When I attach `contract_token` with sudo
4075- Then I verify that running `ua enable livepatch` `as non-root` exits `1`
4076+ Then I verify that running `pro enable livepatch` `as non-root` exits `1`
4077 And I will see the following on stderr:
4078 """
4079 This command must be run as root (try using sudo).
4080 """
4081- And I verify that running `ua enable livepatch` `with sudo` exits `1`
4082+ And I verify that running `pro enable livepatch` `with sudo` exits `1`
4083 And I will see the following on stdout:
4084 """
4085 One moment, checking your subscription first
4086@@ -314,8 +335,8 @@ Feature: Enable command behaviour when attached to an UA subscription
4087 | bionic |
4088 | focal |
4089 | xenial |
4090- | impish |
4091 | jammy |
4092+ | kinetic |
4093
4094 @series.lts
4095 @uses.config.machine_type.lxd.container
4096@@ -342,17 +363,17 @@ Feature: Enable command behaviour when attached to an UA subscription
4097 machine_token_overlay: "/tmp/machine-token-overlay.json"
4098 """
4099 When I attach `contract_token` with sudo
4100- Then I verify that running `ua enable esm-apps` `as non-root` exits `1`
4101+ Then I verify that running `pro enable esm-apps` `as non-root` exits `1`
4102 And I will see the following on stderr:
4103 """
4104 This command must be run as root (try using sudo).
4105 """
4106- And I verify that running `ua enable esm-apps --beta` `with sudo` exits `1`
4107+ And I verify that running `pro enable esm-apps --beta` `with sudo` exits `1`
4108 And I will see the following on stdout:
4109 """
4110 One moment, checking your subscription first
4111- This subscription is not entitled to UA Apps: ESM
4112- For more information see: https://ubuntu.com/advantage.
4113+ This subscription is not entitled to Ubuntu Pro: ESM Apps
4114+ For more information see: https://ubuntu.com/pro.
4115 """
4116
4117 Examples: not entitled services
4118@@ -368,15 +389,25 @@ Feature: Enable command behaviour when attached to an UA subscription
4119 Scenario Outline: Attached enable of cis service in a ubuntu machine
4120 Given a `<release>` machine with ubuntu-advantage-tools installed
4121 When I attach `contract_token` with sudo
4122- And I verify that running `ua enable cis` `with sudo` exits `0`
4123+ And I verify that running `pro enable cis --access-only` `with sudo` exits `0`
4124 Then I will see the following on stdout:
4125- """
4126- One moment, checking your subscription first
4127- Updating package lists
4128- Installing CIS Audit packages
4129- CIS Audit enabled
4130- Visit https://ubuntu.com/security/cis to learn how to use CIS
4131- """
4132+ """
4133+ One moment, checking your subscription first
4134+ Updating package lists
4135+ Skipping installing packages: usg-cisbenchmark usg-common
4136+ CIS Audit access enabled
4137+ Visit https://ubuntu.com/security/cis to learn how to use CIS
4138+ """
4139+ When I run `pro disable cis` with sudo
4140+ And I verify that running `pro enable cis` `with sudo` exits `0`
4141+ Then I will see the following on stdout:
4142+ """
4143+ One moment, checking your subscription first
4144+ Updating package lists
4145+ Installing CIS Audit packages
4146+ CIS Audit enabled
4147+ Visit https://ubuntu.com/security/cis to learn how to use CIS
4148+ """
4149 When I run `apt-cache policy usg-cisbenchmark` as non-root
4150 Then stdout does not match regexp:
4151 """
4152@@ -395,12 +426,12 @@ Feature: Enable command behaviour when attached to an UA subscription
4153 """
4154 \s* 500 https://esm.ubuntu.com/cis/ubuntu <release>/main amd64 Packages
4155 """
4156- When I verify that running `ua enable cis` `with sudo` exits `1`
4157+ When I verify that running `pro enable cis` `with sudo` exits `1`
4158 Then stdout matches regexp
4159 """
4160 One moment, checking your subscription first
4161 CIS Audit is already enabled.
4162- See: sudo ua status
4163+ See: sudo pro status
4164 """
4165 When I run `cis-audit level1_server` with sudo
4166 Then stdout matches regexp
4167@@ -442,12 +473,12 @@ Feature: Enable command behaviour when attached to an UA subscription
4168 Scenario Outline: Attached enable of cis service in a ubuntu machine
4169 Given a `<release>` machine with ubuntu-advantage-tools installed
4170 When I attach `contract_token` with sudo
4171- And I verify that running `ua enable cis` `with sudo` exits `0`
4172+ And I verify that running `pro enable cis` `with sudo` exits `0`
4173 Then I will see the following on stdout:
4174 """
4175 One moment, checking your subscription first
4176- From Ubuntu 20.04 and onwards 'ua enable cis' has been
4177- replaced by 'ua enable usg'. See more information at:
4178+ From Ubuntu 20.04 and onwards 'pro enable cis' has been
4179+ replaced by 'pro enable usg'. See more information at:
4180 https://ubuntu.com/security/certifications/docs/usg
4181 Updating package lists
4182 Installing CIS Audit packages
4183@@ -472,15 +503,15 @@ Feature: Enable command behaviour when attached to an UA subscription
4184 """
4185 \s* 500 https://esm.ubuntu.com/cis/ubuntu <release>/main amd64 Packages
4186 """
4187- When I verify that running `ua enable cis` `with sudo` exits `1`
4188+ When I verify that running `pro enable cis` `with sudo` exits `1`
4189 Then stdout matches regexp
4190 """
4191 One moment, checking your subscription first
4192- From Ubuntu 20.04 and onwards 'ua enable cis' has been
4193- replaced by 'ua enable usg'. See more information at:
4194+ From Ubuntu 20.04 and onwards 'pro enable cis' has been
4195+ replaced by 'pro enable usg'. See more information at:
4196 https://ubuntu.com/security/certifications/docs/usg
4197 CIS Audit is already enabled.
4198- See: sudo ua status
4199+ See: sudo pro status
4200 """
4201 When I run `cis-audit level1_server` with sudo
4202 Then stdout matches regexp
4203@@ -522,15 +553,15 @@ Feature: Enable command behaviour when attached to an UA subscription
4204 Scenario Outline: Attached enable of usg service in a ubuntu machine
4205 Given a `<release>` machine with ubuntu-advantage-tools installed
4206 When I attach `contract_token` with sudo
4207- And I verify that running `ua enable usg` `with sudo` exits `1`
4208+ And I verify that running `pro enable usg` `with sudo` exits `1`
4209 Then I will see the following on stdout:
4210 """
4211 One moment, checking your subscription first
4212 """
4213- Then I will see the following on stderr:
4214+ And stderr matches regexp:
4215 """
4216 Cannot enable unknown service 'usg'.
4217- Try cc-eal, cis, esm-infra, fips, fips-updates, livepatch.
4218+ Try cc-eal, cis, esm-apps, esm-infra, fips, fips-updates, livepatch, ros,\nros-updates.
4219 """
4220
4221 Examples: cis service
4222@@ -543,7 +574,7 @@ Feature: Enable command behaviour when attached to an UA subscription
4223 Scenario Outline: Attached enable of usg service in a focal machine
4224 Given a `<release>` machine with ubuntu-advantage-tools installed
4225 When I attach `contract_token` with sudo
4226- And I run `ua enable usg` with sudo
4227+ And I run `pro enable usg` with sudo
4228 Then I will see the following on stdout:
4229 """
4230 One moment, checking your subscription first
4231@@ -551,44 +582,44 @@ Feature: Enable command behaviour when attached to an UA subscription
4232 Ubuntu Security Guide enabled
4233 Visit https://ubuntu.com/security/certifications/docs/usg for the next steps
4234 """
4235- When I run `ua status` with sudo
4236+ When I run `pro status` with sudo
4237 Then stdout matches regexp:
4238 """
4239 usg +yes +enabled +Security compliance and audit tools
4240 """
4241- When I run `ua disable usg` with sudo
4242+ When I run `pro disable usg` with sudo
4243 Then stdout matches regexp:
4244 """
4245 Updating package lists
4246 """
4247- When I run `ua status` with sudo
4248+ When I run `pro status` with sudo
4249 Then stdout matches regexp:
4250 """
4251 usg +yes +disabled +Security compliance and audit tools
4252 """
4253- When I run `ua enable cis` with sudo
4254+ When I run `pro enable cis` with sudo
4255 Then I will see the following on stdout:
4256 """
4257 One moment, checking your subscription first
4258- From Ubuntu 20.04 and onwards 'ua enable cis' has been
4259- replaced by 'ua enable usg'. See more information at:
4260+ From Ubuntu 20.04 and onwards 'pro enable cis' has been
4261+ replaced by 'pro enable usg'. See more information at:
4262 https://ubuntu.com/security/certifications/docs/usg
4263 Updating package lists
4264 Installing CIS Audit packages
4265 CIS Audit enabled
4266 Visit https://ubuntu.com/security/cis to learn how to use CIS
4267 """
4268- When I run `ua status` with sudo
4269+ When I run `pro status` with sudo
4270 Then stdout matches regexp:
4271 """
4272 usg +yes +enabled +Security compliance and audit tools
4273 """
4274- When I run `ua disable usg` with sudo
4275+ When I run `pro disable usg` with sudo
4276 Then stdout matches regexp:
4277 """
4278 Updating package lists
4279 """
4280- When I run `ua status` with sudo
4281+ When I run `pro status` with sudo
4282 Then stdout matches regexp:
4283 """
4284 usg +yes +disabled +Security compliance and audit tools
4285@@ -604,31 +635,37 @@ Feature: Enable command behaviour when attached to an UA subscription
4286 Scenario Outline: Attached disable of livepatch in a lxd vm
4287 Given a `<release>` machine with ubuntu-advantage-tools installed
4288 When I attach `contract_token` with sudo
4289- And I run `ua status` with sudo
4290+ And I run `pro status` with sudo
4291 Then stdout matches regexp:
4292 """
4293- esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\)
4294- esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\)
4295+ esm-apps +yes +enabled +Expanded Security Maintenance for Applications
4296+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
4297 fips +yes +disabled +NIST-certified core packages
4298 fips-updates +yes +disabled +NIST-certified core packages with priority security updates
4299 livepatch +yes +enabled +Canonical Livepatch service
4300 """
4301- When I run `ua disable livepatch` with sudo
4302+ When I run `pro disable livepatch` with sudo
4303 Then I verify that running `canonical-livepatch status` `with sudo` exits `1`
4304 And stderr matches regexp:
4305 """
4306 Machine is not enabled. Please run 'sudo canonical-livepatch enable' with the
4307 token obtained from https://ubuntu.com/livepatch.
4308 """
4309- When I run `ua status` with sudo
4310+ When I run `pro status` with sudo
4311 Then stdout matches regexp:
4312 """
4313- esm-apps +yes +enabled +UA Apps: Extended Security Maintenance \(ESM\)
4314- esm-infra +yes +enabled +UA Infra: Extended Security Maintenance \(ESM\)
4315+ esm-apps +yes +enabled +Expanded Security Maintenance for Applications
4316+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
4317 fips +yes +disabled +NIST-certified core packages
4318 fips-updates +yes +disabled +NIST-certified core packages with priority security updates
4319 livepatch +yes +disabled +Canonical Livepatch service
4320 """
4321+ When I verify that running `pro enable livepatch --access-only` `with sudo` exits `1`
4322+ Then I will see the following on stdout:
4323+ """
4324+ One moment, checking your subscription first
4325+ Livepatch does not support being enabled with --access-only
4326+ """
4327
4328 Examples: ubuntu release
4329 | release |
4330@@ -651,7 +688,7 @@ Feature: Enable command behaviour when attached to an UA subscription
4331 Installing canonical-livepatch snap
4332 Canonical livepatch enabled
4333 """
4334- When I run `ua status` with sudo
4335+ When I run `pro status` with sudo
4336 Then stdout matches regexp:
4337 """
4338 livepatch +yes +enabled
4339@@ -678,12 +715,12 @@ Feature: Enable command behaviour when attached to an UA subscription
4340 Then stdout matches regexp:
4341 """
4342 Updating package lists
4343- UA Infra: ESM enabled
4344+ Ubuntu Pro: ESM Infra enabled
4345 Installing canonical-livepatch snap
4346 Canonical livepatch enabled
4347 """
4348- When I run `ua disable livepatch` with sudo
4349- And I run `ua enable fips --assume-yes` with sudo
4350+ When I run `pro disable livepatch` with sudo
4351+ And I run `pro enable fips --assume-yes` with sudo
4352 Then I will see the following on stdout:
4353 """
4354 One moment, checking your subscription first
4355@@ -697,13 +734,13 @@ Feature: Enable command behaviour when attached to an UA subscription
4356 features:
4357 block_disable_on_enable: true
4358 """
4359- Then I verify that running `ua enable livepatch` `with sudo` exits `1`
4360+ Then I verify that running `pro enable livepatch` `with sudo` exits `1`
4361 And I will see the following on stdout
4362 """
4363 One moment, checking your subscription first
4364 Cannot enable Livepatch when FIPS is enabled.
4365 """
4366- Then I verify that running `ua enable livepatch --format json --assume-yes` `with sudo` exits `1`
4367+ Then I verify that running `pro enable livepatch --format json --assume-yes` `with sudo` exits `1`
4368 And I will see the following on stdout
4369 """
4370 {"_schema_version": "0.1", "errors": [{"message": "Cannot enable Livepatch when FIPS is enabled.", "message_code": "livepatch-error-when-fips-enabled", "service": "livepatch", "type": "service"}], "failed_services": ["livepatch"], "needs_reboot": false, "processed_services": [], "result": "failure", "warnings": []}
4371@@ -717,7 +754,7 @@ Feature: Enable command behaviour when attached to an UA subscription
4372 Then stdout matches regexp:
4373 """
4374 Updating package lists
4375- UA Infra: ESM enabled
4376+ Ubuntu Pro: ESM Infra enabled
4377 Installing canonical-livepatch snap
4378 Canonical livepatch enabled
4379 """
4380@@ -726,13 +763,13 @@ Feature: Enable command behaviour when attached to an UA subscription
4381 features:
4382 block_disable_on_enable: true
4383 """
4384- Then I verify that running `ua enable fips --assume-yes` `with sudo` exits `1`
4385+ Then I verify that running `pro enable fips --assume-yes` `with sudo` exits `1`
4386 And I will see the following on stdout
4387 """
4388 One moment, checking your subscription first
4389 Cannot enable FIPS when Livepatch is enabled.
4390 """
4391- Then I verify that running `ua enable fips --assume-yes --format json` `with sudo` exits `1`
4392+ Then I verify that running `pro enable fips --assume-yes --format json` `with sudo` exits `1`
4393 And stdout is a json matching the `ua_operation` schema
4394 And I will see the following on stdout:
4395 """
4396@@ -749,14 +786,14 @@ Feature: Enable command behaviour when attached to an UA subscription
4397 Then stdout matches regexp:
4398 """
4399 Updating package lists
4400- UA Infra: ESM enabled
4401+ Ubuntu Pro: ESM Infra enabled
4402 """
4403 And stdout matches regexp:
4404 """
4405 Installing canonical-livepatch snap
4406 Canonical livepatch enabled
4407 """
4408- When I run `ua enable fips --assume-yes` with sudo
4409+ When I run `pro enable fips --assume-yes` with sudo
4410 Then I will see the following on stdout
4411 """
4412 One moment, checking your subscription first
4413@@ -766,7 +803,7 @@ Feature: Enable command behaviour when attached to an UA subscription
4414 FIPS enabled
4415 A reboot is required to complete install.
4416 """
4417- When I run `ua status` with sudo
4418+ When I run `pro status` with sudo
4419 Then stdout matches regexp:
4420 """
4421 fips +yes +enabled
4422@@ -790,15 +827,15 @@ Feature: Enable command behaviour when attached to an UA subscription
4423 When I attach `contract_token` with sudo
4424 Then stdout matches regexp:
4425 """
4426- UA Infra: ESM enabled
4427+ Ubuntu Pro: ESM Infra enabled
4428 """
4429 And stdout matches regexp:
4430 """
4431 Installing canonical-livepatch snap
4432 Canonical livepatch enabled
4433 """
4434- When I run `ua disable livepatch` with sudo
4435- And I run `ua enable fips-updates --assume-yes` with sudo
4436+ When I run `pro disable livepatch` with sudo
4437+ And I run `pro enable fips-updates --assume-yes` with sudo
4438 Then I will see the following on stdout:
4439 """
4440 One moment, checking your subscription first
4441@@ -807,7 +844,7 @@ Feature: Enable command behaviour when attached to an UA subscription
4442 FIPS Updates enabled
4443 A reboot is required to complete install.
4444 """
4445- When I verify that running `ua enable fips --assume-yes` `with sudo` exits `1`
4446+ When I verify that running `pro enable fips --assume-yes` `with sudo` exits `1`
4447 Then I will see the following on stdout
4448 """
4449 One moment, checking your subscription first
4450@@ -826,75 +863,75 @@ Feature: Enable command behaviour when attached to an UA subscription
4451 Scenario Outline: Attached enable ros on a machine
4452 Given a `<release>` machine with ubuntu-advantage-tools installed
4453 When I attach `contract_token` with sudo
4454- And I run `ua status --all` as non-root
4455+ And I run `pro status --all` as non-root
4456 Then stdout matches regexp
4457 """
4458 ros +yes disabled Security Updates for the Robot Operating System
4459 """
4460- When I run `ua enable ros --assume-yes --beta` with sudo
4461- And I run `ua status --all` as non-root
4462+ When I run `pro enable ros --assume-yes` with sudo
4463+ And I run `pro status --all` as non-root
4464 Then stdout matches regexp
4465 """
4466 ros +yes enabled Security Updates for the Robot Operating System
4467 """
4468 And stdout matches regexp
4469 """
4470- esm-apps +yes enabled UA Apps: Extended Security Maintenance \(ESM\)
4471+ esm-apps +yes enabled Expanded Security Maintenance for Applications
4472 """
4473 And stdout matches regexp
4474 """
4475- esm-infra +yes enabled UA Infra: Extended Security Maintenance \(ESM\)
4476+ esm-infra +yes enabled Expanded Security Maintenance for Infrastructure
4477 """
4478- When I verify that running `ua disable esm-apps` `with sudo` and stdin `N` exits `1`
4479+ When I verify that running `pro disable esm-apps` `with sudo` and stdin `N` exits `1`
4480 Then stdout matches regexp
4481 """
4482- ROS ESM Security Updates depends on UA Apps: ESM.
4483- Disable ROS ESM Security Updates and proceed to disable UA Apps: ESM\? \(y\/N\) Cannot disable UA Apps: ESM when ROS ESM Security Updates is enabled.
4484+ ROS ESM Security Updates depends on Ubuntu Pro: ESM Apps.
4485+ Disable ROS ESM Security Updates and proceed to disable Ubuntu Pro: ESM Apps\? \(y\/N\) Cannot disable Ubuntu Pro: ESM Apps when ROS ESM Security Updates is enabled.
4486 """
4487- When I run `ua disable esm-apps` `with sudo` and stdin `y`
4488+ When I run `pro disable esm-apps` `with sudo` and stdin `y`
4489 Then stdout matches regexp
4490 """
4491- ROS ESM Security Updates depends on UA Apps: ESM.
4492- Disable ROS ESM Security Updates and proceed to disable UA Apps: ESM\? \(y\/N\) Disabling dependent service: ROS ESM Security Updates
4493+ ROS ESM Security Updates depends on Ubuntu Pro: ESM Apps.
4494+ Disable ROS ESM Security Updates and proceed to disable Ubuntu Pro: ESM Apps\? \(y\/N\) Disabling dependent service: ROS ESM Security Updates
4495 Updating package lists
4496 """
4497- When I run `ua status --all` as non-root
4498+ When I run `pro status --all` as non-root
4499 Then stdout matches regexp
4500 """
4501 ros +yes disabled Security Updates for the Robot Operating System
4502 """
4503 And stdout matches regexp
4504 """
4505- esm-apps +yes disabled UA Apps: Extended Security Maintenance \(ESM\)
4506+ esm-apps +yes disabled Expanded Security Maintenance for Applications
4507 """
4508- When I verify that running `ua enable ros --beta` `with sudo` and stdin `N` exits `1`
4509+ When I verify that running `pro enable ros` `with sudo` and stdin `N` exits `1`
4510 Then stdout matches regexp
4511 """
4512- ROS ESM Security Updates cannot be enabled with UA Apps: ESM disabled.
4513- Enable UA Apps: ESM and proceed to enable ROS ESM Security Updates\? \(y\/N\) Cannot enable ROS ESM Security Updates when UA Apps: ESM is disabled.
4514+ ROS ESM Security Updates cannot be enabled with Ubuntu Pro: ESM Apps disabled.
4515+ Enable Ubuntu Pro: ESM Apps and proceed to enable ROS ESM Security Updates\? \(y\/N\) Cannot enable ROS ESM Security Updates when Ubuntu Pro: ESM Apps is disabled.
4516 """
4517- When I run `ua enable ros --beta` `with sudo` and stdin `y`
4518+ When I run `pro enable ros` `with sudo` and stdin `y`
4519 Then stdout matches regexp
4520 """
4521 One moment, checking your subscription first
4522- ROS ESM Security Updates cannot be enabled with UA Apps: ESM disabled.
4523- Enable UA Apps: ESM and proceed to enable ROS ESM Security Updates\? \(y\/N\) Enabling required service: UA Apps: ESM
4524- UA Apps: ESM enabled
4525+ ROS ESM Security Updates cannot be enabled with Ubuntu Pro: ESM Apps disabled.
4526+ Enable Ubuntu Pro: ESM Apps and proceed to enable ROS ESM Security Updates\? \(y\/N\) Enabling required service: Ubuntu Pro: ESM Apps
4527+ Ubuntu Pro: ESM Apps enabled
4528 Updating package lists
4529 ROS ESM Security Updates enabled
4530 """
4531- When I run `ua status --all` as non-root
4532+ When I run `pro status --all` as non-root
4533 Then stdout matches regexp
4534 """
4535 ros +yes enabled Security Updates for the Robot Operating System
4536 """
4537 And stdout matches regexp
4538 """
4539- esm-apps +yes enabled UA Apps: Extended Security Maintenance \(ESM\)
4540+ esm-apps +yes enabled Expanded Security Maintenance for Applications
4541 """
4542 And stdout matches regexp
4543 """
4544- esm-infra +yes enabled UA Infra: Extended Security Maintenance \(ESM\)
4545+ esm-infra +yes enabled Expanded Security Maintenance for Infrastructure
4546 """
4547 When I run `apt-cache policy` as non-root
4548 Then apt-cache policy for the following url has permission `500`
4549@@ -904,8 +941,8 @@ Feature: Enable command behaviour when attached to an UA subscription
4550 When I run `apt install python3-catkin-pkg -y` with sudo
4551 Then I verify that `python3-catkin-pkg` is installed from apt source `<ros-security-source>`
4552
4553- When I run `ua enable ros-updates --assume-yes --beta` with sudo
4554- And I run `ua status --all` as non-root
4555+ When I run `pro enable ros-updates --assume-yes` with sudo
4556+ And I run `pro status --all` as non-root
4557 Then stdout matches regexp
4558 """
4559 ros-updates +yes enabled All Updates for the Robot Operating System
4560@@ -917,14 +954,14 @@ Feature: Enable command behaviour when attached to an UA subscription
4561 """
4562 When I run `apt install python3-catkin-pkg -y` with sudo
4563 Then I verify that `python3-catkin-pkg` is installed from apt source `<ros-updates-source>`
4564- When I run `ua disable ros` `with sudo` and stdin `y`
4565+ When I run `pro disable ros` `with sudo` and stdin `y`
4566 Then stdout matches regexp
4567 """
4568 ROS ESM All Updates depends on ROS ESM Security Updates.
4569 Disable ROS ESM All Updates and proceed to disable ROS ESM Security Updates\? \(y\/N\) Disabling dependent service: ROS ESM All Updates
4570 Updating package lists
4571 """
4572- When I run `ua enable ros-updates --beta` `with sudo` and stdin `y`
4573+ When I run `pro enable ros-updates` `with sudo` and stdin `y`
4574 Then stdout matches regexp
4575 """
4576 One moment, checking your subscription first
4577@@ -934,7 +971,7 @@ Feature: Enable command behaviour when attached to an UA subscription
4578 Updating package lists
4579 ROS ESM All Updates enabled
4580 """
4581- When I run `ua status --all` as non-root
4582+ When I run `pro status --all` as non-root
4583 Then stdout matches regexp
4584 """
4585 ros-updates +yes enabled All Updates for the Robot Operating System
4586@@ -943,12 +980,12 @@ Feature: Enable command behaviour when attached to an UA subscription
4587 """
4588 ros +yes enabled Security Updates for the Robot Operating System
4589 """
4590- When I run `ua disable ros-updates --assume-yes` with sudo
4591- When I run `ua disable ros --assume-yes` with sudo
4592- When I run `ua disable esm-apps --assume-yes` with sudo
4593- When I run `ua disable esm-infra --assume-yes` with sudo
4594- When I run `ua enable ros-updates --assume-yes --beta` with sudo
4595- When I run `ua status --all` as non-root
4596+ When I run `pro disable ros-updates --assume-yes` with sudo
4597+ When I run `pro disable ros --assume-yes` with sudo
4598+ When I run `pro disable esm-apps --assume-yes` with sudo
4599+ When I run `pro disable esm-infra --assume-yes` with sudo
4600+ When I run `pro enable ros-updates --assume-yes` with sudo
4601+ When I run `pro status --all` as non-root
4602 Then stdout matches regexp
4603 """
4604 ros-updates +yes enabled All Updates for the Robot Operating System
4605@@ -959,13 +996,13 @@ Feature: Enable command behaviour when attached to an UA subscription
4606 """
4607 And stdout matches regexp
4608 """
4609- esm-apps +yes enabled UA Apps: Extended Security Maintenance \(ESM\)
4610+ esm-apps +yes enabled Expanded Security Maintenance for Applications
4611 """
4612 And stdout matches regexp
4613 """
4614- esm-infra +yes enabled UA Infra: Extended Security Maintenance \(ESM\)
4615+ esm-infra +yes enabled Expanded Security Maintenance for Infrastructure
4616 """
4617- When I run `ua detach` `with sudo` and stdin `y`
4618+ When I run `pro detach` `with sudo` and stdin `y`
4619 Then stdout matches regexp:
4620 """
4621 Updating package lists
4622@@ -1059,8 +1096,39 @@ Feature: Enable command behaviour when attached to an UA subscription
4623 machine_token_overlay: "/tmp/machine-token-overlay.json"
4624 """
4625 And I attach `contract_token` with sudo
4626- And I verify that running `ua enable fips --assume-yes` `with sudo` exits `1`
4627+ And I verify that running `pro enable fips --assume-yes` `with sudo` exits `1`
4628 Then stderr matches regexp:
4629 """
4630 Stderr: E: Unable to locate package some-package-aws
4631 """
4632+
4633+ @series.xenial
4634+ @uses.config.contract_token
4635+ @uses.config.machine_type.lxd.container
4636+ Scenario Outline: APT auth file is edited correctly on enable
4637+ Given a `<release>` machine with ubuntu-advantage-tools installed
4638+ When I attach `contract_token` with sudo
4639+ When I run `wc -l /etc/apt/auth.conf.d/90ubuntu-advantage` with sudo
4640+ Then I will see the following on stdout:
4641+ """
4642+ 2 /etc/apt/auth.conf.d/90ubuntu-advantage
4643+ """
4644+ # simulate a scenario where the line should get replaced
4645+ When I run `cp /etc/apt/auth.conf.d/90ubuntu-advantage /etc/apt/auth.conf.d/90ubuntu-advantage.backup` with sudo
4646+ When I run `pro disable esm-infra` with sudo
4647+ When I run `cp /etc/apt/auth.conf.d/90ubuntu-advantage.backup /etc/apt/auth.conf.d/90ubuntu-advantage` with sudo
4648+ When I run `pro enable esm-infra` with sudo
4649+ When I run `wc -l /etc/apt/auth.conf.d/90ubuntu-advantage` with sudo
4650+ Then I will see the following on stdout:
4651+ """
4652+ 2 /etc/apt/auth.conf.d/90ubuntu-advantage
4653+ """
4654+ When I run `pro enable cis` with sudo
4655+ When I run `wc -l /etc/apt/auth.conf.d/90ubuntu-advantage` with sudo
4656+ Then I will see the following on stdout:
4657+ """
4658+ 3 /etc/apt/auth.conf.d/90ubuntu-advantage
4659+ """
4660+ Examples: ubuntu release
4661+ | release |
4662+ | xenial |
4663diff --git a/features/attached_status.feature b/features/attached_status.feature
4664index 59406e7..b6cf42d 100644
4665--- a/features/attached_status.feature
4666+++ b/features/attached_status.feature
4667@@ -6,9 +6,9 @@ Feature: Attached status
4668 Scenario Outline: Attached status in a ubuntu machine - formatted
4669 Given a `<release>` machine with ubuntu-advantage-tools installed
4670 When I attach `contract_token` with sudo
4671- And I run `ua status --format json` as non-root
4672+ And I run `pro status --format json` as non-root
4673 Then stdout is a json matching the `ua_status` schema
4674- When I run `ua status --format yaml` as non-root
4675+ When I run `pro status --format yaml` as non-root
4676 Then stdout is a yaml matching the `ua_status` schema
4677
4678 Examples: ubuntu release
4679@@ -16,5 +16,170 @@ Feature: Attached status
4680 | bionic |
4681 | focal |
4682 | xenial |
4683- | impish |
4684+ | jammy |
4685+ | kinetic |
4686+
4687+ @series.xenial
4688+ @uses.config.machine_type.lxd.container
4689+ Scenario Outline: Non-root status can see in-progress operations
4690+ Given a `<release>` machine with ubuntu-advantage-tools installed
4691+ When I attach `contract_token` with sudo
4692+ When I run shell command `sudo pro enable cis >/dev/null & pro status` as non-root
4693+ Then stdout matches regexp:
4694+ """
4695+ NOTICES
4696+ Operation in progress: pro enable
4697+ """
4698+ When I run `pro status --wait` as non-root
4699+ When I run `pro disable cis --assume-yes` with sudo
4700+ When I run shell command `sudo pro enable cis & pro status --wait` as non-root
4701+ Then stdout matches regexp:
4702+ """
4703+ One moment, checking your subscription first
4704+ Updating package lists
4705+ Installing CIS Audit packages
4706+ CIS Audit enabled
4707+ Visit https://ubuntu.com/security/cis to learn how to use CIS
4708+ \.+
4709+ SERVICE +ENTITLED +STATUS +DESCRIPTION
4710+ """
4711+ Then stdout does not match regexp:
4712+ """
4713+ NOTICES
4714+ Operation in progress: pro enable
4715+ """
4716+ When I run `pro disable cis --assume-yes` with sudo
4717+ When I run `apt-get install jq -y` with sudo
4718+ When I run shell command `sudo pro enable cis >/dev/null & pro status --format json | jq -r .execution_status` as non-root
4719+ Then I will see the following on stdout:
4720+ """
4721+ active
4722+ """
4723+ Examples: ubuntu release
4724+ | release |
4725+ | xenial |
4726+
4727+ @series.xenial
4728+ @series.bionic
4729+ @uses.config.machine_type.lxd.container
4730+ Scenario Outline: Attached status in a ubuntu machine
4731+ Given a `<release>` machine with ubuntu-advantage-tools installed
4732+ When I attach `contract_token` with sudo
4733+ And I verify root and non-root `pro status` calls have the same output
4734+ And I run `pro status` as non-root
4735+ Then stdout matches regexp:
4736+ """
4737+ SERVICE +ENTITLED +STATUS +DESCRIPTION
4738+ cc-eal +yes +disabled +Common Criteria EAL2 Provisioning Packages
4739+ cis +yes +disabled +Security compliance and audit tools
4740+ esm-apps +yes +enabled +Expanded Security Maintenance for Applications
4741+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
4742+ fips +yes +disabled +NIST-certified core packages
4743+ fips-updates +yes +disabled +NIST-certified core packages with priority security updates
4744+ ros +yes +disabled +Security Updates for the Robot Operating System
4745+ ros-updates +yes +disabled +All Updates for the Robot Operating System
4746+
4747+ Enable services with: pro enable <service>
4748+ """
4749+ When I verify root and non-root `pro status --all` calls have the same output
4750+ And I run `pro status --all` as non-root
4751+ Then stdout matches regexp:
4752+ """
4753+ SERVICE +ENTITLED +STATUS +DESCRIPTION
4754+ cc-eal +yes +disabled +Common Criteria EAL2 Provisioning Packages
4755+ cis +yes +disabled +Security compliance and audit tools
4756+ esm-apps +yes +enabled +Expanded Security Maintenance for Applications
4757+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
4758+ fips +yes +disabled +NIST-certified core packages
4759+ fips-updates +yes +disabled +NIST-certified core packages with priority security updates
4760+ livepatch +yes +n/a +Canonical Livepatch service
4761+ realtime-kernel +yes +n/a +Beta-version Ubuntu Kernel with PREEMPT_RT patches
4762+ ros +yes +disabled +Security Updates for the Robot Operating System
4763+ ros-updates +yes +disabled +All Updates for the Robot Operating System
4764+
4765+ Enable services with: pro enable <service>
4766+ """
4767+
4768+ Examples: ubuntu release
4769+ | release |
4770+ | xenial |
4771+ | bionic |
4772+
4773+ @series.focal
4774+ @uses.config.machine_type.lxd.container
4775+ Scenario Outline: Attached status in a ubuntu machine
4776+ Given a `<release>` machine with ubuntu-advantage-tools installed
4777+ When I attach `contract_token` with sudo
4778+ And I verify root and non-root `pro status` calls have the same output
4779+ And I run `pro status` as non-root
4780+ Then stdout matches regexp:
4781+ """
4782+ SERVICE +ENTITLED +STATUS +DESCRIPTION
4783+ esm-apps +yes +enabled +Expanded Security Maintenance for Applications
4784+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
4785+ fips +yes +disabled +NIST-certified core packages
4786+ fips-updates +yes +disabled +NIST-certified core packages with priority security updates
4787+ usg +yes +disabled +Security compliance and audit tools
4788+
4789+ Enable services with: pro enable <service>
4790+ """
4791+ When I verify root and non-root `pro status --all` calls have the same output
4792+ And I run `pro status --all` as non-root
4793+ Then stdout matches regexp:
4794+ """
4795+ SERVICE +ENTITLED +STATUS +DESCRIPTION
4796+ cc-eal +yes +n/a +Common Criteria EAL2 Provisioning Packages
4797+ esm-apps +yes +enabled +Expanded Security Maintenance for Applications
4798+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
4799+ fips +yes +disabled +NIST-certified core packages
4800+ fips-updates +yes +disabled +NIST-certified core packages with priority security updates
4801+ livepatch +yes +n/a +Canonical Livepatch service
4802+ realtime-kernel +yes +n/a +Beta-version Ubuntu Kernel with PREEMPT_RT patches
4803+ ros +yes +n/a +Security Updates for the Robot Operating System
4804+ ros-updates +yes +n/a +All Updates for the Robot Operating System
4805+ usg +yes +disabled +Security compliance and audit tools
4806+
4807+ Enable services with: pro enable <service>
4808+ """
4809+
4810+ Examples: ubuntu release
4811+ | release |
4812+ | focal |
4813+
4814+ @series.jammy
4815+ @uses.config.machine_type.lxd.container
4816+ Scenario Outline: Attached status in the latest LTS ubuntu machine
4817+ Given a `<release>` machine with ubuntu-advantage-tools installed
4818+ When I attach `contract_token` with sudo
4819+ And I verify root and non-root `pro status` calls have the same output
4820+ And I run `pro status` as non-root
4821+ Then stdout matches regexp:
4822+ """
4823+ SERVICE +ENTITLED +STATUS +DESCRIPTION
4824+ esm-apps +yes +enabled +Expanded Security Maintenance for Applications
4825+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
4826+
4827+ Enable services with: pro enable <service>
4828+ """
4829+ When I verify root and non-root `pro status --all` calls have the same output
4830+ And I run `pro status --all` as non-root
4831+ Then stdout matches regexp:
4832+ """
4833+ SERVICE +ENTITLED +STATUS +DESCRIPTION
4834+ cc-eal +yes +n/a +Common Criteria EAL2 Provisioning Packages
4835+ esm-apps +yes +enabled +Expanded Security Maintenance for Applications
4836+ esm-infra +yes +enabled +Expanded Security Maintenance for Infrastructure
4837+ fips +yes +n/a +NIST-certified core packages
4838+ fips-updates +yes +n/a +NIST-certified core packages with priority security updates
4839+ livepatch +yes +n/a +Canonical Livepatch service
4840+ realtime-kernel +yes +n/a +Beta-version Ubuntu Kernel with PREEMPT_RT patches
4841+ ros +yes +n/a +Security Updates for the Robot Operating System
4842+ ros-updates +yes +n/a +All Updates for the Robot Operating System
4843+ usg +yes +n/a +Security compliance and audit tools
4844+
4845+ Enable services with: pro enable <service>
4846+ """
4847+
4848+ Examples: ubuntu release
4849+ | release |
4850 | jammy |
4851diff --git a/features/aws-ids.yaml b/features/aws-ids.yaml
4852deleted file mode 100644
4853index 803f9ef..0000000
4854--- a/features/aws-ids.yaml
4855+++ /dev/null
4856@@ -1,7 +0,0 @@
4857-bionic: ami-0ab76d42180343ad1
4858-bionic-fips: ami-03b75f613f80bcff1
4859-focal: ami-098bbb131bcc971d9
4860-focal-fips: ami-02782bf2569bf457c
4861-jammy: ami-0e6235eb0fe67fd3c
4862-xenial: ami-011bcfe2bea365b6a
4863-xenial-fips: ami-077e4c339a098fc9f
4864diff --git a/features/azure-ids.yaml b/features/azure-ids.yaml
4865deleted file mode 100644
4866index 5443e05..0000000
4867--- a/features/azure-ids.yaml
4868+++ /dev/null
4869@@ -1,7 +0,0 @@
4870-bionic: "Canonical:0001-com-ubuntu-pro-bionic:pro-18_04-lts"
4871-focal: "Canonical:0001-com-ubuntu-pro-focal:pro-20_04-lts"
4872-jammy: "Canonical:0001-com-ubuntu-pro-jammy:pro-22_04-lts"
4873-xenial: "Canonical:0001-com-ubuntu-pro-xenial:pro-16_04-lts"
4874-bionic-fips: "Canonical:0001-com-ubuntu-pro-bionic-fips:pro-fips-18_04"
4875-xenial-fips: "Canonical:0001-com-ubuntu-pro-xenial-fips:pro-fips-16_04-private"
4876-focal-fips: "Canonical:0001-com-ubuntu-pro-focal-fips:pro-fips-20_04"
4877diff --git a/features/cloud.py b/features/cloud.py
4878index 29d8924..ea030b6 100644
4879--- a/features/cloud.py
4880+++ b/features/cloud.py
4881@@ -6,7 +6,7 @@ from typing import List, Optional
4882
4883 import pycloudlib # type: ignore
4884 import toml
4885-import yaml
4886+from pycloudlib.cloud import ImageType # type: ignore
4887
4888 DEFAULT_CONFIG_PATH = "~/.config/pycloudlib.toml"
4889
4890@@ -28,7 +28,6 @@ class Cloud:
4891 """
4892
4893 name = ""
4894- pro_ids_path = ""
4895
4896 def __init__(
4897 self,
4898@@ -195,17 +194,13 @@ class Cloud:
4899 "Must provide either series or image_name to launch azure"
4900 )
4901
4902- if "pro" in self.machine_type:
4903- with open(self.pro_ids_path, "r") as stream:
4904- pro_ids = yaml.safe_load(stream.read())
4905- if "fips" in self.machine_type:
4906- image_name = pro_ids[series + "-fips"]
4907- else:
4908- image_name = pro_ids[series]
4909- else:
4910- image_name = self.api.daily_image(release=series)
4911+ image_type = ImageType.GENERIC
4912+ if "pro.fips" in self.machine_type:
4913+ image_type = ImageType.PRO_FIPS
4914+ elif "pro" in self.machine_type:
4915+ image_type = ImageType.PRO
4916
4917- return image_name
4918+ return self.api.daily_image(release=series, image_type=image_type)
4919
4920 def manage_ssh_key(
4921 self,
4922@@ -243,7 +238,6 @@ class EC2(Cloud):
4923 """Class that represents the EC2 cloud provider."""
4924
4925 name = "aws"
4926- pro_ids_path = "features/aws-ids.yaml"
4927
4928 @property
4929 def pycloudlib_cls(self):
4930@@ -334,7 +328,6 @@ class Azure(Cloud):
4931 """Class that represents the Azure cloud provider."""
4932
4933 name = "Azure"
4934- pro_ids_path = "features/azure-ids.yaml"
4935
4936 @property
4937 def pycloudlib_cls(self):
4938@@ -439,7 +432,6 @@ class GCP(Cloud):
4939 """Class that represents the Google Cloud Platform cloud provider."""
4940
4941 name = "gcp"
4942- pro_ids_path = "features/gcp-ids.yaml"
4943 cls_type = pycloudlib.GCE
4944
4945 @property
4946diff --git a/features/cloud_pro_clone.feature b/features/cloud_pro_clone.feature
4947new file mode 100644
4948index 0000000..f08bff0
4949--- /dev/null
4950+++ b/features/cloud_pro_clone.feature
4951@@ -0,0 +1,65 @@
4952+Feature: Creating golden images based on Cloud Ubuntu Pro instances
4953+
4954+ @series.lts
4955+ @uses.config.machine_type.aws.pro
4956+ @uses.config.machine_type.azure.pro
4957+ @uses.config.machine_type.gcp.pro
4958+ Scenario Outline: Create a Pro fips-updates image and launch
4959+ Given a `<release>` machine with ubuntu-advantage-tools installed
4960+ When I create the file `/etc/ubuntu-advantage/uaclient.conf` with the following:
4961+ """
4962+ contract_url: 'https://contracts.canonical.com'
4963+ data_dir: /var/lib/ubuntu-advantage
4964+ log_level: debug
4965+ log_file: /var/log/ubuntu-advantage.log
4966+ """
4967+ When I run `pro auto-attach` with sudo
4968+ And I run `pro status --format yaml` with sudo
4969+ Then stdout matches regexp:
4970+ """
4971+ attached: true
4972+ """
4973+ When I run `apt install -y jq` with sudo
4974+ When I save the `activityInfo.activityToken` value from the contract
4975+ When I save the `activityInfo.activityID` value from the contract
4976+ When I run `pro enable fips-updates --assume-yes` with sudo
4977+ And I run `pro status --format yaml` with sudo
4978+ Then stdout matches regexp:
4979+ """
4980+ name: fips-updates
4981+ status: enabled
4982+ """
4983+ When I reboot the machine
4984+ When I take a snapshot of the machine
4985+ When I reboot the machine
4986+ When I run `python3 /usr/lib/ubuntu-advantage/timer.py` with sudo
4987+ Then I verify that `activityInfo.activityToken` value has been updated on the contract
4988+ Then I verify that `activityInfo.activityID` value has not been updated on the contract
4989+ When I launch a `clone` machine from the snapshot
4990+ # The clone will run auto-attach on boot
4991+ When I run `pro status --wait` `with sudo` on the `clone` machine
4992+ When I run `pro status --format yaml` `with sudo` on the `clone` machine
4993+ Then stdout matches regexp:
4994+ """
4995+ attached: true
4996+ """
4997+ When I run `python3 /usr/lib/ubuntu-advantage/timer.py` `with sudo` on the `clone` machine
4998+ Then I verify that `activityInfo.activityToken` value has been updated on the contract on the `clone` machine
4999+ Then I verify that `activityInfo.activityID` value has been updated on the contract on the `clone` machine
5000+ When I run `pro status --format yaml` `with sudo` on the `clone` machine
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: