]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-sources-deb822
test-apt-download-progress: Allow smaller progress change
[apt.git] / test / integration / test-apt-sources-deb822
CommitLineData
a537ce19
MV
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
f74a6fa1 8configarchitecture 'i386'
a537ce19 9
81460e32 10LISTS='rootdir/etc/apt/sources.list.d/test.list'
7414af7f 11ABSLISTS="$(readlink -f $LISTS)"
81460e32 12SOURCES='rootdir/etc/apt/sources.list.d/test.sources'
f74a6fa1 13BASE='# some comment
d2d68aaf 14# that contains a : as well
7f316a3f 15#Types: meep
d2d68aaf 16
7f316a3f 17Types: deb
75c10df1 18URIs: http://ftp.debian.org/debian
6c069a22 19Suites: stable
81460e32 20Components: main
e67b9a23 21Description: summay
f744c64c 22 and the long part'
a537ce19 23
81460e32
DK
24msgcleantest() {
25 rm -f $LISTS $SOURCES
26 msgtest "$@"
27}
28
29msgcleantest 'Test sources.list' 'old style'
30echo "deb http://ftp.debian.org/debian stable main" > $LISTS
7414af7f 31testsuccessequal --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
36msgcleantest 'Test sources.list' 'old style with tabs'
37echo "deb http://ftp.debian.org/debian stable main" > $LISTS
7414af7f 38testsuccessequal --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
43msgcleantest 'Test sources.list' 'old style with forgotten end for options'
44echo "deb [trusted=yes arch+=armel,powerpc http://ftp.debian.org/debian stable main" > $LISTS
1dd20368 45testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS ([option] not assignment)
7414af7f
DK
46E: The list of sources could not be read." aptget update --print-uris
47
48msgcleantest 'Test sources.list' 'old style with stray ] instead of options'
49echo "deb ] http://ftp.debian.org/debian stable main" > $LISTS
1dd20368 50testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS (URI parse)
7414af7f
DK
51E: The list of sources could not be read." aptget update --print-uris
52
53msgcleantest 'Test sources.list' 'old style options no key'
54echo "deb [=test] http://ftp.debian.org/debian stable main" > $LISTS
1dd20368 55testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS ([option] no key)
7414af7f
DK
56E: The list of sources could not be read." aptget update --print-uris
57
58msgcleantest 'Test sources.list' 'old style options no value'
59echo "deb [test=] http://ftp.debian.org/debian stable main" > $LISTS
1dd20368 60testfailureequal --nomsg "E: Malformed entry 1 in list file $ABSLISTS ([option] no value)
7414af7f
DK
61E: The list of sources could not be read." aptget update --print-uris
62
81460e32
DK
63msgcleantest 'Test sources.list' 'old style with options'
64echo "deb [trusted=yes arch+=armel,powerpc] http://ftp.debian.org/debian stable main" > $LISTS
7414af7f 65testsuccessequal --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
72msgcleantest 'Test sources.list' 'old style with comments'
73echo "deb http://ftp.debian.org/debian stable main # non-free" > $LISTS
7414af7f 74testsuccessequal --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
79msgcleantest 'Test sources.list' 'old style with option comments'
80echo "deb [trusted=yes#yeahreally] http://ftp.debian.org/debian stable main # non-free" > $LISTS
7414af7f 81testsuccessequal --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 86msgcleantest 'Test sources.list' 'simple deb822'
4194c9ae 87echo "$BASE" > $SOURCES
7414af7f 88testsuccessequal --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 93msgcleantest 'Test deb822 with' 'two entries'
a537ce19 94# Two entries
4194c9ae
MV
95echo "$BASE" > $SOURCES
96echo "" >> $SOURCES
97echo "$BASE" | sed s/stable/unstable/ >> $SOURCES
7414af7f 98testsuccessequal --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 108msgcleantest 'Test deb822 with' 'two Suite entries'
d73743dd 109echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES
7414af7f 110testsuccessequal --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 119msgcleantest 'Test deb822' 'architecture option'
4194c9ae 120echo "$BASE" > $SOURCES
41e6bd08 121echo "Architectures: amd64 armel" >> $SOURCES
7414af7f 122testsuccessequal --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
128msgcleantest 'Test old-style' 'suite arch variable'
129echo 'deb http://ftp.tlh.debian.org/universe unstable/binary-$(ARCH)/' > $LISTS
7414af7f 130testsuccessequal --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
134msgcleantest 'Test deb822' 'suite arch variable'
135echo 'Types: deb
136URIs: http://ftp.tlh.debian.org/universe
137Suites: stable/binary-$(ARCH)/' > $SOURCES
7414af7f 138testsuccessequal --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
142msgcleantest 'Test old-style sources.list file which has' 'malformed dist'
143echo "deb http://ftp.debian.org" > $LISTS
7414af7f 144testfailureequal --nomsg "E: Malformed entry 1 in list file $TMPWORKINGDIRECTORY/$LISTS (Suite)
4194c9ae
MV
145E: The list of sources could not be read." aptget update --print-uris
146
81460e32 147msgcleantest 'Test deb822 sources.list file which has' 'malformed URI'
7f316a3f 148echo "Types: deb
6c069a22 149Suites: stable
4194c9ae 150" > $SOURCES
7414af7f 151testfailureequal --nomsg "E: Malformed entry 1 in sources file $TMPWORKINGDIRECTORY/$SOURCES (URI)
4194c9ae 152E: The list of sources could not be read." aptget update --print-uris
e67b9a23 153
7dd62ea9
MV
154# with Enabled: false
155echo "$BASE" > $SOURCES
156echo "Enabled: no" >> $SOURCES
157testempty aptget update --print-uris
75c10df1
MV
158
159# multiple URIs
81460e32 160msgcleantest 'Test deb822 sources.list file which has' 'Multiple URIs work'
75c10df1 161echo "$BASE" | sed -e 's#http://ftp.debian.org/debian#http://ftp.debian.org/debian http://ftp.de.debian.org/debian#' > $SOURCES
7414af7f 162testsuccessequal --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 172msgcleantest 'Test deb822 sources.list file which has' 'Multiple Types work'
7f316a3f 173echo "$BASE" | sed -e 's#Types: deb#Types: deb deb-src#' > $SOURCES
7414af7f 174testsuccessequal --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 181msgcleantest 'Test deb822 sources.list file which has' 'an exact path and no sections'
6f43fac6
MV
182cat > $SOURCES <<EOF
183Types: deb
184URIs: http://emacs.naquadah.org
185Suites: stable/
186EOF
7414af7f 187testsuccessequal --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