]>
Commit | Line | Data |
---|---|---|
a537ce19 MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | ||
7 | setupenvironment | |
f74a6fa1 | 8 | configarchitecture 'i386' |
a537ce19 | 9 | |
f74a6fa1 DK |
10 | SOURCES='rootdir/etc/apt/sources.list' |
11 | BASE='# some comment | |
d2d68aaf | 12 | # that contains a : as well |
7f316a3f | 13 | #Types: meep |
d2d68aaf | 14 | |
7f316a3f | 15 | Types: deb |
75c10df1 | 16 | URIs: http://ftp.debian.org/debian |
6c069a22 MV |
17 | Suites: stable |
18 | Sections: main | |
e67b9a23 | 19 | Description: summay |
f744c64c | 20 | and the long part' |
a537ce19 | 21 | |
f74a6fa1 DK |
22 | msgtest 'Test old-style sources.list' |
23 | echo "deb http://ftp.debian.org/debian stable main" > $SOURCES | |
24 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 : | |
a537ce19 | 25 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : |
f74a6fa1 | 26 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris |
a537ce19 | 27 | |
f74a6fa1 | 28 | msgtest 'Test simple deb822 sources.list' |
4194c9ae | 29 | echo "$BASE" > $SOURCES |
f74a6fa1 | 30 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 : |
a537ce19 | 31 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : |
f74a6fa1 | 32 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris |
300b15e3 | 33 | |
a537ce19 | 34 | |
f74a6fa1 | 35 | msgtest 'Test deb822 with' 'two entries' |
a537ce19 | 36 | # Two entries |
4194c9ae MV |
37 | echo "$BASE" > $SOURCES |
38 | echo "" >> $SOURCES | |
39 | echo "$BASE" | sed s/stable/unstable/ >> $SOURCES | |
f74a6fa1 | 40 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 : |
a537ce19 MV |
41 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : |
42 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 | |
43 | 'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 : | |
44 | 'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 : | |
f74a6fa1 | 45 | 'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris |
a537ce19 | 46 | |
d73743dd | 47 | # two suite entries |
2f0ae309 | 48 | msgtest 'Test deb822 with' 'two Suite entries' |
d73743dd | 49 | echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES |
2f0ae309 | 50 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 : |
d73743dd MV |
51 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : |
52 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 | |
53 | 'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 : | |
54 | 'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 : | |
55 | 'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris | |
a537ce19 | 56 | |
f74a6fa1 | 57 | msgtest 'Test deb822' 'architecture option' |
4194c9ae | 58 | echo "$BASE" > $SOURCES |
41e6bd08 | 59 | echo "Architectures: amd64 armel" >> $SOURCES |
f74a6fa1 | 60 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 : |
a537ce19 MV |
61 | 'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 : |
62 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : | |
63 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris | |
d2d68aaf | 64 | |
4194c9ae | 65 | |
f74a6fa1 DK |
66 | msgtest 'Test old-style sources.list file which has' 'malformed dist' |
67 | echo "deb http://ftp.debian.org" > $SOURCES | |
68 | testequal --nomsg "E: Malformed line 1 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (dist) | |
4194c9ae MV |
69 | E: The list of sources could not be read." aptget update --print-uris |
70 | ||
f74a6fa1 | 71 | msgtest 'Test deb822 sources.list file which has' 'malformed URI' |
7f316a3f | 72 | echo "Types: deb |
6c069a22 | 73 | Suites: stable |
4194c9ae | 74 | " > $SOURCES |
f74a6fa1 | 75 | testequal --nomsg "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse) |
4194c9ae | 76 | E: The list of sources could not be read." aptget update --print-uris |
e67b9a23 | 77 | |
7dd62ea9 MV |
78 | # with Enabled: false |
79 | echo "$BASE" > $SOURCES | |
80 | echo "Enabled: no" >> $SOURCES | |
81 | testempty aptget update --print-uris | |
75c10df1 MV |
82 | |
83 | # multiple URIs | |
f744c64c | 84 | msgtest 'Test deb822 sources.list file which has' 'Multiple URIs work' |
75c10df1 | 85 | echo "$BASE" | sed -e 's#http://ftp.debian.org/debian#http://ftp.debian.org/debian http://ftp.de.debian.org/debian#' > $SOURCES |
f744c64c | 86 | testequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.de.debian.org_debian_dists_stable_main_binary-i386_Packages 0 : |
75c10df1 MV |
87 | 'http://ftp.de.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.de.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : |
88 | 'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp.de.debian.org_debian_dists_stable_InRelease 0 | |
89 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 : | |
90 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : | |
91 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris | |
7f316a3f MV |
92 | |
93 | # multiple Type in one field | |
f744c64c | 94 | msgtest 'Test deb822 sources.list file which has' 'Multiple Types work' |
7f316a3f | 95 | echo "$BASE" | sed -e 's#Types: deb#Types: deb deb-src#' > $SOURCES |
f744c64c | 96 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/source/Sources.bz2' ftp.debian.org_debian_dists_stable_main_source_Sources 0 : |
7f316a3f MV |
97 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 : |
98 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : | |
99 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris |