]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-cdrom
disable https->http redirects in libcurl
[apt.git] / test / integration / test-apt-cdrom
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6 setupenvironment
7 configarchitecture 'amd64' 'i386'
8
9 buildsimplenativepackage 'testing' 'amd64,i386' '0.8.15' 'stable'
10 setupaptarchive --no-update
11
12 changetocdrom 'Debian APT Testdisk 0.8.15'
13
14 # -de is not in the Release file, but picked up anyway for compatibility
15 cd rootdir/media/cdrom/dists/stable/main/i18n
16 sed -e '/^Description-en:/ d' -e '/^ / d' -e '/^$/ d' Translation-en > Translation-de
17 echo 'Description-de: automatisch generiertes Testpaket testing=0.8.15/stable
18 Diese Pakete sind nur für das testen von APT gedacht,
19 sie erfüllen keinen Zweck auf einem normalen System…
20 ' >> Translation-de
21 compressfile Translation-de
22 rm Translation-en Translation-de
23 cd - > /dev/null
24 addtrap 'prefix' "chmod -R +w $PWD/rootdir/media/cdrom/dists/;"
25 chmod -R -w rootdir/media/cdrom/dists
26
27 aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
28 sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
29 testfileequal apt-cdrom.log "Scanning disc for index files..
30 Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
31 Found label 'Debian APT Testdisk 0.8.15'
32 This disc is called:
33 'Debian APT Testdisk 0.8.15'
34 Writing new source list
35 Source list entries for this disc are:
36 deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
37 deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
38 Repeat this process for the rest of the CDs in your set."
39
40 testequal 'Reading package lists...
41 Building dependency tree...
42 The following NEW packages will be installed:
43 testing
44 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
45 Inst testing (0.8.15 stable [amd64])
46 Conf testing (0.8.15 stable [amd64])' aptget install testing -s
47
48 testequal 'Reading package lists...
49 Building dependency tree...
50 The following NEW packages will be installed:
51 testing:i386
52 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
53 Inst testing:i386 (0.8.15 stable [i386])
54 Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s
55
56 # check Idempotence of apt-cdrom (and disabling of Translation dropping)
57 aptcdrom add -m -o quiet=1 -o APT::CDROM::DropTranslation=0 > apt-cdrom.log 2>&1
58 sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
59 testfileequal apt-cdrom.log "Scanning disc for index files..
60 Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
61 This disc is called:
62 'Debian APT Testdisk 0.8.15'
63 Writing new source list
64 Source list entries for this disc are:
65 deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
66 deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
67 Repeat this process for the rest of the CDs in your set."
68
69 # take Translations from previous runs as needed
70 aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
71 sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
72 testfileequal apt-cdrom.log "Scanning disc for index files..
73 Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
74 This disc is called:
75 'Debian APT Testdisk 0.8.15'
76 Writing new source list
77 Source list entries for this disc are:
78 deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
79 deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
80 Repeat this process for the rest of the CDs in your set."
81 msgtest 'Test for the german description translation of' 'testing'
82 aptcache show testing -o Acquire::Languages=de | grep -q '^Description-de: ' && msgpass || msgfail
83 rm -rf rootdir/var/lib/apt/lists
84 mkdir -p rootdir/var/lib/apt/lists/partial
85 aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
86 sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
87 testfileequal apt-cdrom.log "Scanning disc for index files..
88 Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
89 This disc is called:
90 'Debian APT Testdisk 0.8.15'
91 Writing new source list
92 Source list entries for this disc are:
93 deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
94 deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
95 Repeat this process for the rest of the CDs in your set."
96 msgtest 'Test for the english description translation of' 'testing'
97 aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && msgpass || msgfail
98
99
100 # check that we really can install from a 'cdrom'
101 testdpkgnotinstalled testing
102 testsuccess aptget install testing -y
103 testdpkginstalled testing