From 0708d632e00b0fc96d26b3df0cc0adb1f84148fe Mon Sep 17 00:00:00 2001 From: Renan Rodrigo Date: Fri, 12 Jan 2024 16:57:39 -0300 Subject: [PATCH] tests: fix check for private esm cache in upgrade test Signed-off-by: Renan Rodrigo --- features/ubuntu_upgrade_unattached.feature | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/features/ubuntu_upgrade_unattached.feature b/features/ubuntu_upgrade_unattached.feature index 39153e164a..de2dfb49ea 100644 --- a/features/ubuntu_upgrade_unattached.feature +++ b/features/ubuntu_upgrade_unattached.feature @@ -7,16 +7,18 @@ Feature: Upgrade between releases when uaclient is unattached Given a `` `` machine with ubuntu-advantage-tools installed # Local PPAs are prepared and served only when testing with local debs When I prepare the local PPAs to upgrade from `` to `` + # in case this still exists + And I delete the file `/var/lib/ubuntu-advantage/apt-esm/etc/apt/sources.list.d/ubuntu-esm-infra.list` And I apt update And I run `sleep 30` as non-root - And I run shell command `cat /var/lib/ubuntu-advantage/apt-esm/etc/apt/sources.list.d/ubuntu-esm-infra.list || true` with sudo - Then if `` in `xenial` and stdout matches regexp: + And I run shell command `cat /var/lib/ubuntu-advantage/apt-esm/etc/apt/sources.list.d/ubuntu-esm-infra.sources || true` with sudo + Then if `` in `xenial or bionic` and stdout matches regexp: """ - deb https://esm.ubuntu.com/infra/ubuntu -infra-security main - """ - And if `` in `xenial` and stdout matches regexp: - """ - deb https://esm.ubuntu.com/infra/ubuntu -infra-updates main + Types: deb + URIs: https://esm.ubuntu.com/infra/ubuntu + Suites: -infra-security -infra-updates + Components: main + Signed-By: /usr/share/keyrings/ubuntu-pro-esm-infra.gpg """ When I apt dist-upgrade # Some packages upgrade may require a reboot @@ -40,14 +42,14 @@ Feature: Upgrade between releases when uaclient is unattached """ And I verify that the folder `/var/lib/ubuntu-advantage/apt-esm` does not exist When I apt update - And I run shell command `cat /var/lib/ubuntu-advantage/apt-esm/etc/apt/sources.list.d/ubuntu-esm-apps.list || true` with sudo + And I run shell command `cat /var/lib/ubuntu-advantage/apt-esm/etc/apt/sources.list.d/ubuntu-esm-apps.sources || true` with sudo Then if `` not in `mantic or noble` and stdout matches regexp: """ - deb https://esm.ubuntu.com/apps/ubuntu -apps-security main - """ - And if `` not in `mantic or noble` and stdout matches regexp: - """ - deb https://esm.ubuntu.com/apps/ubuntu -apps-updates main + Types: deb + URIs: https://esm.ubuntu.com/apps/ubuntu + Suites: -apps-security -apps-updates + Components: main + Signed-By: /usr/share/keyrings/ubuntu-pro-esm-apps.gpg """ When I attach `contract_token` with sudo And I run `pro status --all` with sudo