4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
'amd64'
10 buildsimplenativepackage
'foo' 'amd64' '1' 'stable'
11 buildsimplenativepackage
'foo' 'amd64' '2' 'testing'
13 setupaptarchive
--no-update
15 APTARCHIVE
=$(readlink -f ./aptarchive)
17 everythingsucceeds
() {
18 testsuccessequal
'Listing...
24 rm -f foo_1_amd64.deb foo_2_amd64.deb
25 testsuccess aptget download foo
"$@"
26 testsuccess
test -s foo_1_amd64.deb
-o -s foo_2_amd64.deb
28 rm -f foo_1.dsc foo_2.dsc
29 testsuccess aptget
source foo
--dsc-only -d "$@"
30 testsuccess
test -s foo_1.dsc
-o -s foo_2.dsc
35 testsuccessequal
'Listing...
40 local WARNING
='WARNING: The following packages cannot be authenticated!
42 E: Some packages could not be authenticated'
45 rm -f foo_1_amd64.deb foo_2_amd64.deb
46 testfailure aptget download foo
"$@"
47 testequal
"$WARNING" tail -n 3 ..
/rootdir
/tmp
/testfailure.output
48 testfailure
test -s foo_1_amd64.deb
-o -s foo_2_amd64.deb
50 rm -f foo_1.dsc foo_2.dsc
51 testfailure aptget
source foo
--dsc-only -d "$@"
52 testequal
"$WARNING" tail -n 3 ..
/rootdir
/tmp
/testfailure.output
53 testfailure
test -s foo_1.dsc
-o -s foo_2.dsc
57 cp -a rootdir
/etc
/apt
/sources.list.d
/ rootdir
/etc
/apt
/sources.list.d.bak
/
58 echo 'Debug::Acquire::Transaction "true";
59 Debug::pkgAcquire::Worker "true";' > rootdir
/etc
/apt
/apt.conf.d
/00debugging
62 rm -rf rootdir
/var
/lib
/apt
/lists
63 # note that insecure with trusted=yes are allowed
64 # as the trusted=yes indicates that security is provided by
65 # something above the understanding of apt
66 ${1:-testsuccess} aptget update
--no-allow-insecure-repositories
69 insecureaptgetupdate
() {
70 rm -rf rootdir
/var
/lib
/apt
/lists
71 testfailure aptget update
--no-allow-insecure-repositories
72 rm -rf rootdir
/var
/lib
/apt
/lists
73 testwarning aptget update
--allow-insecure-repositories
76 msgmsg
'Test without trusted option and good sources'
77 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
80 everythingsucceeds
-t stable
81 everythingsucceeds
-t testing
83 msgmsg
'Test with trusted=yes option and good sources'
84 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
85 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir
/etc
/apt
/sources.list.d
/*
88 everythingsucceeds
-t stable
89 everythingsucceeds
-t testing
91 msgmsg
'Test with trusted=no option and good sources'
92 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
93 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=no] #' rootdir
/etc
/apt
/sources.list.d
/*
94 # we want the warnings on the actions, but for 'update' everything is fine
97 everythingfails
-t stable
98 everythingfails
-t testing
100 find aptarchive
/dists
/stable \
( -name 'InRelease' -o -name 'Release.gpg' \
) -delete
102 msgmsg
'Test without trusted option and good and unsigned sources'
103 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
106 everythingfails
-t stable
107 everythingsucceeds
-t testing
109 msgmsg
'Test with trusted=yes option and good and unsigned sources'
110 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
111 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir
/etc
/apt
/sources.list.d
/*
112 aptgetupdate
'testwarning'
114 everythingsucceeds
-t stable
115 everythingsucceeds
-t testing
117 msgmsg
'Test with trusted=no option and good and unsigned sources'
118 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
119 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=no] #' rootdir
/etc
/apt
/sources.list.d
/*
122 everythingfails
-t stable
123 everythingfails
-t testing
125 signreleasefiles
'Marvin Paranoid' 'aptarchive/dists/stable'
127 msgmsg
'Test without trusted option and good and unknown sources'
128 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
131 everythingfails
-t stable
132 everythingsucceeds
-t testing
134 msgmsg
'Test with trusted=yes option and good and unknown sources'
135 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
136 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir
/etc
/apt
/sources.list.d
/*
137 aptgetupdate
'testwarning'
139 everythingsucceeds
-t stable
140 everythingsucceeds
-t testing
142 msgmsg
'Test with trusted=no option and good and unknown sources'
143 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
144 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=no] #' rootdir
/etc
/apt
/sources.list.d
/*
147 everythingfails
-t stable
148 everythingfails
-t testing
150 signreleasefiles
'Rex Expired' 'aptarchive/dists/stable'
151 cp -a keys
/rexexpired.pub rootdir
/etc
/apt
/trusted.gpg.d
/rexexpired.gpg
153 msgmsg
'Test without trusted option and good and expired sources'
154 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
157 everythingfails
-t stable
158 everythingsucceeds
-t testing
160 msgmsg
'Test with trusted=yes option and good and expired sources'
161 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
162 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir
/etc
/apt
/sources.list.d
/*
163 aptgetupdate
'testwarning'
165 everythingsucceeds
-t stable
166 everythingsucceeds
-t testing
168 msgmsg
'Test with trusted=no option and good and expired sources'
169 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
170 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=no] #' rootdir
/etc
/apt
/sources.list.d
/*
173 everythingfails
-t stable
174 everythingfails
-t testing
176 # same as the one further above, but this time testing is unsigned
177 find aptarchive
/ \
( -name 'InRelease' -o -name 'Release.gpg' \
) -delete
178 signreleasefiles
'Joe Sixpack' 'aptarchive/dists/stable'
180 msgmsg
'Test without trusted option and unsigned and good sources'
181 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
184 everythingsucceeds
-t stable
185 everythingfails
-t testing
187 msgmsg
'Test with trusted=yes option and unsigned and good sources'
188 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
189 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir
/etc
/apt
/sources.list.d
/*
190 aptgetupdate
'testwarning'
192 everythingsucceeds
-t stable
193 everythingsucceeds
-t testing
195 msgmsg
'Test with trusted=no option and unsigned and good sources'
196 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
197 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=no] #' rootdir
/etc
/apt
/sources.list.d
/*
200 everythingfails
-t stable
201 everythingfails
-t testing
203 msgmsg
'Test conflicting trusted options are refused'
205 echo "$@" > rootdir
/etc
/apt
/sources.list.d
/example.list
206 testfailuremsg
'E: Conflicting values set for option Trusted concerning source http://example.org/bad/ unstable
207 E: The list of sources could not be read.' aptget update
--print-uris
209 for VAL
in 'yes' 'no'; do
210 testsource
"deb http://example.org/bad unstable main
211 deb [trusted=${VAL}] http://example.org/bad unstable non-free"
212 testsource
"deb [trusted=${VAL}] http://example.org/bad unstable main
213 deb http://example.org/bad unstable non-free"
215 testsource
'deb [trusted=yes] http://example.org/bad unstable main
216 deb [trusted=no] http://example.org/bad unstable non-free'
217 testsource
'deb [trusted=no] http://example.org/bad unstable main
218 deb [trusted=yes] http://example.org/bad unstable non-free'