]> git.saurik.com Git - apt.git/blame - test/integration/test-releasefile-verification
Remove the "pseudopackage" handling of Architecture: all packages for
[apt.git] / test / integration / test-releasefile-verification
CommitLineData
fe0f7911
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture "i386"
9
10buildaptarchive
11setupflataptarchive
12changetowebserver
13
14prepare() {
15 local DATE="${2:-now}"
16 if [ "$DATE" = 'now' -a "$1" = "${PKGFILE}-new" ]; then
17 DATE='now + 6 days'
18 fi
19 for release in $(find rootdir/var/lib/apt/lists 2> /dev/null); do
20 touch -d 'now - 6 hours' $release
21 done
22 rm -rf rootdir/var/cache/apt/archives
23 rm -f rootdir/var/cache/apt/*.bin
24 cp $1 aptarchive/Packages
25 find aptarchive -name 'Release' -delete
26 cat aptarchive/Packages | gzip > aptarchive/Packages.gz
27 cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2
28 cat aptarchive/Packages | lzma > aptarchive/Packages.lzma
29 generatereleasefiles "$DATE"
30}
31
32installaptold() {
33 testequal 'Reading package lists...
34Building dependency tree...
35Suggested packages:
36 aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt
37The following NEW packages will be installed:
38 apt
390 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
40After this operation, 5370 kB of additional disk space will be used.
41Get:1 http://localhost/ apt 0.7.25.3
42Download complete and in download only mode' aptget install apt -dy
43}
44
45installaptnew() {
46 testequal 'Reading package lists...
47Building dependency tree...
48Suggested packages:
49 aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt
50The following NEW packages will be installed:
51 apt
520 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
53After this operation, 5808 kB of additional disk space will be used.
54Get:1 http://localhost/ apt 0.8.0~pre1
55Download complete and in download only mode' aptget install apt -dy
56}
57
58failaptold() {
59 testequal 'Reading package lists...
60Building dependency tree...
61Suggested packages:
62 aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt
63The following NEW packages will be installed:
64 apt
650 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
66After this operation, 5370 kB of additional disk space will be used.
67WARNING: The following packages cannot be authenticated!
68 apt
69E: There are problems and -y was used without --force-yes' aptget install apt -dy
70}
71
72failaptnew() {
73 testequal 'Reading package lists...
74Building dependency tree...
75Suggested packages:
76 aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt
77The following NEW packages will be installed:
78 apt
790 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
80After this operation, 5808 kB of additional disk space will be used.
81WARNING: The following packages cannot be authenticated!
82 apt
83E: There are problems and -y was used without --force-yes' aptget install apt -dy
84}
85
86# fake our downloadable file
87touch aptarchive/apt.deb
88
89PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')"
90
91runtest() {
92 prepare ${PKGFILE}
93 rm -rf rootdir/var/lib/apt/lists
94 signreleasefiles 'Joe Sixpack'
95 find aptarchive/ -name "$DELETEFILE" -delete
96 msgtest 'Cold archive signed by' 'Joe Sixpack'
97 aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass
98 testequal "$(cat ${PKGFILE})
99" aptcache show apt
100 installaptold
101
102 prepare ${PKGFILE}-new
103 signreleasefiles 'Joe Sixpack'
104 find aptarchive/ -name "$DELETEFILE" -delete
105 msgtest 'Good warm archive signed by' 'Joe Sixpack'
106 aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass
107 testequal "$(cat ${PKGFILE}-new)
108" aptcache show apt
109 installaptnew
110
111
112 prepare ${PKGFILE}
113 rm -rf rootdir/var/lib/apt/lists
114 signreleasefiles 'Marvin Paranoid'
115 find aptarchive/ -name "$DELETEFILE" -delete
116 msgtest 'Cold archive signed by' 'Marvin Paranoid'
117 aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgpass || msgfail
118 testequal "$(cat ${PKGFILE})
119" aptcache show apt
120 failaptold
121
122 prepare ${PKGFILE}-new
123 # weborf doesn't support If-Range
124 for release in $(find rootdir/var/lib/apt/lists/partial/ -name '*Release'); do
125 rm $release
126 touch $release
127 done
128 signreleasefiles 'Joe Sixpack'
129 find aptarchive/ -name "$DELETEFILE" -delete
130 msgtest 'Bad warm archive signed by' 'Joe Sixpack'
131 aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass
132 testequal "$(cat ${PKGFILE}-new)
133" aptcache show apt
134 installaptnew
135
136
137 prepare ${PKGFILE}
138 rm -rf rootdir/var/lib/apt/lists
139 signreleasefiles 'Joe Sixpack'
140 find aptarchive/ -name "$DELETEFILE" -delete
141 msgtest 'Cold archive signed by' 'Joe Sixpack'
142 aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass
143 testequal "$(cat ${PKGFILE})
144" aptcache show apt
145 installaptold
146
147 prepare ${PKGFILE}-new
148 signreleasefiles 'Marvin Paranoid'
149 find aptarchive/ -name "$DELETEFILE" -delete
150 msgtest 'Good warm archive signed by' 'Marvin Paranoid'
151 aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgpass || msgfail
152 testequal "$(cat ${PKGFILE})
153" aptcache show apt
154 installaptold
155}
156
157DELETEFILE="InRelease"
158runtest
159DELETEFILE="Release.gpg"
160runtest