]>
Commit | Line | Data |
---|---|---|
1dd20368 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | setupenvironment | |
7 | configarchitecture 'amd64' | |
8 | ||
9 | buildsimplenativepackage 'foo-1' 'all' '2' 'unstable' | |
10 | buildsimplenativepackage 'foo-2' 'amd64' '2' 'unstable' | |
11 | setupaptarchive --no-update | |
12 | ||
13 | msgmsg 'Releasefile with Architectures field and all included' | |
14 | testsuccess apt update | |
15 | cp rootdir/tmp/testsuccess.output aptupdate.output | |
16 | testsuccess grep '^Get.* all Packages ' aptupdate.output | |
17 | testequal 'foo-1 | |
18 | foo-2' aptcache pkgnames foo- | |
19 | ||
20 | listcurrentlistsdirectory > lists.before | |
21 | testsuccess grep '_binary-all_Packages' lists.before | |
22 | ||
23 | configarchitecture 'amd64' 'i386' | |
24 | testsuccessequal "All packages are up to date. | |
25 | N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'file:$(readlink -f ./aptarchive) unstable InRelease' doesn't support architecture 'i386'" apt update -q=0 -o quiet::NoProgress=1 | |
26 | testfileequal lists.before "$(listcurrentlistsdirectory)" | |
27 | testequal 'foo-1 | |
28 | foo-2' aptcache pkgnames foo- | |
29 | ||
30 | rm -rf rootdir/var/lib/apt/lists | |
31 | msgmsg 'Releasefile with Architectures field but without all' | |
32 | getarchitecturesfromreleasefile() { echo "$(getarchitectures)"; } | |
33 | generatereleasefiles | |
34 | signreleasefiles | |
35 | testsuccessequal "All packages are up to date. | |
36 | N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'file:$(readlink -f ./aptarchive) unstable InRelease' doesn't support architecture 'i386'" apt update -q=0 -o quiet::NoProgress=1 | |
37 | cp rootdir/tmp/testsuccess.output aptupdate.output | |
38 | testfailure grep '^Get.* all Packages ' aptupdate.output | |
39 | testequal 'foo-2' aptcache pkgnames foo- | |
40 | ||
41 | configarchitecture 'amd64' | |
42 | testsuccess apt update | |
43 | cp rootdir/tmp/testsuccess.output aptupdate.output | |
44 | testfailure grep '^Get.* all Packages ' aptupdate.output | |
45 | testequal 'foo-2' aptcache pkgnames foo- | |
46 | ||
47 | rm -rf rootdir/var/lib/apt/lists | |
48 | msgmsg 'Releasefile without Architectures field' | |
49 | getarchitecturesfromreleasefile() { echo -n ''; } | |
50 | generatereleasefiles | |
51 | signreleasefiles | |
52 | testsuccess apt update | |
53 | cp rootdir/tmp/testsuccess.output aptupdate.output | |
54 | testsuccess grep '^Get.* all Packages ' aptupdate.output | |
55 | testequal 'foo-1 | |
56 | foo-2' aptcache pkgnames foo- | |
57 | ||
58 | # apt doesn't know supported archs, so missing a configured arch is a failure | |
59 | configarchitecture 'amd64' 'i386' | |
60 | testfailure apt update -q=0 | |
61 | testequal 'foo-1 | |
62 | foo-2' aptcache pkgnames foo- | |
63 | ||
64 | msgmsg 'No Releasefile' | |
65 | rm -rf rootdir/var/lib/apt/lists | |
66 | find aptarchive -name '*Release*' -delete | |
67 | configarchitecture 'amd64' | |
68 | testfailure apt update | |
69 | testwarning apt update --allow-insecure-repositories | |
70 | testequal 'foo-1 | |
71 | foo-2' aptcache pkgnames foo- |