Skip to content

Commit

Permalink
Revert "esm: pin repositories to a higher priority using static files"
Browse files Browse the repository at this point in the history
This reverts commit ccf8a03.
  • Loading branch information
lucasmoura authored and renanrodrigo committed Sep 28, 2023
1 parent 71aab65 commit 826a1e2
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 64 deletions.
4 changes: 2 additions & 2 deletions features/airgapped.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ Feature: Performing attach using ua-airgapped
When I run `apt-cache policy hello` with sudo
Then stdout matches regexp:
"""
510 .*:9000/ubuntu jammy-apps-security/main
500 .*:9000/ubuntu jammy-apps-security/main
"""
And stdout matches regexp:
"""
510 .*:8000/ubuntu jammy-infra-security/main
500 .*:8000/ubuntu jammy-infra-security/main
"""
Then I verify that running `pro refresh` `with sudo` exits `0`

Expand Down
16 changes: 6 additions & 10 deletions features/attached_enable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,16 @@ Feature: Enable command behaviour when attached to an Ubuntu Pro subscription
See: sudo pro status
"""
When I run `apt-cache policy` with sudo
Then apt-cache policy for the following url has priority `510`
Then apt-cache policy for the following url has priority `500`
"""
<esm-infra-url> <release>-infra-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
"""
<esm-infra-url> <release>-infra-security/main amd64 Packages
"""
And I verify that running `apt update` `with sudo` exits `0`
When I run `apt install -y <infra-pkg>` with sudo, retrying exit [100]
And I run `apt-cache policy <infra-pkg>` as non-root
Then stdout matches regexp:
"""
\s*510 <esm-infra-url> <release>-infra-security/main amd64 Packages
\s*500 <esm-infra-url> <release>-infra-security/main amd64 Packages
"""

