diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2024-02-13 13:58:40 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-02-13 14:13:56 +0100 |
commit | 26e0e9b76fb06afe5250eeb8e5b3d069d4793432 (patch) | |
tree | f2b0d51bbd68dad28b652f8a8141551c9b0cffb9 /test | |
parent | 2845127968cda30be8423e1d3a24dae0e797bcc8 (diff) |
For phasing, check if current version is a security update, not just previous ones
We only considered an update a security update if a previous update
is a security update but not the update in question itself.
LP: #2051181
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/test-phased-updates-upgrade | 93 |
1 files changed, 60 insertions, 33 deletions
diff --git a/test/integration/test-phased-updates-upgrade b/test/integration/test-phased-updates-upgrade index fec8bece8..2f5327f05 100755 --- a/test/integration/test-phased-updates-upgrade +++ b/test/integration/test-phased-updates-upgrade @@ -19,6 +19,11 @@ insertinstalledpackage 'phased-security' 'all' '1' insertpackage 'unstable-security' 'phased-security' 'all' '2' insertpackage 'unstable-updates' 'phased-security' 'all' '3' 'Phased-Update-Percentage: 0' +# Test case phased-security: A phased package is in security and will be installed +insertinstalledpackage 'phased-security-same' 'all' '1' +insertpackage 'unstable-security' 'phased-security-same' 'all' '3' +insertpackage 'unstable-updates' 'phased-security-same' 'all' '3' 'Phased-Update-Percentage: 0' + # Test case phased-dep: A released update depends on the phased dependency phased-dep insertinstalledpackage 'phased-dep' 'all' '1' insertinstalledpackage 'depends-phased-dep' 'all' '1' @@ -51,14 +56,16 @@ The following NEW packages will be installed: The following packages have been kept back: depends-phased-dep phased phased-dep phased-depends-ready-dep ready-dep The following packages will be upgraded: - depends-phased-new phased-security -2 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. + depends-phased-new phased-security phased-security-same +3 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. Inst phased-new (3 unstable-updates [all]) Inst depends-phased-new [1] (3 unstable-updates [all]) Inst phased-security [1] (3 unstable-updates [all]) +Inst phased-security-same [1] (3 unstable-security, unstable-updates [all]) Conf phased-new (3 unstable-updates [all]) Conf depends-phased-new (3 unstable-updates [all]) -Conf phased-security (3 unstable-updates [all])" aptget dist-upgrade -s -q +Conf phased-security (3 unstable-updates [all]) +Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget dist-upgrade -s -q for always in APT::Get::Always-Include-Phased-Updates Update-Manager::Always-Include-Phased-Updates; do testsuccessequal "Reading package lists... @@ -68,8 +75,8 @@ The following NEW packages will be installed: phased-new The following packages will be upgraded: depends-phased-dep depends-phased-new phased phased-dep - phased-depends-ready-dep phased-security ready-dep -7 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. + phased-depends-ready-dep phased-security phased-security-same ready-dep +8 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Inst phased-dep [1] (3 unstable-updates [all]) Inst depends-phased-dep [1] (3 unstable-updates [all]) Inst phased-new (3 unstable-updates [all]) @@ -78,6 +85,7 @@ Inst phased [1] (3 unstable-updates [all]) Inst phased-depends-ready-dep [1] (3 unstable-updates [all]) [] Inst ready-dep [1] (3 unstable-updates [all]) Inst phased-security [1] (3 unstable-updates [all]) +Inst phased-security-same [1] (3 unstable-security, unstable-updates [all]) Conf phased-dep (3 unstable-updates [all]) Conf depends-phased-dep (3 unstable-updates [all]) Conf phased-new (3 unstable-updates [all]) @@ -85,7 +93,8 @@ Conf depends-phased-new (3 unstable-updates [all]) Conf phased (3 unstable-updates [all]) Conf phased-depends-ready-dep (3 unstable-updates [all]) Conf ready-dep (3 unstable-updates [all]) -Conf phased-security (3 unstable-updates [all])" aptget dist-upgrade -s -q -o $always=1 +Conf phased-security (3 unstable-updates [all]) +Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget dist-upgrade -s -q -o $always=1 done SOURCE_DATE_EPOCH=1 testsuccessequal "Reading package lists... @@ -95,8 +104,8 @@ The following NEW packages will be installed: phased-new The following packages will be upgraded: depends-phased-dep depends-phased-new phased phased-dep - phased-depends-ready-dep phased-security ready-dep -7 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. + phased-depends-ready-dep phased-security phased-security-same ready-dep +8 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Inst phased-dep [1] (3 unstable-updates [all]) Inst depends-phased-dep [1] (3 unstable-updates [all]) Inst phased-new (3 unstable-updates [all]) @@ -105,6 +114,7 @@ Inst phased [1] (3 unstable-updates [all]) Inst phased-depends-ready-dep [1] (3 unstable-updates [all]) [] Inst ready-dep [1] (3 unstable-updates [all]) Inst phased-security [1] (3 unstable-updates [all]) +Inst phased-security-same [1] (3 unstable-security, unstable-updates [all]) Conf phased-dep (3 unstable-updates [all]) Conf depends-phased-dep (3 unstable-updates [all]) Conf phased-new (3 unstable-updates [all]) @@ -112,7 +122,8 @@ Conf depends-phased-new (3 unstable-updates [all]) Conf phased (3 unstable-updates [all]) Conf phased-depends-ready-dep (3 unstable-updates [all]) Conf ready-dep (3 unstable-updates [all]) -Conf phased-security (3 unstable-updates [all])" aptget dist-upgrade -s -q -o with-source-date-epoch=1 +Conf phased-security (3 unstable-updates [all]) +Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget dist-upgrade -s -q -o with-source-date-epoch=1 for never in APT::Get::Never-Include-Phased-Updates Update-Manager::Never-Include-Phased-Updates; do testsuccessequal "Reading package lists... @@ -123,14 +134,16 @@ The following NEW packages will be installed: The following packages have been kept back: depends-phased-dep phased phased-dep phased-depends-ready-dep ready-dep The following packages will be upgraded: - depends-phased-new phased-security -2 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. + depends-phased-new phased-security phased-security-same +3 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. Inst phased-new (3 unstable-updates [all]) Inst depends-phased-new [1] (3 unstable-updates [all]) Inst phased-security [1] (3 unstable-updates [all]) +Inst phased-security-same [1] (3 unstable-security, unstable-updates [all]) Conf phased-new (3 unstable-updates [all]) Conf depends-phased-new (3 unstable-updates [all]) -Conf phased-security (3 unstable-updates [all])" aptget dist-upgrade -s -q -o $never=1 +Conf phased-security (3 unstable-updates [all]) +Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget dist-upgrade -s -q -o $never=1 done testsuccessequal "Reading package lists... @@ -141,14 +154,16 @@ The following NEW packages will be installed: The following packages have been kept back: depends-phased-dep phased phased-dep phased-depends-ready-dep ready-dep The following packages will be upgraded: - depends-phased-new phased-security -2 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. + depends-phased-new phased-security phased-security-same +3 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. Inst phased-new (3 unstable-updates [all]) Inst depends-phased-new [1] (3 unstable-updates [all]) Inst phased-security [1] (3 unstable-updates [all]) +Inst phased-security-same [1] (3 unstable-security, unstable-updates [all]) Conf phased-new (3 unstable-updates [all]) Conf depends-phased-new (3 unstable-updates [all]) -Conf phased-security (3 unstable-updates [all])" aptget upgrade -s -q --with-new-pkgs +Conf phased-security (3 unstable-updates [all]) +Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget upgrade -s -q --with-new-pkgs testsuccessequal "Reading package lists... Building dependency tree... @@ -157,10 +172,12 @@ The following packages have been kept back: depends-phased-dep depends-phased-new phased phased-dep phased-depends-ready-dep ready-dep The following packages will be upgraded: - phased-security -1 upgraded, 0 newly installed, 0 to remove and 6 not upgraded. + phased-security phased-security-same +2 upgraded, 0 newly installed, 0 to remove and 6 not upgraded. Inst phased-security [1] (3 unstable-updates [all]) -Conf phased-security (3 unstable-updates [all])" aptget upgrade -s -q +Inst phased-security-same [1] (3 unstable-security, unstable-updates [all]) +Conf phased-security (3 unstable-updates [all]) +Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget upgrade -s -q for upgrade in "dist-upgrade" "upgrade --with-new-pkgs"; do testsuccessequal "Reading package lists... @@ -172,17 +189,20 @@ The following packages have been kept back: phased phased-depends-ready-dep ready-dep The following packages will be upgraded: depends-phased-dep depends-phased-new phased-dep phased-security -4 upgraded, 1 newly installed, 0 to remove and 3 not upgraded. + phased-security-same +5 upgraded, 1 newly installed, 0 to remove and 3 not upgraded. Inst phased-dep [1] (3 unstable-updates [all]) Inst depends-phased-dep [1] (3 unstable-updates [all]) Inst phased-new (3 unstable-updates [all]) Inst depends-phased-new [1] (3 unstable-updates [all]) Inst phased-security [1] (3 unstable-updates [all]) +Inst phased-security-same [1] (3 unstable-security, unstable-updates [all]) Conf phased-dep (3 unstable-updates [all]) Conf depends-phased-dep (3 unstable-updates [all]) Conf phased-new (3 unstable-updates [all]) Conf depends-phased-new (3 unstable-updates [all]) -Conf phased-security (3 unstable-updates [all])" aptget $upgrade -s -q depends-phased-dep +Conf phased-security (3 unstable-updates [all]) +Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget $upgrade -s -q depends-phased-dep done testsuccessequal "Reading package lists... @@ -191,14 +211,16 @@ Calculating upgrade... The following packages have been kept back: depends-phased-new phased phased-depends-ready-dep ready-dep The following packages will be upgraded: - depends-phased-dep phased-dep phased-security -3 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. + depends-phased-dep phased-dep phased-security phased-security-same +4 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. Inst phased-dep [1] (3 unstable-updates [all]) Inst depends-phased-dep [1] (3 unstable-updates [all]) Inst phased-security [1] (3 unstable-updates [all]) +Inst phased-security-same [1] (3 unstable-security, unstable-updates [all]) Conf phased-dep (3 unstable-updates [all]) Conf depends-phased-dep (3 unstable-updates [all]) -Conf phased-security (3 unstable-updates [all])" aptget upgrade -s -q depends-phased-dep +Conf phased-security (3 unstable-updates [all]) +Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget upgrade -s -q depends-phased-dep # install does not respect phasing testsuccessequal "Reading package lists... @@ -206,17 +228,18 @@ Building dependency tree... The following additional packages will be installed: phased-dep The following packages will be upgraded: - depends-phased-dep phased phased-dep phased-security -4 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. + depends-phased-dep phased phased-dep phased-security phased-security-same +5 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. Inst phased-dep [1] (3 unstable-updates [all]) Inst depends-phased-dep [1] (3 unstable-updates [all]) Inst phased [1] (3 unstable-updates [all]) Inst phased-security [1] (3 unstable-updates [all]) +Inst phased-security-same [1] (3 unstable-security, unstable-updates [all]) Conf phased-dep (3 unstable-updates [all]) Conf depends-phased-dep (3 unstable-updates [all]) Conf phased (3 unstable-updates [all]) -Conf phased-security (3 unstable-updates [all])" aptget install -s -q phased depends-phased-dep phased-security - +Conf phased-security (3 unstable-updates [all]) +Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget install -s -q phased depends-phased-dep phased-security phased-security-same msgmsg "Testing with policy based implementation" echo 'APT::Get::Phase-Policy "1";' > rootdir/etc/apt/apt.conf.d/phase-by-policy @@ -246,8 +269,8 @@ The following NEW packages will be installed: phased-new The following packages will be upgraded: depends-phased-dep depends-phased-new phased phased-dep - phased-depends-ready-dep phased-security ready-dep -7 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. + phased-depends-ready-dep phased-security phased-security-same ready-dep +8 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Inst phased-dep [1] (3 unstable-updates [all]) Inst depends-phased-dep [1] (3 unstable-updates [all]) Inst phased-new (3 unstable-updates [all]) @@ -256,6 +279,7 @@ Inst phased [1] (3 unstable-updates [all]) Inst phased-depends-ready-dep [1] (3 unstable-updates [all]) [] Inst ready-dep [1] (3 unstable-updates [all]) Inst phased-security [1] (3 unstable-updates [all]) +Inst phased-security-same [1] (3 unstable-security, unstable-updates [all]) Conf phased-dep (3 unstable-updates [all]) Conf depends-phased-dep (3 unstable-updates [all]) Conf phased-new (3 unstable-updates [all]) @@ -263,7 +287,8 @@ Conf depends-phased-new (3 unstable-updates [all]) Conf phased (3 unstable-updates [all]) Conf phased-depends-ready-dep (3 unstable-updates [all]) Conf ready-dep (3 unstable-updates [all]) -Conf phased-security (3 unstable-updates [all])" aptget dist-upgrade -s -q -o $always=1 +Conf phased-security (3 unstable-updates [all]) +Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget dist-upgrade -s -q -o $always=1 done # In the policy implementation, we can update security @@ -293,8 +318,8 @@ The following NEW packages will be installed: phased-new The following packages will be upgraded: depends-phased-dep depends-phased-new phased phased-dep - phased-depends-ready-dep phased-security ready-dep -7 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. + phased-depends-ready-dep phased-security phased-security-same ready-dep +8 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Inst phased-dep [1] (3 unstable-updates [all]) Inst depends-phased-dep [1] (3 unstable-updates [all]) Inst phased-new (3 unstable-updates [all]) @@ -303,6 +328,7 @@ Inst phased [1] (3 unstable-updates [all]) Inst phased-depends-ready-dep [1] (3 unstable-updates [all]) [] Inst ready-dep [1] (3 unstable-updates [all]) Inst phased-security [1] (3 unstable-updates [all]) +Inst phased-security-same [1] (3 unstable-security, unstable-updates [all]) Conf phased-dep (3 unstable-updates [all]) Conf depends-phased-dep (3 unstable-updates [all]) Conf phased-new (3 unstable-updates [all]) @@ -310,7 +336,8 @@ Conf depends-phased-new (3 unstable-updates [all]) Conf phased (3 unstable-updates [all]) Conf phased-depends-ready-dep (3 unstable-updates [all]) Conf ready-dep (3 unstable-updates [all]) -Conf phased-security (3 unstable-updates [all])" aptget dist-upgrade -s -q -o with-source-date-epoch=1 +Conf phased-security (3 unstable-updates [all]) +Conf phased-security-same (3 unstable-security, unstable-updates [all])" aptget dist-upgrade -s -q -o with-source-date-epoch=1 testsuccessequal "Reading package lists... |