summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/Packages-policy-pinning12
-rw-r--r--test/integration/framework3
-rwxr-xr-xtest/integration/run-tests2
-rwxr-xr-xtest/integration/test-autoremove2
-rwxr-xr-xtest/integration/test-bug-590438-broken-provides-thanks-to-remove-order2
-rwxr-xr-xtest/integration/test-bug-591882-conkeror10
-rwxr-xr-xtest/integration/test-bug-595691-empty-and-broken-archive-files91
-rwxr-xr-xtest/integration/test-bug-598669-install-postfix-gets-exim-heavy2
-rwxr-xr-xtest/integration/test-compressed-indexes2
-rwxr-xr-xtest/integration/test-disappearing-packages2
-rwxr-xr-xtest/integration/test-pdiff-usage2
-rwxr-xr-xtest/integration/test-policy-pinning228
-rwxr-xr-xtest/integration/test-ubuntu-bug-6149936
13 files changed, 348 insertions, 16 deletions
diff --git a/test/integration/Packages-policy-pinning b/test/integration/Packages-policy-pinning
new file mode 100644
index 000000000..a9334e9dd
--- /dev/null
+++ b/test/integration/Packages-policy-pinning
@@ -0,0 +1,12 @@
+Package: oldstuff
+Version: 1.0
+Architecture: i386
+Maintainer: Joe Sixpack <joe@example.org>
+Installed-Size: 100
+Filename: pool/oldstuff_1.0_i386.deb
+Size: 100000
+MD5sum: 311aeeadf78324aaff54c9b4e1f76671
+SHA1: 3c695e028f74d5c544deeddaaa1242desa81088c
+SHA256: b46fd1546151c545fe4bfa56a5cc0e7deaef23e2da3e4f129727fd660f28f050
+Description: some old but cool stuff
+ This package will disappear in the next mirror update
diff --git a/test/integration/framework b/test/integration/framework
index 2d9ed3503..2422f0886 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -113,6 +113,7 @@ setupenvironment() {
cp $(find $TESTDIR -name '*.pub' -o -name '*.sec') keys/
ln -s ${TMPWORKINGDIRECTORY}/keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf
+ echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf
echo "Debug::NoLocking \"true\";" >> aptconfig.conf
echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf
echo "Dir::Bin::dpkg \"fakeroot\";" >> aptconfig.conf
@@ -213,7 +214,7 @@ buildpackage() {
fi
local BUILT="$(dpkg-buildpackage -uc -us -a$ARCH 2> /dev/null)"
local PKGS="$( echo "$BUILT" | grep '^dpkg-deb: building package' | cut -d'/' -f 2 | sed -e "s#'\.##")"
- local SRCS="$( echo "$BUILT" | grep '^dpkg-source: info: building' | grep -o '[a-z0-9._-]*$')"
+ local SRCS="$( echo "$BUILT" | grep '^dpkg-source: info: building' | grep -o '[a-z0-9._+~-]*$')"
cd - > /dev/null
for PKG in $PKGS; do
echo "pool/${PKG}" >> ${TMPWORKINGDIRECTORY}/incoming/${RELEASE}.${SECTION}.pkglist
diff --git a/test/integration/run-tests b/test/integration/run-tests
index cb74f21e7..c7ea0a61a 100755
--- a/test/integration/run-tests
+++ b/test/integration/run-tests
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local DIR=$(readlink -f $(dirname $0))
+DIR=$(readlink -f $(dirname $0))
for testcase in $(run-parts --list $DIR | grep '/test-'); do
echo "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m"
${testcase}
diff --git a/test/integration/test-autoremove b/test/integration/test-autoremove
index 7127b3d82..1ca325b29 100755
--- a/test/integration/test-autoremove
+++ b/test/integration/test-autoremove
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture 'i386'
diff --git a/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order b/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order
index 9fd7741f4..3be0bec48 100755
--- a/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order
+++ b/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
diff --git a/test/integration/test-bug-591882-conkeror b/test/integration/test-bug-591882-conkeror
index b1dbb3a0a..e1c0b42d1 100755
--- a/test/integration/test-bug-591882-conkeror
+++ b/test/integration/test-bug-591882-conkeror
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
@@ -34,8 +34,8 @@ The following packages will be upgraded:
perl-base perl-modules readline-common sed ttf-dejavu-core ucf whiptail
x11-common zlib1g
87 upgraded, 26 newly installed, 5 to remove and 0 not upgraded.
-Need to get 0B/54.4MB of archives.
-After this operation, 12.4MB of additional disk space will be used.
+Need to get 0 B/54.4 MB of archives.
+After this operation, 12.4 MB of additional disk space will be used.
E: Trivial Only specified but this is not a trivial operation."
UPGRADESUCCESS="Reading package lists...
@@ -66,8 +66,8 @@ The following packages will be upgraded:
perl-base perl-modules readline-common sed ttf-dejavu-core ucf whiptail
x11-common zlib1g
88 upgraded, 30 newly installed, 4 to remove and 0 not upgraded.
-Need to get 0B/62.9MB of archives.
-After this operation, 36.0MB of additional disk space will be used.
+Need to get 0 B/62.9 MB of archives.
+After this operation, 36.0 MB of additional disk space will be used.
E: Trivial Only specified but this is not a trivial operation."
# Test that the old behavior can be restored with the option
diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files
new file mode 100755
index 000000000..2f127221a
--- /dev/null
+++ b/test/integration/test-bug-595691-empty-and-broken-archive-files
@@ -0,0 +1,91 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+buildaptarchive
+setupflataptarchive
+
+testaptgetupdate() {
+ aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true
+ sed -i -e '/^Fetched / d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff
+ GIVEN="$1"
+ shift
+ msgtest "Test for correctness of" "apt-get update with $*"
+ if [ -z "$GIVEN" ]; then
+ echo -n "" | checkdiff - testaptgetupdate.diff && msgpass || msgfail
+ else
+ echo "$GIVEN" | checkdiff - testaptgetupdate.diff && msgpass || msgfail
+ fi
+ rm testaptgetupdate.diff
+}
+
+touch aptarchive/en.bz2
+
+testaptgetupdate "Ign file: Release.gpg
+Ign file:$(readlink -f aptarchive)/ Translation-en
+Get:1 file: Release []
+Reading package lists..." "empty file en.bz2 over file"
+
+rm aptarchive/en.bz2
+echo -n "" | bzip2 > aptarchive/en.bz2
+
+testaptgetupdate "Ign file: Release.gpg
+Get:1 file: Release []
+Reading package lists..." "empty archive en.bz2 over file"
+
+rm aptarchive/en.bz2
+
+# do the same again with http instead of file
+changetowebserver
+
+touch aptarchive/en.bz2
+
+testaptgetupdate "Ign http://localhost Release.gpg
+Get:1 http://localhost/ Translation-en
+Get:2 http://localhost Release []
+Ign http://localhost/ Translation-en
+Get:3 http://localhost Packages []
+Reading package lists..." "empty file en.bz2 over http"
+
+rm aptarchive/en.bz2
+echo -n "" | bzip2 > aptarchive/en.bz2
+
+testaptgetupdate "Ign http://localhost Release.gpg
+Get:1 http://localhost/ Translation-en []
+Get:2 http://localhost Release []
+Ign http://localhost Packages/DiffIndex
+Get:3 http://localhost Packages []
+Reading package lists..." "empty archive en.bz2 over http"
+
+rm aptarchive/en.bz2
+
+rm aptarchive/Packages
+touch aptarchive/Packages
+buildaptarchivefromfiles
+
+testaptgetupdate "Ign http://localhost Release.gpg
+Ign http://localhost/ Translation-en
+Get:1 http://localhost Release []
+Ign http://localhost Packages/DiffIndex
+Get:2 http://localhost Packages []
+Reading package lists..." "empty archive Packages over http"
+
+find aptarchive/ -name 'Packages*' -type f -delete
+touch aptarchive/Packages.bz2
+aptftparchive release aptarchive/ > aptarchive/Release
+
+#FIXME: we should response with a good error message instead
+testaptgetupdate "Ign http://localhost Release.gpg
+Ign http://localhost/ Translation-en
+Get:1 http://localhost Release []
+Ign http://localhost Packages/DiffIndex
+Get:2 http://localhost Packages
+Err http://localhost Packages
+ Undetermined Error
+W: Failed to fetch http://localhost:8080/Packages.bz2 Undetermined Error
+
+E: Some index files failed to download, they have been ignored, or old ones used instead." "empty file Packages over http"
diff --git a/test/integration/test-bug-598669-install-postfix-gets-exim-heavy b/test/integration/test-bug-598669-install-postfix-gets-exim-heavy
index 3fee63bbb..c3a77f346 100755
--- a/test/integration/test-bug-598669-install-postfix-gets-exim-heavy
+++ b/test/integration/test-bug-598669-install-postfix-gets-exim-heavy
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes
index 0b73f4c35..97a1453f7 100755
--- a/test/integration/test-compressed-indexes
+++ b/test/integration/test-compressed-indexes
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages
index ebf2bb14f..12d215d7a 100755
--- a/test/integration/test-disappearing-packages
+++ b/test/integration/test-disappearing-packages
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "i386"
diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage
index 85cbe9082..a70b6122c 100755
--- a/test/integration/test-pdiff-usage
+++ b/test/integration/test-pdiff-usage
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning
new file mode 100755
index 000000000..fa356ed54
--- /dev/null
+++ b/test/integration/test-policy-pinning
@@ -0,0 +1,228 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+buildaptarchive
+setupflataptarchive
+
+STATUS=$(readlink -f rootdir/var/lib/dpkg/status)
+APTARCHIVE=$(readlink -f aptarchive)
+
+testequalpolicy() {
+ local SP="$1"
+ local AP="$2"
+ shift 2
+ testequal "Package files:
+ $(echo "$SP" | awk '{ printf("%3s\n",$0) }') ${STATUS}
+ release a=now
+ $(echo "$AP" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ Packages
+ release c=
+Pinned packages:" aptcache policy $*
+}
+
+aptget update -qq
+testequalpolicy 100 500
+testequalpolicy 990 500 -t now
+
+sed -i aptarchive/Release -e 1i"NotAutomatic: yes"
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicy 100 1 -o Test=NotAutomatic
+testequalpolicy 990 1 -o Test=NotAutomatic -t now
+
+sed -i aptarchive/Release -e 1i"ButAutomaticUpgrades: yes"
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicy 100 100 -o Test=ButAutomaticUpgrades
+testequalpolicy 990 100 -o Test=ButAutomaticUpgrades -t now
+
+sed -i aptarchive/Release -e 's#NotAutomatic: yes#NotAutomatic: no#' -e '/ButAutomaticUpgrades: / d'
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicy 100 500 -o Test=Automatic
+testequalpolicy 990 500 -o Test=Automatic -t now
+
+buildsimplenativepackage "coolstuff" "all" "1.0" "stable"
+buildsimplenativepackage "coolstuff" "all" "2.0~bpo1" "backports"
+
+setupaptarchive
+
+testequalpolicycoolstuff() {
+ local INSTALLED="${1:-(none)}"
+ local CANDIDATE="${2:-(none)}"
+ local AB="$3"
+ local AS="$4"
+ local PB="$5"
+ local PINVERSION="$6"
+ if [ -n "$PINVERSION" ]; then
+ PINVERSION="Package pin: $PINVERSION
+ "
+ fi
+ local IS=""
+ local IB=""
+ local SB=""
+ local SS=""
+ [ "$1" = "2.0~bpo1" ] && IB="***" && SB="
+ 100 $STATUS" || IB=" "
+ [ "$1" = "1.0" ] && IS="***" && SS="
+ 100 $STATUS" || IS=" "
+ local BPO1ARCHIVE=""
+ local BPO2ARCHIVE=""
+ if [ ! "$7" = "2.0~bpo2" ]; then
+ BPO1ARCHIVE=" $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ backports/main i386 Packages"
+ else
+ BPO2ARCHIVE="
+ 2.0~bpo2 $PB
+ $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ backports/main i386 Packages"
+ SB="$(echo "$SB" | tail -n 1)"
+ shift
+ fi
+ shift 6
+ testequal "coolstuff:
+ Installed: $INSTALLED
+ Candidate: $CANDIDATE
+ ${PINVERSION}Version table:${BPO2ARCHIVE}
+ $IB 2.0~bpo1 $PB
+${BPO1ARCHIVE}$SB
+ $IS 1.0 $PB
+ $(echo "$AS" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ stable/main i386 Packages$SS" \
+ aptcache policy coolstuff -o Policy=${INSTALLED}-${CANDIDATE}-${AB}-${AS}-${PB} $*
+}
+
+testequalpolicycoolstuff "" "2.0~bpo1" 500 500 0 ""
+testequalpolicycoolstuff "" "1.0" 500 990 0 "" -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -t backports
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=GlobalPin
+testequalpolicycoolstuff "" "1.0" 200 990 0 "" -o Test=GlobalPin -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=GlobalPin -t backports
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=GlobalPin
+testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=GlobalPin -t stable
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+#FIXME: policy can't differentiate between two sources where one has a package specific pin in place
+# testequalpolicycoolstuff "" "1.0" 500 500 200 "2.0~bpo1" -o Test=PackagePin
+# testequalpolicycoolstuff "" "1.0" 990 500 200 "2.0~bpo1" -o Test=PackagePin -t backports
+testequalpolicycoolstuff "" "1.0" 500 990 200 "2.0~bpo1" -o Test=PackagePin -t stable
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 500 500 600 "2.0~bpo1" -o Test=PackagePin
+testequalpolicycoolstuff "" "1.0" 500 990 600 "2.0~bpo1" -o Test=PackagePin -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test=PackagePin -t backports
+
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: -1" > rootdir/etc/apt/preferences
+# testequalpolicycoolstuff "" "1.0" 500 500 -1 "2.0~bpo1" -o Test=PackagePin
+# testequalpolicycoolstuff "" "1.0" 990 500 -1 "2.0~bpo1" -o Test=PackagePin -t backports
+# testequalpolicycoolstuff "" "1.0" 500 990 -1 "2.0~bpo1" -o Test=PackagePin -t stable
+
+rm rootdir/etc/apt/preferences
+sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes"
+signreleasefiles
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicycoolstuff "" "1.0" 1 500 0 "" -o Test=NotAutomatic
+testequalpolicycoolstuff "" "1.0" 1 990 0 "" -o Test=NotAutomatic -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=NotAutomatic -t backports
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=NotAutomatic
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=NotAutomatic
+testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=NotAutomatic -t stable
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "1.0" 1 500 200 "2.0~bpo1" -o Test=NotAutomatic
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 1 500 600 "2.0~bpo1" -o Test=NotAutomatic
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test=NotAutomatic -t backports
+testequalpolicycoolstuff "" "1.0" 1 990 600 "2.0~bpo1" -o Test=NotAutomatic -t stable
+
+rm rootdir/etc/apt/preferences
+sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes"
+signreleasefiles
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicycoolstuff "" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=ButAutomaticUpgrades
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=ButAutomaticUpgrades -t stable
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 200" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "1.0" 100 500 200 "2.0~bpo1" -o Test=ButAutomaticUpgrades
+echo "Package: coolstuff
+Pin: release n=backports
+Pin-Priority: 600" > rootdir/etc/apt/preferences
+testequalpolicycoolstuff "" "2.0~bpo1" 100 500 600 "2.0~bpo1" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test=ButAutomaticUpgrades -t backports
+testequalpolicycoolstuff "" "1.0" 100 990 600 "2.0~bpo1" -o Test=ButAutomaticUpgrades -t stable
+
+rm rootdir/etc/apt/preferences
+aptget install coolstuff -qq > /dev/null 2> /dev/null
+testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades
+aptget dist-upgrade -qq > /dev/null 2> /dev/null
+testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "1.0" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "1.0" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports
+
+aptget install coolstuff -t backports -qq > /dev/null 2> /dev/null
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades
+aptget dist-upgrade -qq > /dev/null 2> /dev/null
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports
+
+rm incoming/backports.main.pkglist incoming/backports.main.srclist
+buildsimplenativepackage "coolstuff" "all" "2.0~bpo2" "backports"
+setupaptarchive
+
+sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes"
+signreleasefiles
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 500 0 "" "2.0~bpo2" -o Test=NotAutomatic
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 990 0 "" "2.0~bpo2" -o Test=NotAutomatic -t stable
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=NotAutomatic -t backports
+
+sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes"
+signreleasefiles
+rm rootdir/var/cache/apt/srcpkgcache.bin rootdir/var/cache/apt/pkgcache.bin
+aptget update -qq
+
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 500 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 990 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t backports
diff --git a/test/integration/test-ubuntu-bug-614993 b/test/integration/test-ubuntu-bug-614993
index f54909bc2..49955f231 100755
--- a/test/integration/test-ubuntu-bug-614993
+++ b/test/integration/test-ubuntu-bug-614993
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-local TESTDIR=$(readlink -f $(dirname $0))
+TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture "amd64"
@@ -52,8 +52,8 @@ The following packages will be upgraded:
xserver-xorg-video-tseng xserver-xorg-video-vesa xserver-xorg-video-vmware
xserver-xorg-video-voodoo
41 upgraded, 5 newly installed, 1 to remove and 3 not upgraded.
-Need to get 0B/5505kB of archives.
-After this operation, 2294kB disk space will be freed.
+Need to get 0 B/5505 kB of archives.
+After this operation, 2294 kB disk space will be freed.
E: Trivial Only specified but this is not a trivial operation."
testequal "$UPGRADE" aptget install xserver-xorg --trivial-only