summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-01-30 21:16:56 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-01-30 21:16:56 +0100
commitbdd64a80842fea20d69741cbc01f1929c51a6ed6 (patch)
treea4d680abe2d44987ee939daeb3f691570a2e2ad8 /test
parent6487ecc977eabcca059e4e7fd62545c9826282bd (diff)
parenta13554816fac2ab7c5e876355f7b929790722b2c (diff)
merged from lp:~mvo/apt/mvo (and lp:~donkult/apt/experimental)
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-bug-657695-resolver-breaks-on-virtuals51
-rwxr-xr-xtest/integration/test-ordering-ignore-not-matching-breaks56
-rwxr-xr-xtest/integration/test-ubuntu-bug-859188-multiarch-reinstall28
-rw-r--r--test/libapt/configuration_test.cc9
4 files changed, 144 insertions, 0 deletions
diff --git a/test/integration/test-bug-657695-resolver-breaks-on-virtuals b/test/integration/test-bug-657695-resolver-breaks-on-virtuals
new file mode 100755
index 000000000..e9b27cfcd
--- /dev/null
+++ b/test/integration/test-bug-657695-resolver-breaks-on-virtuals
@@ -0,0 +1,51 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'xserver-xorg-core' 'amd64' '2:1.7.6-2ubuntu7.10'
+for i in $(seq 1 50); do
+ insertinstalledpackage "xserver-xorg-video-driver$i" 'amd64' '1.0' 'Provides: xserver-xorg-video-6'
+done
+
+insertpackage 'unstable' 'xserver-xorg-core' 'amd64' '2:1.11.3-0ubuntu9' 'Breaks: xserver-xorg-video-6'
+
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ xserver-xorg-video-driver1 xserver-xorg-video-driver10
+ xserver-xorg-video-driver11 xserver-xorg-video-driver12
+ xserver-xorg-video-driver13 xserver-xorg-video-driver14
+ xserver-xorg-video-driver15 xserver-xorg-video-driver16
+ xserver-xorg-video-driver17 xserver-xorg-video-driver18
+ xserver-xorg-video-driver19 xserver-xorg-video-driver2
+ xserver-xorg-video-driver20 xserver-xorg-video-driver21
+ xserver-xorg-video-driver22 xserver-xorg-video-driver23
+ xserver-xorg-video-driver24 xserver-xorg-video-driver25
+ xserver-xorg-video-driver26 xserver-xorg-video-driver27
+ xserver-xorg-video-driver28 xserver-xorg-video-driver29
+ xserver-xorg-video-driver3 xserver-xorg-video-driver30
+ xserver-xorg-video-driver31 xserver-xorg-video-driver32
+ xserver-xorg-video-driver33 xserver-xorg-video-driver34
+ xserver-xorg-video-driver35 xserver-xorg-video-driver36
+ xserver-xorg-video-driver37 xserver-xorg-video-driver38
+ xserver-xorg-video-driver39 xserver-xorg-video-driver4
+ xserver-xorg-video-driver40 xserver-xorg-video-driver41
+ xserver-xorg-video-driver42 xserver-xorg-video-driver43
+ xserver-xorg-video-driver44 xserver-xorg-video-driver45
+ xserver-xorg-video-driver46 xserver-xorg-video-driver47
+ xserver-xorg-video-driver48 xserver-xorg-video-driver49
+ xserver-xorg-video-driver5 xserver-xorg-video-driver50
+ xserver-xorg-video-driver6 xserver-xorg-video-driver7
+ xserver-xorg-video-driver8 xserver-xorg-video-driver9
+The following packages will be upgraded:
+ xserver-xorg-core
+1 upgraded, 0 newly installed, 50 to remove and 0 not upgraded.
+After this operation, 2150 kB disk space will be freed.
+E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only
diff --git a/test/integration/test-ordering-ignore-not-matching-breaks b/test/integration/test-ordering-ignore-not-matching-breaks
new file mode 100755
index 000000000..c9fca4edf
--- /dev/null
+++ b/test/integration/test-ordering-ignore-not-matching-breaks
@@ -0,0 +1,56 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertpackage 'unstable-mp' 'crda' 'i386,amd64' '1.1.1-1ubuntu4mp' 'Provides: wireless-crda
+Multi-Arch: foreign'
+insertpackage 'unstable-m' 'crda' 'i386,amd64' '1.1.1-1ubuntu4m' 'Multi-Arch: foreign'
+insertpackage 'unstable-p' 'crda' 'i386,amd64' '1.1.1-1ubuntu4p' 'Provides: wireless-crda'
+insertpackage 'unstable' 'wireless-crda' 'i386,amd64' '1.16'
+
+
+insertinstalledpackage 'wireless-crda' 'amd64' '1.14'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ crda
+0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
+Inst crda (1.1.1-1ubuntu4m unstable-m [amd64])
+Conf crda (1.1.1-1ubuntu4m unstable-m [amd64])' aptget install crda -s -t unstable-m
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ crda
+0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
+Inst crda (1.1.1-1ubuntu4p unstable-p [amd64])
+Conf crda (1.1.1-1ubuntu4p unstable-p [amd64])' aptget install crda -s -t unstable-p
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ crda
+0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
+Inst crda (1.1.1-1ubuntu4mp unstable-mp [amd64])
+Conf crda (1.1.1-1ubuntu4mp unstable-mp [amd64])' aptget install crda -s -t unstable-mp
+
+rm rootdir/var/lib/dpkg/status
+insertinstalledpackage 'crda' 'amd64' '1.1.1-1ubuntu4mp' 'Provides: wireless-crda
+Conflicts: wireless-crda (<< 1.15)
+Replaces: wireless-crda ( << 1.15)
+Multi-arch: foreign'
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ wireless-crda
+0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
+Inst wireless-crda (1.16 unstable [amd64])
+Conf wireless-crda (1.16 unstable [amd64])' aptget install wireless-crda -s -t unstable
diff --git a/test/integration/test-ubuntu-bug-859188-multiarch-reinstall b/test/integration/test-ubuntu-bug-859188-multiarch-reinstall
new file mode 100755
index 000000000..0fdf97485
--- /dev/null
+++ b/test/integration/test-ubuntu-bug-859188-multiarch-reinstall
@@ -0,0 +1,28 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386' 'armel'
+
+buildsimplenativepackage 'libsame' 'amd64,i386,armel' '1.0' 'unstable' 'Multi-Arch: same'
+
+# FIXME: hack around dpkg's current inability to handle multiarch, a clean install would be better…
+insertinstalledpackage 'libsame' 'amd64,i386' '1.0' 'Multi-Arch: same'
+sed -e 's#/installed#/unstable#' -e 's#Installed-Size: 42#Installed-Size: 1#' -i rootdir/var/lib/dpkg/status
+
+setupaptarchive
+
+REINSTALL='Reading package lists...
+Building dependency tree...
+0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded.
+Inst libsame [1.0] (1.0 unstable [amd64])
+Inst libsame:i386 [1.0] (1.0 unstable [i386])
+Conf libsame (1.0 unstable [amd64])
+Conf libsame:i386 (1.0 unstable [i386])'
+
+testequal "$REINSTALL" aptget install --reinstall libsame -s
+testequal "$REINSTALL" aptget install --reinstall libsame:amd64 -s
+testequal "$REINSTALL" aptget install --reinstall libsame:i386 -s
+testequal "$REINSTALL" aptget install --reinstall libsame:amd64 libsame:i386 -s
diff --git a/test/libapt/configuration_test.cc b/test/libapt/configuration_test.cc
index 5b23d17fb..9a3e2c118 100644
--- a/test/libapt/configuration_test.cc
+++ b/test/libapt/configuration_test.cc
@@ -71,6 +71,15 @@ int main(int argc,const char *argv[]) {
equals(Cnf.Find("APT2::Version", "33"), "33");
equals(Cnf.FindI("APT2::Version", 33), 33);
+ equals(Cnf.FindFile("Dir::State"), "");
+ equals(Cnf.FindFile("Dir::Aptitude::State"), "");
+ Cnf.Set("Dir", "/srv/sid");
+ equals(Cnf.FindFile("Dir::State"), "");
+ Cnf.Set("Dir::State", "var/lib/apt");
+ Cnf.Set("Dir::Aptitude::State", "var/lib/aptitude");
+ equals(Cnf.FindFile("Dir::State"), "/srv/sid/var/lib/apt");
+ equals(Cnf.FindFile("Dir::Aptitude::State"), "/srv/sid/var/lib/aptitude");
+
//FIXME: Test for configuration file parsing;
// currently only integration/ tests test them implicitly