]>
git.saurik.com Git - apt.git/blob - test/integration/test-releasefile-verification
4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
"i386"
15 local DATE
="${2:-now}"
16 if [ "$DATE" = 'now' -a "$1" = "${PKGFILE}-new" ]; then
19 for release
in $(find rootdir/var/lib/apt/lists 2> /dev/null); do
20 touch -d 'now - 6 hours' $release
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"
33 testequal
'Reading package lists...
34 Building dependency tree...
36 aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt
37 The following NEW packages will be installed:
39 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
40 After this operation, 5370 kB of additional disk space will be used.
41 Get:1 http://localhost/ apt 0.7.25.3
42 Download complete and in download only mode' aptget
install apt
-dy
46 testequal
'Reading package lists...
47 Building dependency tree...
49 aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt
50 The following NEW packages will be installed:
52 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
53 After this operation, 5808 kB of additional disk space will be used.
54 Get:1 http://localhost/ apt 0.8.0~pre1
55 Download complete and in download only mode' aptget
install apt
-dy
59 testequal
'Reading package lists...
60 Building dependency tree...
62 aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt
63 The following NEW packages will be installed:
65 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
66 After this operation, 5370 kB of additional disk space will be used.
67 WARNING: The following packages cannot be authenticated!
69 E: There are problems and -y was used without --force-yes' aptget
install apt
-dy
73 testequal
'Reading package lists...
74 Building dependency tree...
76 aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt
77 The following NEW packages will be installed:
79 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
80 After this operation, 5808 kB of additional disk space will be used.
81 WARNING: The following packages cannot be authenticated!
83 E: There are problems and -y was used without --force-yes' aptget
install apt
-dy
86 # fake our downloadable file
87 touch aptarchive
/apt.deb
89 PKGFILE
="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')"
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})
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)
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})
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
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)
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})
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})
157 DELETEFILE="InRelease
"
159 DELETEFILE="Release.gpg
"