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
() {
23 rm -f foo_1_amd64.deb foo_2_amd64.deb
24 testsuccess aptget download foo
"$@"
25 testsuccess
test -s foo_1_amd64.deb
-o -s foo_2_amd64.deb
27 rm -f foo_1.dsc foo_2.dsc
28 testsuccess aptget
source foo
--dsc-only -d "$@"
29 testsuccess
test -s foo_1.dsc
-o -s foo_2.dsc
38 local WARNING
='WARNING: The following packages cannot be authenticated!
40 E: Some packages could not be authenticated'
42 rm -f foo_1_amd64.deb foo_2_amd64.deb
43 testfailure aptget download foo
"$@"
44 testequal
"$WARNING" tail -n 3 rootdir
/tmp
/testfailure.output
45 testfailure
test -s foo_1_amd64.deb
-o -s foo_2_amd64.deb
47 rm -f foo_1.dsc foo_2.dsc
48 testfailure aptget
source foo
--dsc-only -d "$@"
49 testequal
"$WARNING" tail -n 3 rootdir
/tmp
/testfailure.output
50 testfailure
test -s foo_1.dsc
-o -s foo_2.dsc
53 cp -a rootdir
/etc
/apt
/sources.list.d
/ rootdir
/etc
/apt
/sources.list.d.bak
/
56 rm -rf rootdir
/var
/lib
/apt
/lists
57 # note that insecure with trusted=yes are allowed
58 # as the trusted=yes indicates that security is provided by
59 # something above the understanding of apt
60 testsuccess aptget update
--no-allow-insecure-repositories
63 insecureaptgetupdate
() {
64 rm -rf rootdir
/var
/lib
/apt
/lists
65 testfailure aptget update
--no-allow-insecure-repositories
66 rm -rf rootdir
/var
/lib
/apt
/lists
67 testsuccess aptget update
--allow-insecure-repositories
70 msgmsg
'Test without trusted option and good sources'
71 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
74 everythingsucceeds
-t stable
75 everythingsucceeds
-t testing
77 msgmsg
'Test with trusted=yes option and good sources'
78 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
79 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir
/etc
/apt
/sources.list.d
/*
82 everythingsucceeds
-t stable
83 everythingsucceeds
-t testing
85 msgmsg
'Test with trusted=no option and good sources'
86 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
87 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=no] #' rootdir
/etc
/apt
/sources.list.d
/*
88 # we want the warnings on the actions, but for 'update' everything is fine
91 everythingfails
-t stable
92 everythingfails
-t testing
94 find aptarchive
/dists
/stable \
( -name 'InRelease' -o -name 'Release.gpg' \
) -delete
96 msgmsg
'Test without trusted option and good and unsigned sources'
97 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
100 everythingfails
-t stable
101 everythingsucceeds
-t testing
103 msgmsg
'Test with trusted=yes option and good and unsigned sources'
104 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
105 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir
/etc
/apt
/sources.list.d
/*
108 everythingsucceeds
-t stable
109 everythingsucceeds
-t testing
111 msgmsg
'Test with trusted=no option and good and unsigned sources'
112 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
113 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=no] #' rootdir
/etc
/apt
/sources.list.d
/*
116 everythingfails
-t stable
117 everythingfails
-t testing
119 signreleasefiles
'Marvin Paranoid' 'aptarchive/dists/stable'
121 msgmsg
'Test without trusted option and good and unknown sources'
122 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
125 everythingfails
-t stable
126 everythingsucceeds
-t testing
128 msgmsg
'Test with trusted=yes option and good and unknown sources'
129 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
130 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir
/etc
/apt
/sources.list.d
/*
133 everythingsucceeds
-t stable
134 everythingsucceeds
-t testing
136 msgmsg
'Test with trusted=no option and good and unknown sources'
137 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
138 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=no] #' rootdir
/etc
/apt
/sources.list.d
/*
141 everythingfails
-t stable
142 everythingfails
-t testing
144 signreleasefiles
'Rex Expired' 'aptarchive/dists/stable'
145 cp -a keys
/rexexpired.pub rootdir
/etc
/apt
/trusted.gpg.d
/rexexpired.gpg
147 msgmsg
'Test without trusted option and good and expired sources'
148 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
151 everythingfails
-t stable
152 everythingsucceeds
-t testing
154 msgmsg
'Test with trusted=yes option and good and expired sources'
155 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
156 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir
/etc
/apt
/sources.list.d
/*
159 everythingsucceeds
-t stable
160 everythingsucceeds
-t testing
162 msgmsg
'Test with trusted=no option and good and expired sources'
163 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
164 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=no] #' rootdir
/etc
/apt
/sources.list.d
/*
167 everythingfails
-t stable
168 everythingfails
-t testing
170 # same as the one further above, but this time testing is unsigned
171 find aptarchive
/ \
( -name 'InRelease' -o -name 'Release.gpg' \
) -delete
172 signreleasefiles
'Joe Sixpack' 'aptarchive/dists/stable'
174 msgmsg
'Test without trusted option and unsigned and good sources'
175 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
178 everythingsucceeds
-t stable
179 everythingfails
-t testing
181 msgmsg
'Test with trusted=yes option and unsigned and good sources'
182 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
183 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir
/etc
/apt
/sources.list.d
/*
186 everythingsucceeds
-t stable
187 everythingsucceeds
-t testing
189 msgmsg
'Test with trusted=no option and unsigned and good sources'
190 cp -a rootdir
/etc
/apt
/sources.list.d.bak
/* rootdir
/etc
/apt
/sources.list.d
/
191 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=no] #' rootdir
/etc
/apt
/sources.list.d
/*
194 everythingfails
-t stable
195 everythingfails
-t testing