summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-09-04 14:56:01 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-09-04 14:56:01 +0200
commit85909fca550d03b0e215d16cdd701190b43ff63c (patch)
treeb6767be7b1898830499b0a5fb8153460223b5649 /test/integration
parentac5b5e826ab405935dc257c0a0984ae39b02bc23 (diff)
parent89e95aee05c7f2fde7eb11261df9697a4896b49b (diff)
merged sftp://bzr.debian.org/bzr/apt/apt/debian-sid
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/framework19
-rwxr-xr-xtest/integration/test-apt-cdrom104
-rwxr-xr-xtest/integration/test-unpack-different-version-unpacked121
3 files changed, 243 insertions, 1 deletions
diff --git a/test/integration/framework b/test/integration/framework
index c656157f2..bec321240 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -91,6 +91,7 @@ runapt() {
}
aptconfig() { runapt apt-config $*; }
aptcache() { runapt apt-cache $*; }
+aptcdrom() { runapt apt-cdrom $*; }
aptget() { runapt apt-get $*; }
aptftparchive() { runapt apt-ftparchive $*; }
aptkey() { runapt apt-key $*; }
@@ -523,11 +524,12 @@ insertinstalledpackage() {
local VERSION="$3"
local DEPENDENCIES="$4"
local PRIORITY="${5:-optional}"
+ local STATUS="${6:-install ok installed}"
local FILE='rootdir/var/lib/dpkg/status'
local INFO='rootdir/var/lib/dpkg/info'
for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do
echo "Package: $NAME
-Status: install ok installed
+Status: $STATUS
Priority: $PRIORITY
Section: other
Installed-Size: 42
@@ -724,6 +726,21 @@ server.stat-cache-engine = \"disable\"" > lighttpd.conf
return 0
}
+changetocdrom() {
+ mkdir -p rootdir/media/cdrom/.disk
+ local CD="$(readlink -f rootdir/media/cdrom)"
+ echo "acquire::cdrom::mount \"${CD}\";" > rootdir/etc/apt/apt.conf.d/00cdrom
+ echo 'acquire::cdrom::autodetect 0;' >> rootdir/etc/apt/apt.conf.d/00cdrom
+ echo -n "$1" > ${CD}/.disk/info
+ if [ ! -d aptarchive/dists ]; then
+ msgdie 'Flat file archive cdroms can not be created currently'
+ return 1
+ fi
+ mv aptarchive/dists $CD
+ ln -s "$(readlink -f ./incoming)" $CD/pool
+ find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list' -delete
+}
+
checkdiff() {
local DIFFTEXT="$($(which diff) -u $* | sed -e '/^---/ d' -e '/^+++/ d' -e '/^@@/ d')"
if [ -n "$DIFFTEXT" ]; then
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
diff --git a/test/integration/test-unpack-different-version-unpacked b/test/integration/test-unpack-different-version-unpacked
new file mode 100755
index 000000000..952f6e6b2
--- /dev/null
+++ b/test/integration/test-unpack-different-version-unpacked
@@ -0,0 +1,121 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertpackage 'unstable' 'libqtcore4' 'i386,amd64' '2' 'Multi-Arch: same'
+setupaptarchive
+
+DPKGSTATUS='rootdir/var/lib/dpkg/status'
+cp $DPKGSTATUS dpkg.status
+
+cleanstatus() {
+ cp dpkg.status $DPKGSTATUS
+ rm rootdir/var/cache/apt/*.bin
+}
+
+#FIXME: the reported version is wrong, it should be 1, not 2
+insertinstalledpackage 'libqtcore4' 'i386,amd64' '1' 'Multi-Arch: same' '' 'install ok unpacked'
+testequal 'Reading package lists...
+Building dependency tree...
+0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
+2 not fully installed or removed.
+Conf libqtcore4 (2 unstable [amd64])
+Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f
+
+cleanstatus
+insertinstalledpackage 'libqtcore4' 'amd64' '2' 'Multi-Arch: same' '' 'install ok unpacked'
+insertinstalledpackage 'libqtcore4' 'i386' '1' 'Multi-Arch: same' '' 'install ok unpacked'
+testequal 'Reading package lists...
+Building dependency tree...
+Correcting dependencies... Done
+The following extra packages will be installed:
+ libqtcore4:i386
+The following packages will be upgraded:
+ libqtcore4:i386
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+2 not fully installed or removed.
+Inst libqtcore4:i386 [1] (2 unstable [i386])
+Conf libqtcore4:i386 (2 unstable [i386])
+Conf libqtcore4 (2 unstable [amd64])' aptget install -s -f
+
+cleanstatus
+insertinstalledpackage 'libqtcore4' 'i386' '2' 'Multi-Arch: same' '' 'install ok unpacked'
+insertinstalledpackage 'libqtcore4' 'amd64' '1' 'Multi-Arch: same' '' 'install ok unpacked'
+testequal 'Reading package lists...
+Building dependency tree...
+Correcting dependencies... Done
+The following extra packages will be installed:
+ libqtcore4
+The following packages will be upgraded:
+ libqtcore4
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+2 not fully installed or removed.
+Inst libqtcore4 [1] (2 unstable [amd64])
+Conf libqtcore4 (2 unstable [amd64])
+Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f
+
+cleanstatus
+insertinstalledpackage 'libqtcore4' 'amd64' '2' 'Multi-Arch: same' '' 'install ok unpacked'
+insertinstalledpackage 'libqtcore4' 'i386' '1' 'Multi-Arch: same'
+testequal 'Reading package lists...
+Building dependency tree...
+Correcting dependencies... Done
+The following extra packages will be installed:
+ libqtcore4:i386
+The following packages will be upgraded:
+ libqtcore4:i386
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+1 not fully installed or removed.
+Inst libqtcore4:i386 [1] (2 unstable [i386])
+Conf libqtcore4:i386 (2 unstable [i386])
+Conf libqtcore4 (2 unstable [amd64])' aptget install -s -f
+
+cleanstatus
+insertinstalledpackage 'libqtcore4' 'i386' '2' 'Multi-Arch: same' '' 'install ok unpacked'
+insertinstalledpackage 'libqtcore4' 'amd64' '1' 'Multi-Arch: same'
+testequal 'Reading package lists...
+Building dependency tree...
+Correcting dependencies... Done
+The following extra packages will be installed:
+ libqtcore4
+The following packages will be upgraded:
+ libqtcore4
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+1 not fully installed or removed.
+Inst libqtcore4 [1] (2 unstable [amd64])
+Conf libqtcore4 (2 unstable [amd64])
+Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f
+
+cleanstatus
+insertinstalledpackage 'libqtcore4' 'amd64' '2' 'Multi-Arch: same'
+insertinstalledpackage 'libqtcore4' 'i386' '1' 'Multi-Arch: same' '' 'install ok unpacked'
+testequal 'Reading package lists...
+Building dependency tree...
+Correcting dependencies... Done
+The following extra packages will be installed:
+ libqtcore4:i386
+The following packages will be upgraded:
+ libqtcore4:i386
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+1 not fully installed or removed.
+Inst libqtcore4:i386 [1] (2 unstable [i386])
+Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f
+
+cleanstatus
+insertinstalledpackage 'libqtcore4' 'i386' '2' 'Multi-Arch: same'
+insertinstalledpackage 'libqtcore4' 'amd64' '1' 'Multi-Arch: same' '' 'install ok unpacked'
+testequal 'Reading package lists...
+Building dependency tree...
+Correcting dependencies... Done
+The following extra packages will be installed:
+ libqtcore4
+The following packages will be upgraded:
+ libqtcore4
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+1 not fully installed or removed.
+Inst libqtcore4 [1] (2 unstable [amd64])
+Conf libqtcore4 (2 unstable [amd64])' aptget install -s -f