]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-cdrom
merge patch from Daniel Hartwig to Show a error message if {,dist-}upgrade is used...
[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
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 cat Translation-de | gzip > Translation-de.gz
22 cat Translation-de | bzip2 > Translation-de.bz2
23 cat Translation-de | xz --format=lzma > Translation-de.lzma
24 cat Translation-de | xz > Translation-de.xz
25 rm Translation-en Translation-de
26 cd - > /dev/null
27 addtrap "chmod -R +w $PWD/rootdir/media/cdrom/dists/;"
28 chmod -R -w rootdir/media/cdrom/dists
29
30 aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
31 sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
32 testfileequal apt-cdrom.log "Scanning disc for index files..
33 Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
34 Found label 'Debian APT Testdisk 0.8.15'
35 This disc is called:
36 'Debian APT Testdisk 0.8.15'
37 Writing new source list
38 Source list entries for this disc are:
39 deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
40 deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
41 Repeat this process for the rest of the CDs in your set."
42
43 testequal 'Reading package lists...
44 Building dependency tree...
45 The following NEW packages will be installed:
46 testing
47 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
48 Inst testing (0.8.15 stable [amd64])
49 Conf testing (0.8.15 stable [amd64])' aptget install testing -s
50
51 testequal 'Reading package lists...
52 Building dependency tree...
53 The following NEW packages will be installed:
54 testing:i386
55 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
56 Inst testing:i386 (0.8.15 stable [i386])
57 Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s
58
59 # check Idempotence of apt-cdrom (and disabling of Translation dropping)
60 aptcdrom add -m -o quiet=1 -o APT::CDROM::DropTranslation=0 > apt-cdrom.log 2>&1
61 sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
62 testfileequal apt-cdrom.log "Scanning disc for index files..
63 Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
64 This disc is called:
65 'Debian APT Testdisk 0.8.15'
66 Writing new source list
67 Source list entries for this disc are:
68 deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
69 deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
70 Repeat this process for the rest of the CDs in your set."
71
72 # take Translations from previous runs as needed
73 aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
74 sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
75 testfileequal apt-cdrom.log "Scanning disc for index files..
76 Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
77 This disc is called:
78 'Debian APT Testdisk 0.8.15'
79 Writing new source list
80 Source list entries for this disc are:
81 deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
82 deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
83 Repeat this process for the rest of the CDs in your set."
84 msgtest 'Test for the german description translation of' 'testing'
85 aptcache show testing -o Acquire::Languages=de | grep -q '^Description-de: ' && msgpass || msgfail
86 rm -rf rootdir/var/lib/apt/lists
87 mkdir -p rootdir/var/lib/apt/lists/partial
88 aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
89 sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
90 testfileequal apt-cdrom.log "Scanning disc for index files..
91 Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
92 This disc is called:
93 'Debian APT Testdisk 0.8.15'
94 Writing new source list
95 Source list entries for this disc are:
96 deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
97 deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
98 Repeat this process for the rest of the CDs in your set."
99 msgtest 'Test for the english description translation of' 'testing'
100 aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && msgpass || msgfail
101
102
103 # check that we really can install from a 'cdrom'
104 testdpkgnotinstalled testing
105 aptget install testing -y > /dev/null 2>&1
106 testdpkginstalled testing