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