]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-sources-deb822
prepare new upload
[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
MV
12# that contains a : as well
13#Type: meep
14
15Type: deb
a537ce19
MV
16URL: http://ftp.debian.org/debian
17Dist: stable
18Section: main
19Comment: Some random string
f74a6fa1 20 that can be very long'
a537ce19 21
a537ce19 22
f74a6fa1
DK
23msgtest 'Test old-style sources.list'
24echo "deb http://ftp.debian.org/debian stable main" > $SOURCES
25testequal --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 26'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
f74a6fa1 27'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
a537ce19
MV
28
29
f74a6fa1
DK
30msgtest 'Test simple deb822 sources.list'
31echo "$BASE" > $SOURCES
32testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
33'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
34'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
300b15e3 35
f74a6fa1
DK
36
37msgtest 'Test deb822 with two sections' 'seperated by comma'
38echo "$BASE" | sed 's/main/main,contrib/' > $SOURCES
39testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
300b15e3
MV
40'http://ftp.debian.org/debian/dists/stable/contrib/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_contrib_binary-i386_Packages 0 :
41'http://ftp.debian.org/debian/dists/stable/contrib/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_contrib_i18n_Translation-en 0 :
42'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
f74a6fa1
DK
43'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
44
300b15e3 45
f74a6fa1
DK
46# FIXME: Advertised, but not supported at the moment
47#msgtest 'Test deb822 with two sections' 'seperated by space'
48#echo "$BASE" | sed 's/main/main contrib/' > $SOURCES
49#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 :
50#'http://ftp.debian.org/debian/dists/stable/contrib/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_contrib_binary-i386_Packages 0 :
51#'http://ftp.debian.org/debian/dists/stable/contrib/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_contrib_i18n_Translation-en 0 :
52#'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
53#'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
300b15e3 54
f74a6fa1
DK
55
56msgtest 'Test deb822 with' 'two entries'
4194c9ae
MV
57echo "$BASE" > $SOURCES
58echo "" >> $SOURCES
59echo "$BASE" | sed s/stable/unstable/ >> $SOURCES
f74a6fa1 60testequal --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
61'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
62'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
63'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 :
64'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 :
f74a6fa1 65'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris
a537ce19
MV
66
67
f74a6fa1 68msgtest 'Test deb822' 'architecture option'
4194c9ae
MV
69echo "$BASE" > $SOURCES
70echo "Arch: amd64,armel" >> $SOURCES
f74a6fa1 71testequal --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
72'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 :
73'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
74'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
d2d68aaf 75
4194c9ae 76
f74a6fa1
DK
77msgtest 'Test old-style sources.list file which has' 'malformed dist'
78echo "deb http://ftp.debian.org" > $SOURCES
79testequal --nomsg "E: Malformed line 1 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (dist)
4194c9ae
MV
80E: The list of sources could not be read." aptget update --print-uris
81
f74a6fa1
DK
82
83msgtest 'Test deb822 sources.list file which has' 'malformed URI'
4194c9ae
MV
84echo "Type: deb
85Dist: stable
86" > $SOURCES
f74a6fa1 87testequal --nomsg "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse)
4194c9ae 88E: The list of sources could not be read." aptget update --print-uris