Examples: ubuntu release
Expand Down Expand Up @@ -1131,11 +1127,11 @@ Feature: Enable command behaviour when attached to an Ubuntu Pro subscription
"""
And I verify that running `apt update` `with sudo` exits `0`
When I run `apt-cache policy` as non-root
Then apt-cache policy for the following url has priority `510`
Then apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
Expand All @@ -1145,8 +1141,8 @@ Feature: Enable command behaviour when attached to an Ubuntu Pro subscription
Then stdout matches regexp:
"""
Version table:
\s*\*\*\* .* 510
\s*510 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
\s*\*\*\* .* 500
\s*500 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
When I verify that running `pro enable esm-apps` `with sudo` exits `1`
Then stdout matches regexp
Expand Down
42 changes: 21 additions & 21 deletions features/ubuntu_pro.feature
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,19 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO image
To use a different subscription first run: sudo pro detach.
"""
When I run `apt-cache policy` with sudo
Then apt-cache policy for the following url has priority `510`
Then apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
Expand All @@ -310,7 +310,7 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO image
And I run `apt-cache policy <infra-pkg>` as non-root
Then stdout matches regexp:
"""
\s*510 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
\s*500 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And stdout matches regexp:
"""
Expand All @@ -321,8 +321,8 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO image
Then stdout matches regexp:
"""
Version table:
\s*\*\*\* .* 510
\s*510 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
\s*\*\*\* .* 500
\s*500 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
When I create the file `/var/lib/ubuntu-advantage/marker-reboot-cmds-required` with the following:
"""
Expand Down Expand Up @@ -416,19 +416,19 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO image
To use a different subscription first run: sudo pro detach.
"""
When I run `apt-cache policy` with sudo
Then apt-cache policy for the following url has priority `510`
Then apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
Expand All @@ -437,7 +437,7 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO image
And I run `apt-cache policy <infra-pkg>` as non-root
Then stdout matches regexp:
"""
\s*510 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
\s*500 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And stdout matches regexp:
"""
Expand All @@ -448,8 +448,8 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO image
Then stdout matches regexp:
"""
Version table:
\s*\*\*\* .* 510
\s*510 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
\s*\*\*\* .* 500
\s*500 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
When I create the file `/var/lib/ubuntu-advantage/marker-reboot-cmds-required` with the following:
"""
Expand Down Expand Up @@ -542,19 +542,19 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO image
To use a different subscription first run: sudo pro detach.
"""
When I run `apt-cache policy` with sudo
Then apt-cache policy for the following url has priority `510`
Then apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
Expand All @@ -563,7 +563,7 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO image
And I run `apt-cache policy <infra-pkg>` as non-root
Then stdout matches regexp:
"""
\s*510 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
\s*500 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And stdout matches regexp:
"""
Expand All @@ -574,8 +574,8 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO image
Then stdout matches regexp:
"""
Version table:
\s*\*\*\* .* 510
\s*510 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
\s*\*\*\* .* 500
\s*500 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
When I create the file `/var/lib/ubuntu-advantage/marker-reboot-cmds-required` with the following:
"""
Expand Down
48 changes: 24 additions & 24 deletions features/ubuntu_pro_fips.feature
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO fips image
To use a different subscription first run: sudo pro detach.
"""
When I run `apt-cache policy` with sudo
Then apt-cache policy for the following url has priority `510`
Then apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
Expand All @@ -85,11 +85,11 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO fips image
And I run `apt-cache policy <infra-pkg>` as non-root
Then stdout matches regexp:
"""
\s*510 https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
\s*500 https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
"""
Then stdout matches regexp:
"""
\s*510 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
\s*500 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And stdout matches regexp:
"""
Expand All @@ -100,8 +100,8 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO fips image
Then stdout matches regexp:
"""
Version table:
\s*\*\*\* .* 510
\s*510 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
\s*\*\*\* .* 500
\s*500 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
When I run `pro enable fips-updates --assume-yes` with sudo
Then I will see the following on stdout:
Expand Down Expand Up @@ -280,19 +280,19 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO fips image
To use a different subscription first run: sudo pro detach.
"""
When I run `apt-cache policy` with sudo
Then apt-cache policy for the following url has priority `510`
Then apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
Expand All @@ -305,11 +305,11 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO fips image
And I run `apt-cache policy <infra-pkg>` as non-root
Then stdout matches regexp:
"""
\s*510 https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
\s*500 https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
"""
Then stdout matches regexp:
"""
\s*510 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
\s*500 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And stdout matches regexp:
"""
Expand All @@ -320,8 +320,8 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO fips image
Then stdout matches regexp:
"""
Version table:
\s*\*\*\* .* 510
\s*510 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
\s*\*\*\* .* 500
\s*500 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
When I run `pro enable fips-updates --assume-yes` with sudo
Then I will see the following on stdout:
Expand Down Expand Up @@ -554,19 +554,19 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO fips image
To use a different subscription first run: sudo pro detach.
"""
When I run `apt-cache policy` with sudo
Then apt-cache policy for the following url has priority `510`
Then apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-updates/main amd64 Packages
"""
And apt-cache policy for the following url has priority `510`
And apt-cache policy for the following url has priority `500`
"""
https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
Expand All @@ -579,11 +579,11 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO fips image
And I run `apt-cache policy <infra-pkg>` as non-root
Then stdout matches regexp:
"""
\s*510 https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
\s*500 https://esm.ubuntu.com/infra/ubuntu <release>-infra-security/main amd64 Packages
"""
Then stdout matches regexp:
"""
\s*510 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
\s*500 https://esm.ubuntu.com/infra/ubuntu <release>-infra-updates/main amd64 Packages
"""
And stdout matches regexp:
"""
Expand All @@ -594,8 +594,8 @@ Feature: Command behaviour when auto-attached in an ubuntu PRO fips image
Then stdout matches regexp:
"""
Version table:
\s*\*\*\* .* 510
\s*510 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
\s*\*\*\* .* 500
\s*500 https://esm.ubuntu.com/apps/ubuntu <release>-apps-security/main amd64 Packages
"""
When I run `pro enable fips-updates --assume-yes` with sudo
Then I will see the following on stdout:
Expand Down
3 changes: 0 additions & 3 deletions preferences.d/ubuntu-pro-esm-apps

This file was deleted.

3 changes: 0 additions & 3 deletions preferences.d/ubuntu-pro-esm-infra

This file was deleted.

1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def _get_data_files():
"/etc/update-manager/release-upgrades.d/",
["release-upgrades.d/ubuntu-advantage-upgrades.cfg"],
),
("/etc/apt/preferences.d", glob.glob("preferences.d/*")),
(defaults.CONFIG_DEFAULTS["data_dir"], []),
("/lib/systemd/system", glob.glob("systemd/*")),
(
Expand Down

0 comments on commit 826a1e2

Please sign in to comment.