]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-cdrom
remove code duplication for Add & Ident in apt-cdrom
[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 26
1e071c30
DK
27aptcdromlog() {
28 rm -f rootdir/tmp/apt-cdrom.log
29 aptcdrom "$@" -o quiet=1 >rootdir/tmp/apt-cdrom.log 2>&1
30 sed -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' rootdir/tmp/apt-cdrom.log
31}
32
33testequal "Scanning disc for index files..
c45233ea
DK
34Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
35Found label 'Debian APT Testdisk 0.8.15'
36This disc is called:
37'Debian APT Testdisk 0.8.15'
38Writing new source list
39Source list entries for this disc are:
40deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
41deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
1e071c30
DK
42Repeat this process for the rest of the CDs in your set." aptcdromlog add -m
43
44testequal 'Stored label: Debian APT Testdisk 0.8.15' aptcdromlog ident -m
c45233ea
DK
45
46testequal 'Reading package lists...
47Building dependency tree...
48The following NEW packages will be installed:
49 testing
500 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
51Inst testing (0.8.15 stable [amd64])
52Conf testing (0.8.15 stable [amd64])' aptget install testing -s
53
54testequal 'Reading package lists...
55Building dependency tree...
56The following NEW packages will be installed:
57 testing:i386
580 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
59Inst testing:i386 (0.8.15 stable [i386])
60Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s
61
62# check Idempotence of apt-cdrom (and disabling of Translation dropping)
1e071c30 63testequal "Scanning disc for index files..
c45233ea
DK
64Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
65This disc is called:
66'Debian APT Testdisk 0.8.15'
67Writing new source list
68Source list entries for this disc are:
69deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
70deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
1e071c30 71Repeat this process for the rest of the CDs in your set." aptcdromlog add -m -o APT::CDROM::DropTranslation=0
c45233ea
DK
72
73# take Translations from previous runs as needed
1e071c30 74testequal "Scanning disc for index files..
c45233ea
DK
75Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
76This disc is called:
77'Debian APT Testdisk 0.8.15'
78Writing new source list
79Source list entries for this disc are:
80deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
81deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
1e071c30 82Repeat this process for the rest of the CDs in your set." aptcdromlog add -m
c45233ea
DK
83msgtest 'Test for the german description translation of' 'testing'
84aptcache show testing -o Acquire::Languages=de | grep -q '^Description-de: ' && msgpass || msgfail
85rm -rf rootdir/var/lib/apt/lists
86mkdir -p rootdir/var/lib/apt/lists/partial
1e071c30 87testequal "Scanning disc for index files..
c45233ea
DK
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
1e071c30 95Repeat this process for the rest of the CDs in your set." aptcdromlog add -m
c45233ea
DK
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