]>
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 | |
bae81c13 DK |
10 | echo 'APT::Sources::Use-Deb822 "true";' > rootdir/etc/apt/apt.conf.d/00enabledeb822 |
11 | ||
f74a6fa1 DK |
12 | SOURCES='rootdir/etc/apt/sources.list' |
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 MV |
19 | Suites: stable |
20 | Sections: main | |
e67b9a23 | 21 | Description: summay |
f744c64c | 22 | and the long part' |
a537ce19 | 23 | |
bae81c13 | 24 | msgtest 'Test sources.list' 'old style' |
f74a6fa1 | 25 | echo "deb http://ftp.debian.org/debian stable main" > $SOURCES |
448c38bd DK |
26 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
27 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 | |
28 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris | |
a537ce19 | 29 | |
bae81c13 | 30 | msgtest 'Test sources.list' 'simple deb822' |
4194c9ae | 31 | echo "$BASE" > $SOURCES |
448c38bd DK |
32 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
33 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 | |
34 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris | |
a537ce19 | 35 | |
f74a6fa1 | 36 | msgtest 'Test deb822 with' 'two entries' |
a537ce19 | 37 | # Two entries |
4194c9ae MV |
38 | echo "$BASE" > $SOURCES |
39 | echo "" >> $SOURCES | |
40 | echo "$BASE" | sed s/stable/unstable/ >> $SOURCES | |
448c38bd DK |
41 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
42 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 | |
b3501edb | 43 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 |
448c38bd | 44 | 'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 |
b3501edb | 45 | 'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 |
448c38bd | 46 | 'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris |
a537ce19 | 47 | |
d73743dd | 48 | # two suite entries |
2f0ae309 | 49 | msgtest 'Test deb822 with' 'two Suite entries' |
d73743dd | 50 | echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES |
448c38bd DK |
51 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
52 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 | |
b3501edb | 53 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 |
448c38bd | 54 | 'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 |
b3501edb | 55 | 'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 |
448c38bd | 56 | 'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris |
a537ce19 | 57 | |
f74a6fa1 | 58 | msgtest 'Test deb822' 'architecture option' |
4194c9ae | 59 | echo "$BASE" > $SOURCES |
41e6bd08 | 60 | echo "Architectures: amd64 armel" >> $SOURCES |
448c38bd DK |
61 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
62 | 'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 | |
b3501edb | 63 | 'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 |
448c38bd | 64 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris |
d2d68aaf | 65 | |
4194c9ae | 66 | |
f74a6fa1 DK |
67 | msgtest 'Test old-style sources.list file which has' 'malformed dist' |
68 | echo "deb http://ftp.debian.org" > $SOURCES | |
69 | testequal --nomsg "E: Malformed line 1 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (dist) | |
4194c9ae MV |
70 | E: The list of sources could not be read." aptget update --print-uris |
71 | ||
f74a6fa1 | 72 | msgtest 'Test deb822 sources.list file which has' 'malformed URI' |
7f316a3f | 73 | echo "Types: deb |
6c069a22 | 74 | Suites: stable |
4194c9ae | 75 | " > $SOURCES |
f74a6fa1 | 76 | testequal --nomsg "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse) |
4194c9ae | 77 | E: The list of sources could not be read." aptget update --print-uris |
e67b9a23 | 78 | |
7dd62ea9 MV |
79 | # with Enabled: false |
80 | echo "$BASE" > $SOURCES | |
81 | echo "Enabled: no" >> $SOURCES | |
82 | testempty aptget update --print-uris | |
75c10df1 MV |
83 | |
84 | # multiple URIs | |
f744c64c | 85 | msgtest 'Test deb822 sources.list file which has' 'Multiple URIs work' |
75c10df1 | 86 | echo "$BASE" | sed -e 's#http://ftp.debian.org/debian#http://ftp.debian.org/debian http://ftp.de.debian.org/debian#' > $SOURCES |
448c38bd DK |
87 | testequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp.de.debian.org_debian_dists_stable_InRelease 0 |
88 | '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 | |
b3501edb | 89 | '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 |
448c38bd | 90 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
b3501edb | 91 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
448c38bd | 92 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris |
7f316a3f MV |
93 | |
94 | # multiple Type in one field | |
f744c64c | 95 | msgtest 'Test deb822 sources.list file which has' 'Multiple Types work' |
7f316a3f | 96 | echo "$BASE" | sed -e 's#Types: deb#Types: deb deb-src#' > $SOURCES |
448c38bd DK |
97 | testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 |
98 | 'http://ftp.debian.org/debian/dists/stable/main/source/Sources.bz2' ftp.debian.org_debian_dists_stable_main_source_Sources 0 | |
b3501edb | 99 | 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 |
448c38bd | 100 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris |
6f43fac6 MV |
101 | |
102 | # a Suite | |
103 | msgtest 'Test deb822 sources.list file which has' 'a exact path and no sections' | |
104 | cat > $SOURCES <<EOF | |
105 | Types: deb | |
106 | URIs: http://emacs.naquadah.org | |
107 | Suites: stable/ | |
108 | EOF | |
448c38bd DK |
109 | testequal --nomsg "'http://emacs.naquadah.org/stable/InRelease' emacs.naquadah.org_stable_InRelease 0 |
110 | 'http://emacs.naquadah.org/stable/Packages.bz2' emacs.naquadah.org_stable_Packages 0 | |
111 | 'http://emacs.naquadah.org/stable/en.bz2' emacs.naquadah.org_stable_en 0 " aptget update --print-uris |