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