]>
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 | |
81460e32 | 10 | LISTS='rootdir/etc/apt/sources.list.d/test.list' |
7414af7f | 11 | ABSLISTS="$(readlink -f $LISTS)" |
81460e32 | 12 | SOURCES='rootdir/etc/apt/sources.list.d/test.sources' |
f74a6fa1 | 13 | BASE='# some comment |
d2d68aaf | 14 | # that contains a : as well |
7f316a3f | 15 | #Types: meep |
d2d68aaf | 16 | |
7f316a3f | 17 | Types: deb |
75c10df1 | 18 | URIs: http://ftp.debian.org/debian |
6c069a22 | 19 | Suites: stable |
81460e32 | 20 | Components: main |
e67b9a23 | 21 | Description: summay |
f744c64c | 22 | and the long part' |
a537ce19 | 23 | |
81460e32 DK |
24 | msgcleantest() { |
25 | rm -f $LISTS $SOURCES | |
26 | msgtest "$@" | |
27 | } | |
28 | ||
29 | msgcleantest 'Test sources.list' 'old style' | |
30 | echo "deb http://ftp.debian.org/debian stable main" > $LISTS | |
7414af7f | 31 | testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 | 32 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
1dd20368 | 33 | 'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 | 34 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris |
defe3231 JAK |
35 | |
36 | msgcleantest 'Test sources.list' 'old style with tabs' | |
37 | echo "deb http://ftp.debian.org/debian stable main" > $LISTS | |
7414af7f | 38 | testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 | 39 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
1dd20368 | 40 | 'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 | 41 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris |
81460e32 | 42 | |
7414af7f DK |
43 | msgcleantest 'Test sources.list' 'old style with forgotten end for options' |
44 | echo "deb [trusted=yes arch+=armel,powerpc http://ftp.debian.org/debian stable main" > $LISTS | |
1dd20368 | 45 | testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS ([option] not assignment) |
7414af7f DK |
46 | E: The list of sources could not be read." aptget update --print-uris |
47 | ||
48 | msgcleantest 'Test sources.list' 'old style with stray ] instead of options' | |
49 | echo "deb ] http://ftp.debian.org/debian stable main" > $LISTS | |
1dd20368 | 50 | testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS (URI parse) |
7414af7f DK |
51 | E: The list of sources could not be read." aptget update --print-uris |
52 | ||
53 | msgcleantest 'Test sources.list' 'old style options no key' | |
54 | echo "deb [=test] http://ftp.debian.org/debian stable main" > $LISTS | |
1dd20368 | 55 | testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS ([option] no key) |
7414af7f DK |
56 | E: The list of sources could not be read." aptget update --print-uris |
57 | ||
58 | msgcleantest 'Test sources.list' 'old style options no value' | |
59 | echo "deb [test=] http://ftp.debian.org/debian stable main" > $LISTS | |
1dd20368 | 60 | testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS ([option] no value) |
7414af7f DK |
61 | E: The list of sources could not be read." aptget update --print-uris |
62 | ||
81460e32 DK |
63 | msgcleantest 'Test sources.list' 'old style with options' |
64 | echo "deb [trusted=yes arch+=armel,powerpc] http://ftp.debian.org/debian stable main" > $LISTS | |
7414af7f | 65 | testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 | 66 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
1dd20368 | 67 | 'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 DK |
68 | 'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 |
69 | 'http://ftp.debian.org/debian/dists/stable/main/binary-powerpc/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-powerpc_Packages 0 | |
70 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris | |
81460e32 DK |
71 | |
72 | msgcleantest 'Test sources.list' 'old style with comments' | |
73 | echo "deb http://ftp.debian.org/debian stable main # non-free" > $LISTS | |
7414af7f | 74 | testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 | 75 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
1dd20368 | 76 | 'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 | 77 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris |
81460e32 DK |
78 | |
79 | msgcleantest 'Test sources.list' 'old style with option comments' | |
80 | echo "deb [trusted=yes#yeahreally] http://ftp.debian.org/debian stable main # non-free" > $LISTS | |
7414af7f | 81 | testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 | 82 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
1dd20368 | 83 | 'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 | 84 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris |
a537ce19 | 85 | |
81460e32 | 86 | msgcleantest 'Test sources.list' 'simple deb822' |
4194c9ae | 87 | echo "$BASE" > $SOURCES |
7414af7f | 88 | testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 | 89 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
1dd20368 | 90 | 'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 | 91 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris |
a537ce19 | 92 | |
81460e32 | 93 | msgcleantest 'Test deb822 with' 'two entries' |
a537ce19 | 94 | # Two entries |
4194c9ae MV |
95 | echo "$BASE" > $SOURCES |
96 | echo "" >> $SOURCES | |
97 | echo "$BASE" | sed s/stable/unstable/ >> $SOURCES | |
7414af7f | 98 | testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 | 99 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
1dd20368 | 100 | 'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 | 101 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 |
448c38bd | 102 | 'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 |
e93b4028 | 103 | 'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 |
1dd20368 | 104 | 'http://ftp.debian.org/debian/dists/unstable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_unstable_main_binary-all_Packages 0 |
e93b4028 | 105 | 'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris |
a537ce19 | 106 | |
d73743dd | 107 | # two suite entries |
81460e32 | 108 | msgcleantest 'Test deb822 with' 'two Suite entries' |
d73743dd | 109 | echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES |
7414af7f | 110 | testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 | 111 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
1dd20368 | 112 | 'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 | 113 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 |
448c38bd | 114 | 'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 |
e93b4028 | 115 | 'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 |
1dd20368 | 116 | 'http://ftp.debian.org/debian/dists/unstable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_unstable_main_binary-all_Packages 0 |
e93b4028 | 117 | 'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris |
a537ce19 | 118 | |
81460e32 | 119 | msgcleantest 'Test deb822' 'architecture option' |
4194c9ae | 120 | echo "$BASE" > $SOURCES |
41e6bd08 | 121 | echo "Architectures: amd64 armel" >> $SOURCES |
7414af7f | 122 | testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 DK |
123 | 'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 |
124 | 'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 | |
1dd20368 | 125 | 'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 | 126 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris |
d2d68aaf | 127 | |
81460e32 DK |
128 | msgcleantest 'Test old-style' 'suite arch variable' |
129 | echo 'deb http://ftp.tlh.debian.org/universe unstable/binary-$(ARCH)/' > $LISTS | |
7414af7f | 130 | testsuccessequal --nomsg "'http://ftp.tlh.debian.org/universe/unstable/binary-i386/InRelease' ftp.tlh.debian.org_universe_unstable_binary-i386_InRelease 0 |
e93b4028 DK |
131 | 'http://ftp.tlh.debian.org/universe/unstable/binary-i386/Packages.xz' ftp.tlh.debian.org_universe_unstable_binary-i386_Packages 0 |
132 | 'http://ftp.tlh.debian.org/universe/unstable/binary-i386/en.xz' ftp.tlh.debian.org_universe_unstable_binary-i386_en 0 " aptget update --print-uris | |
81460e32 DK |
133 | |
134 | msgcleantest 'Test deb822' 'suite arch variable' | |
135 | echo 'Types: deb | |
136 | URIs: http://ftp.tlh.debian.org/universe | |
137 | Suites: stable/binary-$(ARCH)/' > $SOURCES | |
7414af7f | 138 | testsuccessequal --nomsg "'http://ftp.tlh.debian.org/universe/stable/binary-i386/InRelease' ftp.tlh.debian.org_universe_stable_binary-i386_InRelease 0 |
e93b4028 DK |
139 | 'http://ftp.tlh.debian.org/universe/stable/binary-i386/Packages.xz' ftp.tlh.debian.org_universe_stable_binary-i386_Packages 0 |
140 | 'http://ftp.tlh.debian.org/universe/stable/binary-i386/en.xz' ftp.tlh.debian.org_universe_stable_binary-i386_en 0 " aptget update --print-uris | |
81460e32 DK |
141 | |
142 | msgcleantest 'Test old-style sources.list file which has' 'malformed dist' | |
143 | echo "deb http://ftp.debian.org" > $LISTS | |
7414af7f | 144 | testfailureequal --nomsg "E: Malformed entry 1 in list file $TMPWORKINGDIRECTORY/$LISTS (Suite) |
4194c9ae MV |
145 | E: The list of sources could not be read." aptget update --print-uris |
146 | ||
81460e32 | 147 | msgcleantest 'Test deb822 sources.list file which has' 'malformed URI' |
7f316a3f | 148 | echo "Types: deb |
6c069a22 | 149 | Suites: stable |
4194c9ae | 150 | " > $SOURCES |
7414af7f | 151 | testfailureequal --nomsg "E: Malformed entry 1 in sources file $TMPWORKINGDIRECTORY/$SOURCES (URI) |
4194c9ae | 152 | E: The list of sources could not be read." aptget update --print-uris |
e67b9a23 | 153 | |
7dd62ea9 MV |
154 | # with Enabled: false |
155 | echo "$BASE" > $SOURCES | |
156 | echo "Enabled: no" >> $SOURCES | |
157 | testempty aptget update --print-uris | |
75c10df1 MV |
158 | |
159 | # multiple URIs | |
81460e32 | 160 | msgcleantest 'Test deb822 sources.list file which has' 'Multiple URIs work' |
75c10df1 | 161 | echo "$BASE" | sed -e 's#http://ftp.debian.org/debian#http://ftp.debian.org/debian http://ftp.de.debian.org/debian#' > $SOURCES |
7414af7f | 162 | testsuccessequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp.de.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 | 163 | 'http://ftp.de.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.de.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
1dd20368 | 164 | 'http://ftp.de.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.de.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 | 165 | 'http://ftp.de.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.de.debian.org_debian_dists_stable_main_i18n_Translation-en 0 |
448c38bd | 166 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 | 167 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
1dd20368 | 168 | 'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 | 169 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris |
7f316a3f MV |
170 | |
171 | # multiple Type in one field | |
81460e32 | 172 | msgcleantest 'Test deb822 sources.list file which has' 'Multiple Types work' |
7f316a3f | 173 | echo "$BASE" | sed -e 's#Types: deb#Types: deb deb-src#' > $SOURCES |
7414af7f | 174 | testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
e93b4028 DK |
175 | 'http://ftp.debian.org/debian/dists/stable/main/source/Sources.xz' ftp.debian.org_debian_dists_stable_main_source_Sources 0 |
176 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 | |
1dd20368 | 177 | 'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 |
e93b4028 | 178 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris |
6f43fac6 MV |
179 | |
180 | # a Suite | |
81460e32 | 181 | msgcleantest 'Test deb822 sources.list file which has' 'an exact path and no sections' |
6f43fac6 MV |
182 | cat > $SOURCES <<EOF |
183 | Types: deb | |
184 | URIs: http://emacs.naquadah.org | |
185 | Suites: stable/ | |
186 | EOF | |
7414af7f | 187 | testsuccessequal --nomsg "'http://emacs.naquadah.org/stable/InRelease' emacs.naquadah.org_stable_InRelease 0 |
e93b4028 DK |
188 | 'http://emacs.naquadah.org/stable/Packages.xz' emacs.naquadah.org_stable_Packages 0 |
189 | 'http://emacs.naquadah.org/stable/en.xz' emacs.naquadah.org_stable_en 0 " aptget update --print-uris |