summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/integration/framework36
-rwxr-xr-xtest/integration/test-bug-254770-segfault-if-cache-not-buildable1
-rwxr-xr-xtest/integration/test-bug-590438-broken-provides-thanks-to-remove-order2
-rwxr-xr-xtest/integration/test-bug-595691-empty-and-broken-archive-files2
-rwxr-xr-xtest/integration/test-bug-601016-description-translation2
-rwxr-xr-xtest/integration/test-bug-618288-multiarch-same-lockstep4
-rwxr-xr-xtest/integration/test-bug-632221-cross-dependency-satisfaction16
-rwxr-xr-xtest/integration/test-bug-633350-do-not-kill-last-char-in-Release2
-rwxr-xr-xtest/integration/test-compressed-indexes17
-rwxr-xr-xtest/integration/test-disappearing-packages8
-rwxr-xr-xtest/integration/test-hashsum-verification2
-rwxr-xr-xtest/integration/test-policy-pinning7
-rwxr-xr-xtest/integration/test-releasefile-valid-until95
-rwxr-xr-xtest/integration/test-releasefile-verification3
-rwxr-xr-xtest/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first31
15 files changed, 175 insertions, 53 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 45c1f156a..a2e71760e 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -513,10 +513,12 @@ buildaptarchivefromfiles() {
# can be overridden by testcases for their pleasure
getcodenamefromsuite() { echo -n "$1"; }
getreleaseversionfromsuite() { true; }
+getlabelfromsuite() { true; }
generatereleasefiles() {
+ # $1 is the Date header and $2 is the ValidUntil header to be set
+ # both should be given in notation date/touch can understand
msgninfo "\tGenerate Release files… "
- local DATE="${1:-now}"
if [ -e aptarchive/dists ]; then
for dir in $(find ./aptarchive/dists -mindepth 3 -maxdepth 3 -type d -name 'i18n'); do
aptftparchive -qq release $dir -o APT::FTPArchive::Release::Patterns::='Translation-*' > $dir/Index
@@ -525,27 +527,35 @@ generatereleasefiles() {
local SUITE="$(echo "$dir" | cut -d'/' -f 4)"
local CODENAME="$(getcodenamefromsuite $SUITE)"
local VERSION="$(getreleaseversionfromsuite $SUITE)"
- if [ -z "$VERSION" ]; then
- aptftparchive -qq release $dir \
- -o APT::FTPArchive::Release::Suite="${SUITE}" \
- -o APT::FTPArchive::Release::Codename="${CODENAME}" \
- | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
- else
- aptftparchive -qq release $dir \
- -o APT::FTPArchive::Release::Suite="${SUITE}" \
- -o APT::FTPArchive::Release::Codename="${CODENAME}" \
- -o APT::FTPArchive::Release::Version="${VERSION}" \
- | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
+ local LABEL="$(getlabelfromsuite $SUITE)"
+ if [ -n "$VERSION" ]; then
+ VERSION="-o APT::FTPArchive::Release::Version=${VERSION}"
fi
+ if [ -n "$LABEL" ]; then
+ LABEL="-o APT::FTPArchive::Release::Label=${LABEL}"
+ fi
+ aptftparchive -qq release $dir \
+ -o APT::FTPArchive::Release::Suite="${SUITE}" \
+ -o APT::FTPArchive::Release::Codename="${CODENAME}" \
+ ${LABEL} \
+ ${VERSION} \
+ | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
if [ "$SUITE" = "experimental" -o "$SUITE" = "experimental2" ]; then
sed -i '/^Date: / a\
NotAutomatic: yes' $dir/Release
fi
+ if [ -n "$1" -a "$1" != "now" ]; then
+ sed -i "s/^Date: .*$/Date: $(date -d "$1" '+%a, %d %b %Y %H:%M:%S %Z')/" $dir/Release
+ fi
+ if [ -n "$2" ]; then
+ sed -i "/^Date: / a\
+Valid-Until: $(date -d "$2" '+%a, %d %b %Y %H:%M:%S %Z')" $dir/Release
+ fi
done
else
aptftparchive -qq release ./aptarchive | sed -e '/0 Release$/ d' > aptarchive/Release # remove the self reference
fi
- if [ "$DATE" != "now" ]; then
+ if [ -n "$1" -a "$1" != "now" ]; then
for release in $(find ./aptarchive -name 'Release'); do
touch -d "$1" $release
done
diff --git a/test/integration/test-bug-254770-segfault-if-cache-not-buildable b/test/integration/test-bug-254770-segfault-if-cache-not-buildable
index b9f45b131..8fa337ccc 100755
--- a/test/integration/test-bug-254770-segfault-if-cache-not-buildable
+++ b/test/integration/test-bug-254770-segfault-if-cache-not-buildable
@@ -12,7 +12,6 @@ trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
chmod a-x rootdir/var/lib/dpkg
testsegfault() {
- rm -f rootdir/var/cache/apt/*.bin
msgtest "No segfault in" "$*"
local TEST="$($* 2>&1 | grep -v 'E:')"
if [ -z "$TEST" ]; then
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 0f6493948..645e86d7d 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
@@ -25,7 +25,6 @@ MD5sum: 8489687ce10e656babd467c9ee389349
Description-de: Verschiedene Dateien für das Basis-System von Debian"
predependsgawk() {
- rm rootdir/var/cache/apt/*.bin
cp $TESTDIR/$(echo "$(basename $0)" | sed 's/test-/status-/') rootdir/var/lib/dpkg/status
echo "$pkgbasefile
Pre-Depends: $1
@@ -57,7 +56,6 @@ predependsgawk "awk | aawk"
predependsgawk "awk"
predependsgawk2() {
- rm rootdir/var/cache/apt/*.bin
cp $TESTDIR/$(echo "$(basename $0)" | sed 's/test-/status-/') rootdir/var/lib/dpkg/status
echo "$pkgbasefile
Pre-Depends: $1
diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files
index 11dee0628..5c103da6f 100755
--- a/test/integration/test-bug-595691-empty-and-broken-archive-files
+++ b/test/integration/test-bug-595691-empty-and-broken-archive-files
@@ -11,7 +11,7 @@ touch aptarchive/Packages
setupflataptarchive
testaptgetupdate() {
- rm -rf rootdir/var/lib/apt rootdir/var/cache/apt
+ rm -rf rootdir/var/lib/apt
aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true
sed -i -e '/^Fetched / d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff
GIVEN="$1"
diff --git a/test/integration/test-bug-601016-description-translation b/test/integration/test-bug-601016-description-translation
index 2a323a201..44ab91900 100755
--- a/test/integration/test-bug-601016-description-translation
+++ b/test/integration/test-bug-601016-description-translation
@@ -57,7 +57,7 @@ Description-${LOCALE}: Mächtige Oberfläche für dpkg
testrun() {
echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
export LC_ALL=""
- rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt/
+ rm -rf rootdir/var/lib/apt/lists
setupaptarchive
testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE}
testequal "$NOLONGSTANZA" aptcache show apt -o Acquire::Languages="ww" -o Test=File-${LOCALE}
diff --git a/test/integration/test-bug-618288-multiarch-same-lockstep b/test/integration/test-bug-618288-multiarch-same-lockstep
index 7e384e428..a05f03df4 100755
--- a/test/integration/test-bug-618288-multiarch-same-lockstep
+++ b/test/integration/test-bug-618288-multiarch-same-lockstep
@@ -22,8 +22,8 @@ Building dependency tree...
The following packages will be upgraded:
apt:i386 apt2 libsame libsame:i386
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-Inst libsame [1] (2 unstable [amd64]) [libsame:amd64 on libsame:i386] [libsame:i386 on libsame:amd64] [libsame:i386 apt2:amd64 ]
-Inst libsame:i386 [1] (2 unstable [i386]) [apt2:amd64 apt:i386 ]
+Inst libsame:i386 [1] (2 unstable [i386]) [libsame:amd64 on libsame:i386] [libsame:i386 on libsame:amd64] [libsame:amd64 apt:i386 ]
+Inst libsame [1] (2 unstable [amd64]) [apt2:amd64 apt:i386 ]
Conf libsame:i386 (2 unstable [i386]) [apt2:amd64 apt:i386 ]
Conf libsame (2 unstable [amd64]) [apt2:amd64 apt:i386 ]
Inst apt2 [1] (2 unstable [amd64]) [apt:i386 ]
diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction
index 58de44843..4299f052f 100755
--- a/test/integration/test-bug-632221-cross-dependency-satisfaction
+++ b/test/integration/test-bug-632221-cross-dependency-satisfaction
@@ -47,10 +47,10 @@ Inst amdboot (1.0 unstable [amd64])
Inst cool (1.0 unstable [amd64])
Inst doxygen (1.0 unstable [amd64])
Inst foreigner (1.0 unstable [amd64])
-Inst libc6:armel (1.0 unstable [armel])
Inst libc6 (1.0 unstable [amd64])
-Inst libc6-dev:armel (1.0 unstable [armel])
+Inst libc6:armel (1.0 unstable [armel])
Inst libc6-dev (1.0 unstable [amd64])
+Inst libc6-dev:armel (1.0 unstable [armel])
Conf amdboot (1.0 unstable [amd64])
Conf cool (1.0 unstable [amd64])
Conf doxygen (1.0 unstable [amd64])
@@ -90,10 +90,10 @@ Inst amdboot:amd64 (1.0 unstable [amd64])
Inst cool (1.0 unstable [armel])
Inst doxygen (1.0 unstable [armel])
Inst foreigner (1.0 unstable [armel])
-Inst libc6 (1.0 unstable [armel])
Inst libc6:amd64 (1.0 unstable [amd64])
-Inst libc6-dev (1.0 unstable [armel])
+Inst libc6 (1.0 unstable [armel])
Inst libc6-dev:amd64 (1.0 unstable [amd64])
+Inst libc6-dev (1.0 unstable [armel])
Conf amdboot:amd64 (1.0 unstable [amd64])
Conf cool (1.0 unstable [armel])
Conf doxygen (1.0 unstable [armel])
@@ -129,10 +129,10 @@ The following NEW packages will be installed:
0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
Inst amdboot (1.0 unstable [amd64])
Inst doxygen (1.0 unstable [amd64])
-Inst libc6:armel (1.0 unstable [armel])
Inst libc6 (1.0 unstable [amd64])
-Inst libc6-dev:armel (1.0 unstable [armel])
+Inst libc6:armel (1.0 unstable [armel])
Inst libc6-dev (1.0 unstable [amd64])
+Inst libc6-dev:armel (1.0 unstable [armel])
Conf amdboot (1.0 unstable [amd64])
Conf doxygen (1.0 unstable [amd64])
Conf libc6 (1.0 unstable [amd64])
@@ -169,10 +169,10 @@ The following NEW packages will be installed:
0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
Inst amdboot:amd64 (1.0 unstable [amd64])
Inst doxygen (1.0 unstable [armel])
-Inst libc6 (1.0 unstable [armel])
Inst libc6:amd64 (1.0 unstable [amd64])
-Inst libc6-dev (1.0 unstable [armel])
+Inst libc6 (1.0 unstable [armel])
Inst libc6-dev:amd64 (1.0 unstable [amd64])
+Inst libc6-dev (1.0 unstable [armel])
Conf amdboot:amd64 (1.0 unstable [amd64])
Conf doxygen (1.0 unstable [armel])
Conf libc6:amd64 (1.0 unstable [amd64])
diff --git a/test/integration/test-bug-633350-do-not-kill-last-char-in-Release b/test/integration/test-bug-633350-do-not-kill-last-char-in-Release
index 3d3835507..2aae7cfcc 100755
--- a/test/integration/test-bug-633350-do-not-kill-last-char-in-Release
+++ b/test/integration/test-bug-633350-do-not-kill-last-char-in-Release
@@ -15,7 +15,7 @@ echo 'NotAutomatic: yes' >> aptarchive/dists/unstable/Release
signreleasefiles
find aptarchive/dists -name 'InRelease' -delete
-rm -rf rootdir/var/lib/apt/lists rootdir/var/cache/apt
+rm -rf rootdir/var/lib/apt/lists
OUTPUT="$(aptget update 2>&1)"
msgtest 'Check that parsing happens without warnings' 'with missing newline'
diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes
index 99943574e..a5e885745 100755
--- a/test/integration/test-compressed-indexes
+++ b/test/integration/test-compressed-indexes
@@ -10,10 +10,10 @@ configarchitecture "i386"
buildsimplenativepackage "testpkg" "i386" "1.0"
setupaptarchive
-local GOODSHOW="$(aptcache show testpkg)
+GOODSHOW="$(aptcache show testpkg)
"
-local GOODPOLICY="$(aptcache policy testpkg)"
-local GOODSHOWSRC="$(aptcache showsrc testpkg)
+GOODPOLICY="$(aptcache policy testpkg)"
+GOODSHOWSRC="$(aptcache showsrc testpkg)
"
test $(echo "$GOODSHOW" | grep -e '^Package: testpkg' -e '^Version: 1.0' -e '^Architecture: i386' | wc -l) -eq 3 || msgdie 'show is broken'
@@ -51,17 +51,16 @@ testrun() {
aptget clean
msgtest "\tdeb file is gone"; ! test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb && msgpass || msgfail
fi
- rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
+ rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
testequal "$GOODSHOW" aptcache show testpkg
testequal "$GOODSHOW" aptcache show testpkg
- rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
+ rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
testequal "$GOODPOLICY" aptcache policy testpkg
testequal "$GOODPOLICY" aptcache policy testpkg
- rm rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
+ rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
testequal "$GOODSHOWSRC" aptcache showsrc testpkg
testequal "$GOODSHOWSRC" aptcache showsrc testpkg
- rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
- rm -rf rootdir/var/cache/apt/archives
+ aptget clean
msgtest "Check if the source is aptgetable"
aptget source testpkg -qq 2> /dev/null > /dev/null && msgpass || msgfail
msgtest "\tdsc file is present"; test -f testpkg_1.0.dsc && msgpass || msgfail
@@ -100,7 +99,7 @@ testrun "compressed"
rm rootdir/etc/apt/apt.conf.d/02compressindex
changetowebserver
aptget update -qq
-local GOODPOLICY="$(aptcache policy testpkg)"
+GOODPOLICY="$(aptcache policy testpkg)"
test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 http://' | wc -l) -eq 4
testequal "$GOODPOLICY" aptcache policy testpkg
diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages
index b5d565c2f..82ba9e592 100755
--- a/test/integration/test-disappearing-packages
+++ b/test/integration/test-disappearing-packages
@@ -12,13 +12,13 @@ buildsimplenativepackage "unrelated" "all" "0.5" "unstable"
setupsimplenativepackage "new-pkg" "i386" "2.0" "unstable" "Provides: old-pkg
Replaces: old-pkg
Conflicts: old-pkg (<< 2.0)"
-local BUILDDIR="incoming/new-pkg-2.0"
+BUILDDIR="incoming/new-pkg-2.0"
echo "/usr/share/doc/new-pkg /usr/share/doc/old-pkg" > ${BUILDDIR}/debian/new-pkg.links
buildpackage "$BUILDDIR" "unstable" "main"
rm -rf "$BUILDDIR"
setupsimplenativepackage "old-pkg" "all" "2.0" "unstable" "Depends: new-pkg"
-local BUILDDIR="incoming/old-pkg-2.0"
+BUILDDIR="incoming/old-pkg-2.0"
echo "/usr/share/doc/new-pkg /usr/share/doc/old-pkg" > ${BUILDDIR}/debian/old-pkg.links
echo "
override_dh_link:
@@ -33,9 +33,9 @@ aptget install old-pkg=1.0 --trivial-only -qq 2>&1 > /dev/null
testmarkedauto # old-pkg is manual installed
-local CMD="aptget dist-upgrade -y -q=0"
+CMD="aptget dist-upgrade -y -q=0"
msgtest "Test for equality of" "$CMD"
-local COMPAREFILE=$(mktemp)
+COMPAREFILE=$(mktemp)
echo "The following package disappeared from your system as
all files have been overwritten by other packages:
old-pkg
diff --git a/test/integration/test-hashsum-verification b/test/integration/test-hashsum-verification
index 033096ee8..3ac9eccfb 100755
--- a/test/integration/test-hashsum-verification
+++ b/test/integration/test-hashsum-verification
@@ -19,8 +19,6 @@ prepare() {
for release in $(find rootdir/var/lib/apt/lists 2> /dev/null); do
touch -d 'now - 6 hours' $release
done
- rm -rf rootdir/var/cache/apt/archives
- rm -f rootdir/var/cache/apt/*.bin
cp $1 aptarchive/Packages
find aptarchive -name 'Release' -delete
cat aptarchive/Packages | gzip > aptarchive/Packages.gz
diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning
index fa356ed54..6b1473564 100755
--- a/test/integration/test-policy-pinning
+++ b/test/integration/test-policy-pinning
@@ -30,21 +30,18 @@ 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
@@ -135,7 +132,6 @@ Pin-Priority: -1" > rootdir/etc/apt/preferences
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
@@ -164,7 +160,6 @@ testequalpolicycoolstuff "" "1.0" 1 990 600 "2.0~bpo1" -o Test=NotAutomatic -t s
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
@@ -211,7 +206,6 @@ 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
@@ -220,7 +214,6 @@ testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=N
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
diff --git a/test/integration/test-releasefile-valid-until b/test/integration/test-releasefile-valid-until
new file mode 100755
index 000000000..680a370cb
--- /dev/null
+++ b/test/integration/test-releasefile-valid-until
@@ -0,0 +1,95 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'i386'
+
+insertpackage 'wheezy' 'apt' 'all' '0.8.15'
+
+getlabelfromsuite() {
+ echo -n 'Testcases'
+}
+
+
+setupaptarchive
+
+setupreleasefile() {
+ rm -rf rootdir/var/lib/apt/lists
+ aptget clean
+ generatereleasefiles "$1" "$2"
+ signreleasefiles
+}
+
+aptgetupdate() {
+ if aptget update $* 2>&1 | grep -q 'is expired'; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+setupreleasefile
+msgtest 'Release file is accepted as it has' 'no Until'
+aptgetupdate && msgpass || msgfail
+
+setupreleasefile
+msgtest 'Release file is accepted as it has' 'no Until and good Max-Valid'
+aptgetupdate -o Acquire::Max-ValidTime=3600 && msgpass || msgfail
+
+setupreleasefile 'now - 2 days'
+msgtest 'Release file is rejected as it has' 'no Until, but bad Max-Valid'
+aptgetupdate -o Acquire::Max-ValidTime=3600 && msgfail || msgpass
+
+setupreleasefile 'now - 3 days' 'now + 1 day'
+msgtest 'Release file is accepted as it has' 'good Until'
+aptgetupdate && msgpass || msgfail
+
+setupreleasefile 'now - 7 days' 'now - 4 days'
+msgtest 'Release file is rejected as it has' 'bad Until'
+aptgetupdate && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now - 4 days'
+msgtest 'Release file is rejected as it has' 'bad Until (ignore good Max-Valid)'
+aptgetupdate -o Acquire::Max-ValidTime=1209600 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now - 4 days'
+msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until)'
+aptgetupdate -o Acquire::Max-ValidTime=86400 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now + 4 days'
+msgtest 'Release file is rejected as it has' 'bad Max-Valid (good Until)'
+aptgetupdate -o Acquire::Max-ValidTime=86400 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now + 4 days'
+msgtest 'Release file is accepted as it has' 'good labeled Max-Valid'
+aptgetupdate -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcases=1209600 && msgpass || msgfail
+
+setupreleasefile 'now - 7 days' 'now + 4 days'
+msgtest 'Release file is rejected as it has' 'bad labeled Max-Valid'
+aptgetupdate -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now + 1 days'
+msgtest 'Release file is accepted as it has' 'good Until (good Min-Valid, no Max-Valid)'
+aptgetupdate -o Acquire::Min-ValidTime=1209600 && msgpass || msgfail
+
+setupreleasefile 'now - 7 days' 'now - 4 days'
+msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, no Max-Valid)'
+aptgetupdate -o Acquire::Min-ValidTime=1209600 && msgpass || msgfail
+
+setupreleasefile 'now - 7 days' 'now - 2 days'
+msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, good Max-Valid) <'
+aptgetupdate -o Acquire::Min-ValidTime=1209600 -o Acquire::Max-ValidTime=2419200 && msgpass || msgfail
+
+setupreleasefile 'now - 7 days' 'now - 2 days'
+msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, good Min-Valid) >'
+aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now - 2 days'
+msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) <'
+aptgetupdate -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920 && msgfail || msgpass
+
+setupreleasefile 'now - 7 days' 'now - 2 days'
+msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) >'
+aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920 && msgfail || msgpass
diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification
index 961c49895..8bf02a78f 100755
--- a/test/integration/test-releasefile-verification
+++ b/test/integration/test-releasefile-verification
@@ -19,8 +19,7 @@ prepare() {
for release in $(find rootdir/var/lib/apt/lists 2> /dev/null); do
touch -d 'now - 6 hours' $release
done
- rm -rf rootdir/var/cache/apt/archives
- rm -f rootdir/var/cache/apt/*.bin
+ aptget clean
cp $1 aptarchive/Packages
find aptarchive -name 'Release' -delete
cat aptarchive/Packages | gzip > aptarchive/Packages.gz
diff --git a/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first b/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first
new file mode 100755
index 000000000..a9a4069cf
--- /dev/null
+++ b/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first
@@ -0,0 +1,31 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertinstalledpackage 'libsame' 'i386' '1'
+insertinstalledpackage 'apt' 'i386' '1' 'Depends: libsame (= 1)'
+
+insertpackage 'unstable' 'libsame' 'i386,amd64' '2' 'Multi-Arch: same'
+insertpackage 'unstable' 'apt' 'i386' '2' 'Depends: libsame (= 2)'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ apt:i386 libsame:i386
+The following NEW packages will be installed:
+ libsame
+The following packages will be upgraded:
+ apt:i386 libsame:i386
+2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst libsame:i386 [1] (2 unstable [i386]) [apt:i386 ]
+Inst libsame (2 unstable [amd64]) [apt:i386 ]
+Conf libsame:i386 (2 unstable [i386]) [apt:i386 ]
+Conf libsame (2 unstable [amd64]) [apt:i386 ]
+Inst apt:i386 [1] (2 unstable [i386])
+Conf apt:i386 (2 unstable [i386])' aptget install libsame:amd64 -s