summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-10-07 16:38:03 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-10-07 16:38:03 +0200
commit4d0818cc39f7c0d44ecdfcdf9701058f81caa492 (patch)
tree63eaa546ba527209d2b2068d188800e5e4872093 /test/integration
parentea7682a0d91fee638eef06b63045b1499ddf50ac (diff)
parent00a06b8eb82cf930511fc003bd16d7034e5a0cb5 (diff)
Merge remote-tracking branch 'upstream/debian/experimental' into feature/acq-trans
Conflicts: apt-pkg/acquire-item.cc
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/framework3
-rwxr-xr-xtest/integration/test-apt-key7
-rwxr-xr-xtest/integration/test-compressed-indexes4
-rwxr-xr-xtest/integration/test-pdiff-usage50
4 files changed, 55 insertions, 9 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 29e5fafe6..0aa648fb6 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -47,6 +47,9 @@ msgskip() { printf "${CWARNING}SKIP${CNORMAL}\n" >&2; }
msgfail() {
if [ $# -gt 0 ]; then printf "${CFAIL}FAIL: $*${CNORMAL}\n" >&2;
else printf "${CFAIL}FAIL${CNORMAL}\n" >&2; fi
+ if [ -n "$APT_DEBUG_TESTS" ]; then
+ bash
+ fi
EXIT_CODE=$((EXIT_CODE+1));
}
diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key
index d5adec5bd..e6ac530a6 100755
--- a/test/integration/test-apt-key
+++ b/test/integration/test-apt-key
@@ -41,7 +41,14 @@ gpg: unchanged: 1' aptkey --fakeroot update
testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18'
+ testsuccess test ! -e rootdir/etc/apt/trusted.gpg
testsuccess aptkey --fakeroot add ./keys/rexexpired.pub
+ msgtest 'Check if trusted.gpg is created with permissions set to' '0644'
+ if [ "$(stat -c '%a' rootdir/etc/apt/trusted.gpg )" = '644' ]; then
+ msgpass
+ else
+ msgfail
+ fi
testaptkeys 'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]
pub 2048R/DBAC8DAE 2010-08-18'
diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes
index 805ed5964..1beb5d831 100755
--- a/test/integration/test-compressed-indexes
+++ b/test/integration/test-compressed-indexes
@@ -39,10 +39,10 @@ testrun() {
test -e rootdir/var/lib/apt/lists/*_Translation-en.${COMPRESS} || F=1
# there is no point in trying pdiff if we have compressed indexes
# as we can't patch compressed files (well, we can, but what is the point?)
- ! test -e rootdir/var/lib/apt/lists/*.IndexDiff || F=1
+ ! test -e rootdir/var/lib/apt/lists/*diff_Index || F=1
else
# clear the faked pdiff indexes so the glob below works
- rm -f rootdir/var/lib/apt/lists/*.IndexDiff
+ rm -f rootdir/var/lib/apt/lists/*diff_Index
test -e rootdir/var/lib/apt/lists/*_Packages || F=1
test -e rootdir/var/lib/apt/lists/*_Sources || F=1
test -e rootdir/var/lib/apt/lists/*_Translation-en || F=1
diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage
index e86963f28..5bad90214 100755
--- a/test/integration/test-pdiff-usage
+++ b/test/integration/test-pdiff-usage
@@ -76,8 +76,15 @@ SHA1-History:
9f4148e06d7faa37062994ff10d0c842d7017513 33053002 2010-08-18-2013.28
$(sha1sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
SHA1-Patches:
- 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.28
- $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX
+ 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-2013.28
+ $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)
+SHA256-Current: $(sha256sum ${PKGFILE}-new | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}-new)
+SHA256-History:
+ 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 33053002 2010-08-18-2013.28
+ $(sha256sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
+SHA256-Patches:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28
+ $(sha256sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX
generatereleasefiles '+1hour'
signreleasefiles
find aptarchive -name 'Packages*' -type f -delete
@@ -87,7 +94,7 @@ SHA1-Patches:
" aptcache show apt newstuff
msgmsg "Testcase: index is already up-to-date: $*"
- find rootdir/var/lib/apt/lists -name '*.IndexDiff' -type f -delete
+ find rootdir/var/lib/apt/lists -name '*diff_Index' -type f -delete
testsuccess aptget update "$@"
testequal "$(cat ${PKGFILE}-new)
" aptcache show apt newstuff
@@ -119,9 +126,18 @@ SHA1-History:
$(sha1sum ${PKGFILE} | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}) $(basename ${PATCHFILE})
$(sha1sum ${PKGFILE}-new | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}-new) $(basename ${PATCHFILE2})
SHA1-Patches:
- 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.28
+ 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-2013.28
$(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)
- $(sha1sum ${PATCHFILE2} | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE2}) $(basename ${PATCHFILE2})" > $PATCHINDEX
+ $(sha1sum ${PATCHFILE2} | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE2}) $(basename ${PATCHFILE2})
+SHA256-Current: $(sha256sum aptarchive/Packages | cut -d' ' -f 1) $(stat -c%s aptarchive/Packages)
+SHA256-History:
+ 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 33053002 2010-08-18-2013.28
+ $(sha256sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
+ $(sha256sum ${PKGFILE}-new | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}-new) $(basename ${PATCHFILE2})
+SHA256-Patches:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28
+ $(sha256sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)
+ $(sha256sum ${PATCHFILE2} | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE2}) $(basename ${PATCHFILE2})" > $PATCHINDEX
generatereleasefiles '+2hour'
signreleasefiles
cp -a aptarchive/Packages Packages-future
@@ -147,8 +163,15 @@ SHA1-History:
9f4148e06d7faa37062994ff10d0c842d7017513 33053002 2010-08-18-2013.28
$(sha1sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
SHA1-Patches:
- 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.28
- $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX
+ 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-2013.28
+ $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)
+SHA256-Current: $(sha256sum ${PKGFILE}-new | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}-new)
+SHA256-History:
+ 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 33053002 2010-08-18-2013.28
+ $(sha256sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
+SHA256-Patches:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28
+ $(sha256sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX
echo 'I am Mallory and I change files' >> $PATCHFILE
cat $PATCHFILE | gzip > ${PATCHFILE}.gz
generatereleasefiles '+1hour'
@@ -166,3 +189,16 @@ testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=1
testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=1
testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=0
testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=0
+
+sha256sum() {
+ echo '01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b -'
+}
+testrun -o Acquire::PDiffs::Merge=0 -o Acquire::ForceHash=SHA1
+testrun -o Acquire::PDiffs::Merge=1 -o Acquire::ForceHash=SHA1
+
+unset -f sha256sum
+sha1sum() {
+ echo 'adc83b19e793491b1c6ea0fd8b46cd9f32e592fc -'
+}
+testrun -o Acquire::PDiffs::Merge=0 -o Acquire::ForceHash=SHA256
+testrun -o Acquire::PDiffs::Merge=1 -o Acquire::ForceHash=SHA256