summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-cdrom
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-09-03 12:28:19 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-09-03 12:28:19 +0200
commitc45233eaf6d08bb6bb6e2dbb57c90a1d52ca9a43 (patch)
tree9a61b39514cffbd0ad1fd48edb278302f108a2cd /test/integration/test-apt-cdrom
parent12c7078f5098d7f26599a3761af9e24b392d9c1d (diff)
* apt-pkg/cdrom.cc:
- copy only configured translation files from a CD-ROM and not all available translation files preventing new installs with d-i from being initialized with all translations (Closes: #678227) - handle Components in the reduction for the source.list as multi-arch CDs otherwise create duplicated source entries (e.g. "wheezy main main")
Diffstat (limited to 'test/integration/test-apt-cdrom')
-rwxr-xr-xtest/integration/test-apt-cdrom104
1 files changed, 104 insertions, 0 deletions
diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom
new file mode 100755
index 000000000..f24c99b36
--- /dev/null
+++ b/test/integration/test-apt-cdrom
@@ -0,0 +1,104 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+buildsimplenativepackage 'testing' 'amd64,i386' '0.8.15' 'stable'
+setupaptarchive
+
+changetocdrom 'Debian APT Testdisk 0.8.15'
+
+# -de is not in the Release file, but picked up anyway for compatibility
+cd rootdir/media/cdrom/dists/stable/main/i18n
+sed -e '/^Description-en:/ d' -e '/^ / d' -e '/^$/ d' Translation-en > Translation-de
+echo 'Description-de: automatisch generiertes Testpaket testing=0.8.15/stable
+ Diese Pakete sind nur für das testen von APT gedacht,
+ sie erfüllen keinen Zweck auf einem normalen System…
+' >> Translation-de
+cat Translation-de | gzip > Translation-de.gz
+cat Translation-de | bzip2 > Translation-de.bz2
+cat Translation-de | xz --format=lzma > Translation-de.lzma
+cat Translation-de | xz > Translation-de.xz
+rm Translation-en Translation-de
+cd - > /dev/null
+
+aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
+sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
+testfileequal apt-cdrom.log "Scanning disc for index files..
+Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
+Found label 'Debian APT Testdisk 0.8.15'
+This disc is called:
+'Debian APT Testdisk 0.8.15'
+Writing new source list
+Source list entries for this disc are:
+deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
+deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
+Repeat this process for the rest of the CDs in your set."
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ testing
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst testing (0.8.15 stable [amd64])
+Conf testing (0.8.15 stable [amd64])' aptget install testing -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ testing:i386
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst testing:i386 (0.8.15 stable [i386])
+Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s
+
+# check Idempotence of apt-cdrom (and disabling of Translation dropping)
+aptcdrom add -m -o quiet=1 -o APT::CDROM::DropTranslation=0 > apt-cdrom.log 2>&1
+sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
+testfileequal apt-cdrom.log "Scanning disc for index files..
+Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
+This disc is called:
+'Debian APT Testdisk 0.8.15'
+Writing new source list
+Source list entries for this disc are:
+deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
+deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
+Repeat this process for the rest of the CDs in your set."
+
+# take Translations from previous runs as needed
+aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
+sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
+testfileequal apt-cdrom.log "Scanning disc for index files..
+Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
+This disc is called:
+'Debian APT Testdisk 0.8.15'
+Writing new source list
+Source list entries for this disc are:
+deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
+deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
+Repeat this process for the rest of the CDs in your set."
+msgtest 'Test for the german description translation of' 'testing'
+aptcache show testing -o Acquire::Languages=de | grep -q '^Description-de: ' && msgpass || msgfail
+rm -rf rootdir/var/lib/apt/lists
+mkdir -p rootdir/var/lib/apt/lists/partial
+aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
+sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
+testfileequal apt-cdrom.log "Scanning disc for index files..
+Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
+This disc is called:
+'Debian APT Testdisk 0.8.15'
+Writing new source list
+Source list entries for this disc are:
+deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
+deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
+Repeat this process for the rest of the CDs in your set."
+msgtest 'Test for the english description translation of' 'testing'
+aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && msgpass || msgfail
+
+
+# check that we really can install from a 'cdrom'
+testdpkgnotinstalled testing
+aptget install testing -y > /dev/null 2>&1
+testdpkginstalled testing