summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-07-20 12:32:46 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-08-10 17:27:59 +0200
commit7f8c0eed6983db7b8959f1498fc8bc80c98d719e (patch)
treeafa7f6890867867cecbe84b4993d7d5026d79436 /test/integration
parent1d3eea5caf65aacd7f112d14030a0499f32b9c75 (diff)
parse packages from all architectures into the cache
Now that we can dynamically create dependencies and provides as needed rather than requiring to know with which architectures we will deal before running we can allow the listparser to parse all records rather than skipping records of "unknown" architectures. This can e.g. happen if a user has foreign architecture packages in his status file without dpkg knowing about this architecture (or apt configured in this way). A sideeffect is that now arch:all packages are (correctly) recorded as available from any Packages file, not just from the native one – which has its downsides for the resolver as mixed-arch source packages can appear in different architectures at different times, but that is the problem of the resolver and dealing with it in the parser is at best a hack (and also depends on a helpful repository). Another sideeffect is that his allows :none packages to appear in Packages files again as we don't do any kind of checks now, but given that they aren't really supported (anymore) by anyone we can live with that.
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/test-apt-cache3
-rwxr-xr-xtest/integration/test-bug-612958-use-dpkg-multiarch-config19
-rwxr-xr-xtest/integration/test-bug-686346-package-missing-architecture8
-rwxr-xr-xtest/integration/test-parse-all-archs-into-cache91
-rwxr-xr-xtest/integration/test-specific-architecture-dependencies6
5 files changed, 105 insertions, 22 deletions
diff --git a/test/integration/test-apt-cache b/test/integration/test-apt-cache
index 1d90eed5c..97d180a74 100755
--- a/test/integration/test-apt-cache
+++ b/test/integration/test-apt-cache
@@ -54,7 +54,8 @@ testsuccessequal 'bar' aptcache pkgnames bar
testsuccessequal 'fancy
foo' aptcache pkgnames f
-testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main amd64 Packages" aptcache madison foo
+testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main amd64 Packages
+ foo | 1 | file:$(readlink -f .)/aptarchive unstable/main i386 Packages" aptcache madison foo
### depends
diff --git a/test/integration/test-bug-612958-use-dpkg-multiarch-config b/test/integration/test-bug-612958-use-dpkg-multiarch-config
index 7bf5781e8..9556a5aef 100755
--- a/test/integration/test-bug-612958-use-dpkg-multiarch-config
+++ b/test/integration/test-bug-612958-use-dpkg-multiarch-config
@@ -5,22 +5,19 @@ TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture 'i386'
-setupaptarchive
-
-insertinstalledpackage 'libapt' 'i386' '1.0'
-insertinstalledpackage 'libapt' 'amd64' '1.0'
-insertinstalledpackage 'libapt' 'armel' '1.0'
testpass() {
- rm rootdir/var/cache/apt/*.bin
- msgtest 'Test architecture handling' "$1 with $2"
- testsuccess --nomsg aptcache show libapt:$2
+ msgtest 'Test architecture handling success' "$1 with $2"
+ rm -f archs.conf
+ aptconfig dump --no-empty --format='%V%n' APT::Architectures > archs.conf
+ testsuccess --nomsg grep "^$2\$" archs.conf
}
testfail() {
- rm rootdir/var/cache/apt/*.bin
- msgtest 'Test architecture handling' "$1 with $2"
- testfailure --nomsg aptcache show libapt:$2
+ msgtest 'Test architecture handling failure' "$1 with $2"
+ rm -f archs.conf
+ aptconfig dump --no-empty --format='%V%n' APT::Architectures > archs.conf
+ testfailure --nomsg grep "^$2\$" archs.conf
}
testpass 'no config' 'i386'
diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture
index d51bbabfe..dae0fa81d 100755
--- a/test/integration/test-bug-686346-package-missing-architecture
+++ b/test/integration/test-bug-686346-package-missing-architecture
@@ -11,7 +11,6 @@ insertinstalledpackage 'pkgd' 'none' '1'
insertpackage 'unstable' 'pkga' 'amd64' '2' 'Depends: pkgb'
insertpackage 'unstable' 'pkgb' 'amd64' '2'
insertpackage 'unstable' 'pkgc' 'amd64' '1' 'Conflicts: pkgb'
-insertpackage 'unstable' 'pkge' 'none' '1'
setupaptarchive
@@ -41,13 +40,6 @@ Inst pkga (2 unstable [amd64])
Conf pkgb (2 unstable [amd64])
Conf pkga (2 unstable [amd64])' aptget install pkga -s
-# ensure that arch-less stanzas from Packages files are ignored
-msgtest 'Package is distributed in the Packages files' 'pkge'
-grep -q 'Package: pkge' $(find aptarchive -name 'Packages') && msgpass || msgfail
-testnopackage pkge
-testnopackage pkge:none
-testnopackage pkge:*
-
# do not automatically change from none-arch to whatever-arch as
# this breaks other none packages and dpkg has this ruleset as
# this difference seems so important that it has to be maintained …
diff --git a/test/integration/test-parse-all-archs-into-cache b/test/integration/test-parse-all-archs-into-cache
new file mode 100755
index 000000000..f61862912
--- /dev/null
+++ b/test/integration/test-parse-all-archs-into-cache
@@ -0,0 +1,91 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'i386'
+
+insertpackage 'unstable' 'bar' 'i386' '1' 'Depends: foo'
+insertpackage 'unstable' 'foo' 'i386' '1' 'Multi-Arch: foreign
+Depends: libfoo1'
+insertpackage 'unstable' 'libfoo1' 'i386' '1' 'Multi-Arch: same'
+insertpackage 'experimental' 'foo' 'i386' '2' 'Multi-Arch: foreign
+Depends: libfoo1 (>= 2)'
+insertpackage 'experimental' 'libfoo1' 'i386' '2' 'Multi-Arch: same'
+
+# note: the system has amd64 not configured!
+insertinstalledpackage 'foo' 'amd64' '1' 'Multi-Arch: foreign
+Depends: libfoo1'
+
+setupaptarchive
+
+testfailureequal "Reading package lists...
+Building dependency tree...
+You might want to run 'apt-get -f install' to correct these.
+The following packages have unmet dependencies:
+ foo:amd64 : Depends: libfoo1:amd64 but it is not installable
+E: Unmet dependencies. Try using -f." aptget check -s
+
+insertinstalledpackage 'libfoo1' 'amd64' '1' 'Multi-Arch: same'
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...' aptget check -s
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ libfoo1
+The following packages will be REMOVED:
+ foo:amd64
+The following NEW packages will be installed:
+ foo libfoo1
+0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
+Remv foo:amd64 [1]
+Inst libfoo1 (1 unstable [i386])
+Inst foo (1 unstable [i386])
+Conf libfoo1 (1 unstable [i386])
+Conf foo (1 unstable [i386])' aptget install foo -s
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ libfoo1
+The following packages will be REMOVED:
+ foo:amd64 libfoo1:amd64
+The following NEW packages will be installed:
+ foo libfoo1
+0 upgraded, 2 newly installed, 2 to remove and 0 not upgraded.
+Remv foo:amd64 [1]
+Remv libfoo1:amd64 [1]
+Inst libfoo1 (2 experimental [i386])
+Inst foo (2 experimental [i386])
+Conf libfoo1 (2 experimental [i386])
+Conf foo (2 experimental [i386])' aptget install foo/experimental -s
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ foo libfoo1
+The following packages will be REMOVED:
+ foo:amd64
+The following NEW packages will be installed:
+ bar foo libfoo1
+0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
+Remv foo:amd64 [1]
+Inst libfoo1 (1 unstable [i386])
+Inst foo (1 unstable [i386])
+Inst bar (1 unstable [i386])
+Conf libfoo1 (1 unstable [i386])
+Conf foo (1 unstable [i386])
+Conf bar (1 unstable [i386])' aptget install bar -s
+
+configarchitecture 'i386' 'amd64'
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ bar
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst bar (1 unstable [i386])
+Conf bar (1 unstable [i386])' aptget install bar -s
diff --git a/test/integration/test-specific-architecture-dependencies b/test/integration/test-specific-architecture-dependencies
index 1c72d7b22..e3dfd0c2a 100755
--- a/test/integration/test-specific-architecture-dependencies
+++ b/test/integration/test-specific-architecture-dependencies
@@ -289,12 +289,14 @@ The following NEW packages will be installed:
Inst foo-native-depender (1 unstable [amd64])
Conf foo-native-depender (1 unstable [amd64])' aptget install foo-native-depender -s
-# libold:i386 is installed, but we don't see it as i386 isn't configured
testequal 'Reading package lists...
Building dependency tree...
+The following packages will be REMOVED:
+ libold:i386
The following NEW packages will be installed:
breaker-x32
-0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Remv libold:i386 [1]
Inst breaker-x32 (1 unstable [amd64])
Conf breaker-x32 (1 unstable [amd64])' aptget install breaker-x32:amd64 -s