]> git.saurik.com Git - apt.git/blame - test/integration/test-acquire-binary-all
Report non-transient errors as errors, not as warnings
[apt.git] / test / integration / test-acquire-binary-all
CommitLineData
1dd20368
DK
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
1dd20368
DK
6setupenvironment
7configarchitecture 'amd64'
8
9buildsimplenativepackage 'foo-1' 'all' '2' 'unstable'
10buildsimplenativepackage 'foo-2' 'amd64' '2' 'unstable'
11setupaptarchive --no-update
12
a628ca52
DK
13cat >rootdir/etc/apt/apt.conf.d/get-contents <<EOF
14Acquire::IndexTargets::deb::Contents {
15 MetaKey "\$(COMPONENT)/Contents-\$(ARCHITECTURE)";
16 ShortDescription "Contents";
17 Description "\$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents";
18 KeepCompressed "true";
19};
20EOF
21
1dd20368
DK
22msgmsg 'Releasefile with Architectures field and all included'
23testsuccess apt update
24cp rootdir/tmp/testsuccess.output aptupdate.output
25testsuccess grep '^Get.* all Packages ' aptupdate.output
a628ca52 26testsuccess grep '^Get.* all Contents ' aptupdate.output
1dd20368
DK
27testequal 'foo-1
28foo-2' aptcache pkgnames foo-
29
30listcurrentlistsdirectory > lists.before
31testsuccess grep '_binary-all_Packages' lists.before
a628ca52 32testsuccess grep '_Contents-all\.' lists.before
1dd20368
DK
33
34configarchitecture 'amd64' 'i386'
35testsuccessequal "All packages are up to date.
87d6947d 36N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'file:$(readlink -f ./aptarchive) unstable InRelease' doesn't support architecture 'i386'" apt update -o quiet::NoProgress=1
1dd20368
DK
37testfileequal lists.before "$(listcurrentlistsdirectory)"
38testequal 'foo-1
39foo-2' aptcache pkgnames foo-
40
a628ca52
DK
41rm -rf rootdir/var/lib/apt/lists
42msgmsg 'Releasefile has all, but forbids its usage'
43configarchitecture 'amd64'
44sed -i '/^Architectures: / a\
45No-Support-for-Architecture-all: Packages' $(find ./aptarchive -name 'Release')
46signreleasefiles
47testsuccess apt update
48cp rootdir/tmp/testsuccess.output aptupdate.output
49testfailure grep '^Get.* all Packages ' aptupdate.output
50testsuccess grep '^Get.* all Contents ' aptupdate.output
51sed -i '/^No-Support-for-Architecture-all: / d' $(find ./aptarchive -name 'Release')
52
1dd20368
DK
53rm -rf rootdir/var/lib/apt/lists
54msgmsg 'Releasefile with Architectures field but without all'
a628ca52 55configarchitecture 'amd64' 'i386'
1dd20368
DK
56getarchitecturesfromreleasefile() { echo "$(getarchitectures)"; }
57generatereleasefiles
58signreleasefiles
87d6947d 59testsuccessequal 'All packages are up to date.' apt update -o quiet::NoProgress=1
1dd20368
DK
60cp rootdir/tmp/testsuccess.output aptupdate.output
61testfailure grep '^Get.* all Packages ' aptupdate.output
a628ca52 62testfailure grep '^Get.* all Contents ' aptupdate.output
1dd20368
DK
63testequal 'foo-2' aptcache pkgnames foo-
64
65configarchitecture 'amd64'
66testsuccess apt update
67cp rootdir/tmp/testsuccess.output aptupdate.output
68testfailure grep '^Get.* all Packages ' aptupdate.output
a628ca52 69testfailure grep '^Get.* all Contents ' aptupdate.output
1dd20368
DK
70testequal 'foo-2' aptcache pkgnames foo-
71
72rm -rf rootdir/var/lib/apt/lists
73msgmsg 'Releasefile without Architectures field'
74getarchitecturesfromreleasefile() { echo -n ''; }
75generatereleasefiles
76signreleasefiles
a628ca52 77testfailure grep '^Architectures: ' $(find ./aptarchive -name 'Release')
1dd20368
DK
78testsuccess apt update
79cp rootdir/tmp/testsuccess.output aptupdate.output
80testsuccess grep '^Get.* all Packages ' aptupdate.output
a628ca52 81testsuccess grep '^Get.* all Contents ' aptupdate.output
1dd20368
DK
82testequal 'foo-1
83foo-2' aptcache pkgnames foo-
84
85# apt doesn't know supported archs, so missing a configured arch is a failure
86configarchitecture 'amd64' 'i386'
87d6947d 87testfailure apt update
1dd20368
DK
88testequal 'foo-1
89foo-2' aptcache pkgnames foo-
90
a628ca52
DK
91rm -rf rootdir/var/lib/apt/lists
92msgmsg 'Releasefile no Architectures all, but forbids its usage'
93configarchitecture 'amd64'
94sed -i '/^Date: / a\
95No-Support-for-Architecture-all: Packages' $(find ./aptarchive -name 'Release')
96signreleasefiles
97testsuccess apt update
98cp rootdir/tmp/testsuccess.output aptupdate.output
99testfailure grep '^Get.* all Packages ' aptupdate.output
100testsuccess grep '^Get.* all Contents ' aptupdate.output
101sed -i '/^No-Support-for-Architecture-all: / d' $(find ./aptarchive -name 'Release')
102
1dd20368
DK
103msgmsg 'No Releasefile'
104rm -rf rootdir/var/lib/apt/lists
105find aptarchive -name '*Release*' -delete
106configarchitecture 'amd64'
107testfailure apt update
108testwarning apt update --allow-insecure-repositories
109testequal 'foo-1
110foo-2' aptcache pkgnames foo-