diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:00:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:00:48 +0000 |
commit | 851b6a097165af4d51c0db01b5e05256e5006896 (patch) | |
tree | 5f7c388ec894a7806c49a99f3bdb605d0b299a7c /test/integration/test-apt-get-upgrade | |
parent | Initial commit. (diff) | |
download | apt-cb4dc5b0476fd7de536c4f9d803d7409c871dd5a.tar.xz apt-cb4dc5b0476fd7de536c4f9d803d7409c871dd5a.zip |
Adding upstream version 2.6.1.upstream/2.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | test/integration/test-apt-get-upgrade | 144 | ||||
-rwxr-xr-x | test/integration/test-apt-get-upgrade-by-source | 53 |
2 files changed, 197 insertions, 0 deletions
diff --git a/test/integration/test-apt-get-upgrade b/test/integration/test-apt-get-upgrade new file mode 100755 index 0000000..50a90ce --- /dev/null +++ b/test/integration/test-apt-get-upgrade @@ -0,0 +1,144 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture "i386" + +# simple case +insertpackage 'stable,installed' 'upgrade-simple' 'all' '1.0' +insertpackage 'unstable' 'upgrade-simple' 'all' '2.0' + +# upgrade with a new dependency +insertpackage 'stable,installed' 'upgrade-with-new-dep' 'all' '1.0' +insertpackage 'unstable' 'upgrade-with-new-dep' 'all' '2.0' 'Depends: new-dep' +insertpackage 'stable' 'new-dep' 'all' '1.0' + +# upgrade with conflict and a new pkg with higher priority than conflict +insertpackage 'stable,installed' 'upgrade-with-conflict' 'all' '1.0' +insertpackage 'unstable' 'upgrade-with-conflict' 'all' '2.0' 'Conflicts: conflicting-dep' 'standard' +insertpackage 'stable,installed' 'conflicting-dep' 'all' '1.0' + +# upgrade with conflict and a new pkg with higher priority than conflict +insertpackage 'stable,installed' 'init' 'all' '1' +insertpackage 'unstable' 'init' 'all' '2' 'Pre-Depends: systemd | sysvinit' +insertpackage 'unstable' 'systemd' 'all' '2' 'Conflicts: conflicting-dep' +insertpackage 'unstable' 'sysvinit' 'all' '2' + +setupaptarchive + +# Test if normal upgrade works as expected +UPGRADE='Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + init upgrade-with-conflict upgrade-with-new-dep +The following packages will be upgraded: + upgrade-simple +1 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Conf upgrade-simple (2.0 unstable [all])' +testsuccessequal "$UPGRADE" aptget upgrade -s +testsuccessequal "$UPGRADE" apt upgrade -s --without-new-pkgs + +# Test if apt-get upgrade --with-new-pkgs works +UPGRADENEW='Reading package lists... +Building dependency tree... +Calculating upgrade... +The following NEW packages will be installed: + new-dep +The following packages have been kept back: + init upgrade-with-conflict +The following packages will be upgraded: + upgrade-simple upgrade-with-new-dep +2 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. +Inst new-dep (1.0 stable [all]) +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-simple (2.0 unstable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])' +testsuccessequal "$UPGRADENEW" aptget upgrade -s --with-new-pkgs +testsuccessequal "$UPGRADENEW" apt upgrade -s + +# Test if apt-get dist-upgrade works +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages will be REMOVED: + conflicting-dep +The following NEW packages will be installed: + new-dep systemd +The following packages will be upgraded: + init upgrade-simple upgrade-with-conflict upgrade-with-new-dep +4 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv conflicting-dep [1.0] +Inst systemd (2 unstable [all]) +Conf systemd (2 unstable [all]) +Inst init [1] (2 unstable [all]) +Inst upgrade-with-conflict [1.0] (2.0 unstable [all]) +Inst new-dep (1.0 stable [all]) +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf init (2 unstable [all]) +Conf upgrade-with-conflict (2.0 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-simple (2.0 unstable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade + +msgmsg 'make systemd a non-choice in the or-group and try again' +echo 'Package: systemd +Pin: release unstable +Pin-Priority: -1' > rootdir/etc/apt/preferences.d/nosystemd.pref + +testsuccessequal "$UPGRADE" aptget upgrade -s +testsuccessequal "$UPGRADE" apt upgrade -s --without-new-pkgs + +UPGRADENEW='Reading package lists... +Building dependency tree... +Calculating upgrade... +The following NEW packages will be installed: + new-dep sysvinit +The following packages have been kept back: + upgrade-with-conflict +The following packages will be upgraded: + init upgrade-simple upgrade-with-new-dep +3 upgraded, 2 newly installed, 0 to remove and 1 not upgraded. +Inst sysvinit (2 unstable [all]) +Conf sysvinit (2 unstable [all]) +Inst init [1] (2 unstable [all]) +Inst new-dep (1.0 stable [all]) +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf init (2 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-simple (2.0 unstable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])' +testsuccessequal "$UPGRADENEW" aptget upgrade -s --with-new-pkgs +testsuccessequal "$UPGRADENEW" apt upgrade -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages will be REMOVED: + conflicting-dep +The following NEW packages will be installed: + new-dep sysvinit +The following packages will be upgraded: + init upgrade-simple upgrade-with-conflict upgrade-with-new-dep +4 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv conflicting-dep [1.0] +Inst sysvinit (2 unstable [all]) +Conf sysvinit (2 unstable [all]) +Inst init [1] (2 unstable [all]) +Inst upgrade-with-conflict [1.0] (2.0 unstable [all]) +Inst new-dep (1.0 stable [all]) +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf init (2 unstable [all]) +Conf upgrade-with-conflict (2.0 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-simple (2.0 unstable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade diff --git a/test/integration/test-apt-get-upgrade-by-source b/test/integration/test-apt-get-upgrade-by-source new file mode 100755 index 0000000..0f87005 --- /dev/null +++ b/test/integration/test-apt-get-upgrade-by-source @@ -0,0 +1,53 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment + +insertinstalledpackage 'pkg' 'all' '1' 'Source: pkg' +insertinstalledpackage 'pkg-foo' 'all' '1' 'Source: pkg' +insertinstalledpackage 'pkg-bar' 'all' '1' 'Source: pkg' +insertpackage 'unstable' 'pkg' 'all' '2' 'Source: pkg' +insertpackage 'unstable' 'pkg-foo' 'all' '2' 'Source: pkg' +insertpackage 'unstable' 'pkg-bar' 'all' '2' 'Source: pkg' + +configarchitecture 'arm64' +setupaptarchive + +noprogress() { + "$@" | sed /^Progress/d +} + +testsuccessequal "Reading package lists... +Building dependency tree... + MarkInstall pkg:arm64 < 1 -> 2 @ii puU > FU=1 + Upgrading pkg-bar:arm64 < 1 | 2 @ii uH > due to pkg:arm64 + Upgrading pkg-foo:arm64 < 1 | 2 @ii uH > due to pkg:arm64 +Starting pkgProblemResolver with broken count: 0 +Starting 2 pkgProblemResolver with broken count: 0 +Done +The following additional packages will be installed: + pkg-bar pkg-foo +The following packages will be upgraded: + pkg pkg-bar pkg-foo +3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst pkg [1] (2 unstable [all]) +Inst pkg-bar [1] (2 unstable [all]) +Inst pkg-foo [1] (2 unstable [all]) +Conf pkg (2 unstable [all]) +Conf pkg-bar (2 unstable [all]) +Conf pkg-foo (2 unstable [all])" aptget install pkg -o debug::pkgdepcache::marker=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::AutoInstall=1 -s + +testsuccessequal "Reading package lists... +Building dependency tree... + MarkInstall pkg:arm64 < 1 -> 2 @ii puU > FU=1 +Starting pkgProblemResolver with broken count: 0 +Starting 2 pkgProblemResolver with broken count: 0 +Done +The following packages will be upgraded: + pkg +1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. +Inst pkg [1] (2 unstable [all]) +Conf pkg (2 unstable [all])" aptget install pkg -o debug::pkgdepcache::marker=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::AutoInstall=1 -o APT::Get::Upgrade-By-Source-Package=0 -s |