]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-sources-deb822
Merge branch 'debian/experimental-no-abi-break' into debian/sid
[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
f74a6fa1
DK
10SOURCES='rootdir/etc/apt/sources.list'
11BASE='# some comment
d2d68aaf 12# that contains a : as well
7f316a3f 13#Types: meep
d2d68aaf 14
7f316a3f 15Types: deb
75c10df1 16URIs: http://ftp.debian.org/debian
6c069a22
MV
17Suites: stable
18Sections: main
e67b9a23 19Description: summay
f744c64c 20 and the long part'
a537ce19 21
f74a6fa1
DK
22msgtest 'Test old-style sources.list'
23echo "deb http://ftp.debian.org/debian stable main" > $SOURCES
24testequal --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 28msgtest 'Test simple deb822 sources.list'
4194c9ae 29echo "$BASE" > $SOURCES
f74a6fa1 30testequal --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 35msgtest 'Test deb822 with' 'two entries'
a537ce19 36# Two entries
4194c9ae
MV
37echo "$BASE" > $SOURCES
38echo "" >> $SOURCES
39echo "$BASE" | sed s/stable/unstable/ >> $SOURCES
f74a6fa1 40testequal --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 48msgtest 'Test deb822 with' 'two Suite entries'
d73743dd 49echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES
2f0ae309 50testequal --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 57msgtest 'Test deb822' 'architecture option'
4194c9ae 58echo "$BASE" > $SOURCES
7037aab5 59echo "Architectures: amd64,armel" >> $SOURCES
f74a6fa1 60testequal --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
66msgtest 'Test old-style sources.list file which has' 'malformed dist'
67echo "deb http://ftp.debian.org" > $SOURCES
68testequal --nomsg "E: Malformed line 1 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (dist)
4194c9ae
MV
69E: The list of sources could not be read." aptget update --print-uris
70
f74a6fa1 71msgtest 'Test deb822 sources.list file which has' 'malformed URI'
7f316a3f 72echo "Types: deb
6c069a22 73Suites: stable
4194c9ae 74" > $SOURCES
f74a6fa1 75testequal --nomsg "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse)
4194c9ae 76E: The list of sources could not be read." aptget update --print-uris
e67b9a23 77
7dd62ea9
MV
78# with Enabled: false
79echo "$BASE" > $SOURCES
80echo "Enabled: no" >> $SOURCES
81testempty aptget update --print-uris
75c10df1
MV
82
83# multiple URIs
f744c64c 84msgtest 'Test deb822 sources.list file which has' 'Multiple URIs work'
75c10df1 85echo "$BASE" | sed -e 's#http://ftp.debian.org/debian#http://ftp.debian.org/debian http://ftp.de.debian.org/debian#' > $SOURCES
f744c64c 86testequal --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 94msgtest 'Test deb822 sources.list file which has' 'Multiple Types work'
7f316a3f 95echo "$BASE" | sed -e 's#Types: deb#Types: deb deb-src#' > $SOURCES
f744c64c 96testequal --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