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-phased-updates | |
parent | Initial commit. (diff) | |
download | apt-851b6a097165af4d51c0db01b5e05256e5006896.tar.xz apt-851b6a097165af4d51c0db01b5e05256e5006896.zip |
Adding upstream version 2.6.1.upstream/2.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/test-phased-updates')
-rwxr-xr-x | test/integration/test-phased-updates | 300 |
1 files changed, 300 insertions, 0 deletions
diff --git a/test/integration/test-phased-updates b/test/integration/test-phased-updates new file mode 100755 index 0000000..7377f91 --- /dev/null +++ b/test/integration/test-phased-updates @@ -0,0 +1,300 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +echo 'Debug::Phasing "1";' > rootdir/etc/apt/apt.conf.d/debug-phasing +echo 'APT::Get::Phase-Policy "1";' > rootdir/etc/apt/apt.conf.d/debug-phasing +configarchitecture 'i386' 'armel' + + +insertinstalledpackage 'phased1' 'all' '1' +insertinstalledpackage 'phased2' 'all' '1' + +insertpackage 'unstable' 'phased1' 'all' '10' 'Phased-Update-Percentage: 10' +insertpackage 'unstable' 'phased2' 'all' '10' 'Phased-Update-Percentage: 10' +insertpackage 'unstable' 'phased3' 'all' '10' 'Phased-Update-Percentage: 10' + +insertpackage 'unstable' 'phased1' 'all' '100' 'Phased-Update-Percentage: 100' +insertpackage 'unstable' 'phased2' 'all' '100' 'Phased-Update-Percentage: 100' +insertpackage 'unstable' 'phased3' 'all' '100' 'Phased-Update-Percentage: 100' + +insertpackage 'unstable' 'phased1' 'all' '50' 'Phased-Update-Percentage: 50' +insertpackage 'unstable' 'phased2' 'all' '50' 'Phased-Update-Percentage: 50' +insertpackage 'unstable' 'phased3' 'all' '50' 'Phased-Update-Percentage: 50' + +insertinstalledpackage 'phased-and-pinned' 'all' '1' +insertpackage 'unstable' 'phased-and-pinned' 'all' '10' 'Phased-Update-Percentage: 0' +insertpackage 'unstable' 'phased-and-pinned-new' 'all' '10' 'Phased-Update-Percentage: 0' + +cat > rootdir/etc/apt/preferences.d/phased-and-pinned << EOF +Package: phased-and-pinned phased-and-pinned-new +Pin: release * +Pin-Priority: -12 +EOF + +setupaptarchive + +msgmsg "Basic test" +testsuccessequal "phased1: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 1 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status +phased2: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 1 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 1 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status +phased3: + Installed: (none) + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 1 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages" aptcache policy phased1 phased2 phased3 + +testsuccessequal "phased-and-pinned: + Installed: 1 + Candidate: (none) + Version table: + 10 -12 (phased 0%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 -12 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" aptcache policy phased-and-pinned + +testsuccessequal "phased-and-pinned-new: + Installed: (none) + Candidate: (none) + Version table: + 10 -12 (phased 0%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages" aptcache policy phased-and-pinned-new + + +msgmsg "Test for always-include-phased-updates" +for always in Update-Manager::Always-Include-Phased-Updates APT::Get::Always-Include-Phased-Updates; do +testsuccessequal "phased1: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 500 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status +phased2: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 500 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status +phased3: + Installed: (none) + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 500 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages" aptcache policy phased1 phased2 phased3 -o $always=true +done + +msgmsg "Test for never-include-phased-updates" +for never in Update-Manager::Never-Include-Phased-Updates APT::Get::Never-Include-Phased-Updates; do +testsuccessequal "phased1: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 1 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 1 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status +phased2: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 1 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 1 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status +phased3: + Installed: (none) + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 1 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 1 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages" aptcache policy phased1 phased2 phased3 -o $never=true +done + +msgmsg "Test that being in a chroot equals always-include-phased-updates" +testsuccessequal "phased1: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 500 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status +phased2: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 500 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" aptcache policy phased1 phased2 -o Dir::Bin::ischroot=/bin/true + +msgmsg "Test that empty machine-id equals always-include-phased-updates" +testsuccessequal "phased1: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 500 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status +phased2: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 500 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" aptcache policy phased1 phased2 -o Dir::Etc::machine-id=/dev/null -o APT::Machine-Id="" + +msgmsg "Test that never-include-phased-updates trumps empty machine-id" +testsuccessequal "phased1: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 1 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 1 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status +phased2: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 1 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 1 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" aptcache policy phased1 phased2 -o Dir::Etc::machine-id=/dev/null -o APT::Machine-Id="" -o APT::Get::Never-Include-Phased-Updates=1 + + +msgmsg "Test that SOURCE_DATE_EPOCH set equals always-include-phased-updates" +export SOURCE_DATE_EPOCH=0 +testsuccessequal "phased1: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 500 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status +phased2: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 500 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" aptcache policy phased1 phased2 +unset SOURCE_DATE_EPOCH + +msgmsg "Test that different machine-id produces different outcome" +testsuccessequal "phased1: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 1 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status +phased2: + Installed: 1 + Candidate: 100 + Version table: + 100 500 + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 50 500 (phased 50%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + 10 1 (phased 10%) + 500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages + *** 1 100 + 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" aptcache policy phased1 phased2 -o apt::machine-id="00000000000000000000000000000000" |