]>
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 | |
f74a6fa1 DK |
10 | SOURCES='rootdir/etc/apt/sources.list' |
11 | BASE='# some comment | |
d2d68aaf MV |
12 | # that contains a : as well |
13 | #Type: meep | |
14 | ||
15 | Type: deb | |
866e9fad | 16 | URI: http://ftp.debian.org/debian |
6c069a22 MV |
17 | Suites: stable |
18 | Sections: main | |
a537ce19 | 19 | Comment: Some random string |
f74a6fa1 | 20 | that can be very long' |
a537ce19 | 21 | |
a537ce19 | 22 | |
f74a6fa1 DK |
23 | msgtest 'Test old-style sources.list' |
24 | echo "deb http://ftp.debian.org/debian stable main" > $SOURCES | |
25 | 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 : | |
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 | 28 | |
f74a6fa1 DK |
29 | msgtest 'Test simple deb822 sources.list' |
30 | echo "$BASE" > $SOURCES | |
31 | 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 : | |
32 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : | |
33 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris | |
300b15e3 | 34 | |
f74a6fa1 DK |
35 | |
36 | msgtest 'Test deb822 with two sections' 'seperated by comma' | |
2f0ae309 | 37 | echo "$BASE" | sed 's/main/main contrib/' > $SOURCES |
f74a6fa1 | 38 | 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 : |
300b15e3 MV |
39 | 'http://ftp.debian.org/debian/dists/stable/contrib/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_contrib_binary-i386_Packages 0 : |
40 | 'http://ftp.debian.org/debian/dists/stable/contrib/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_contrib_i18n_Translation-en 0 : | |
41 | '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 |
42 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris |
43 | ||
300b15e3 | 44 | |
f74a6fa1 | 45 | msgtest 'Test deb822 with' 'two entries' |
a537ce19 | 46 | # Two entries |
4194c9ae MV |
47 | echo "$BASE" > $SOURCES |
48 | echo "" >> $SOURCES | |
49 | echo "$BASE" | sed s/stable/unstable/ >> $SOURCES | |
f74a6fa1 | 50 | 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 : |
a537ce19 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 : | |
f74a6fa1 | 55 | 'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris |
a537ce19 | 56 | |
d73743dd | 57 | # two suite entries |
2f0ae309 | 58 | msgtest 'Test deb822 with' 'two Suite entries' |
d73743dd | 59 | echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES |
2f0ae309 | 60 | 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 : |
d73743dd 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 : | |
65 | 'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris | |
a537ce19 | 66 | |
f74a6fa1 | 67 | msgtest 'Test deb822' 'architecture option' |
4194c9ae | 68 | echo "$BASE" > $SOURCES |
41e6bd08 | 69 | echo "Architectures: amd64 armel" >> $SOURCES |
f74a6fa1 | 70 | testequal --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 |
71 | 'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 : |
72 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : | |
73 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris | |
d2d68aaf | 74 | |
4194c9ae | 75 | |
f74a6fa1 DK |
76 | msgtest 'Test old-style sources.list file which has' 'malformed dist' |
77 | echo "deb http://ftp.debian.org" > $SOURCES | |
78 | testequal --nomsg "E: Malformed line 1 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (dist) | |
4194c9ae MV |
79 | E: The list of sources could not be read." aptget update --print-uris |
80 | ||
f74a6fa1 DK |
81 | |
82 | msgtest 'Test deb822 sources.list file which has' 'malformed URI' | |
4194c9ae | 83 | echo "Type: deb |
6c069a22 | 84 | Suites: stable |
4194c9ae | 85 | " > $SOURCES |
f74a6fa1 | 86 | testequal --nomsg "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse) |
4194c9ae | 87 | E: The list of sources could not be read." aptget update --print-uris |