summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/integration/exploid-keyring-with-dupe-keys.pubbin0 -> 3986 bytes
-rw-r--r--test/integration/exploid-keyring-with-dupe-subkeys.pubbin0 -> 2016 bytes
-rw-r--r--test/integration/framework5
-rwxr-xr-xtest/integration/test-apt-key-net-update95
-rwxr-xr-xtest/integration/test-architecture-specification-parsing15
-rwxr-xr-xtest/integration/test-bug-632221-cross-dependency-satisfaction3
-rwxr-xr-xtest/integration/test-bug-666772-multiarch-arch-all-build-deps118
-rwxr-xr-xtest/integration/test-bug-679371-apt-get-autoclean-multiarch24
-rwxr-xr-xtest/integration/test-bug-680041-apt-mark-holds-correctly72
-rwxr-xr-xtest/integration/test-bug-683786-build-dep-on-virtual-packages81
-rwxr-xr-xtest/integration/test-cachecontainer-architecture-specification36
-rwxr-xr-xtest/integration/test-specific-architecture-dependencies182
12 files changed, 629 insertions, 2 deletions
diff --git a/test/integration/exploid-keyring-with-dupe-keys.pub b/test/integration/exploid-keyring-with-dupe-keys.pub
new file mode 100644
index 000000000..642952a40
--- /dev/null
+++ b/test/integration/exploid-keyring-with-dupe-keys.pub
Binary files differ
diff --git a/test/integration/exploid-keyring-with-dupe-subkeys.pub b/test/integration/exploid-keyring-with-dupe-subkeys.pub
new file mode 100644
index 000000000..02d4e6ee8
--- /dev/null
+++ b/test/integration/exploid-keyring-with-dupe-subkeys.pub
Binary files differ
diff --git a/test/integration/framework b/test/integration/framework
index d15fd0e01..f7576668a 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -746,6 +746,11 @@ testfileequal() {
fi
}
+testempty() {
+ msgtest "Test for no output of" "$*"
+ test -z "$($* 2>&1)" && msgpass || msgfail
+}
+
testequal() {
local COMPAREFILE=$(mktemp)
addtrap "rm $COMPAREFILE;"
diff --git a/test/integration/test-apt-key-net-update b/test/integration/test-apt-key-net-update
new file mode 100755
index 000000000..d5205836f
--- /dev/null
+++ b/test/integration/test-apt-key-net-update
@@ -0,0 +1,95 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+# mock
+requires_root() {
+ return 0
+}
+
+# extract net_update() and import it
+func=$( sed -n -e '/^add_keys_with_verify_against_master_keyring/,/^}/p' ${BUILDDIRECTORY}/apt-key )
+eval "$func"
+
+mkdir -p ./etc/apt
+TRUSTEDFILE=./etc/apt/trusted.gpg
+mkdir -p ./var/lib/apt/keyrings
+TMP_KEYRING=./var/lib/apt/keyrings/maybe-import-keyring.gpg
+GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring"
+GPG="$GPG_CMD --keyring $TRUSTEDFILE"
+MASTER_KEYRING=/usr/share/keyrings/ubuntu-master-keyring.gpg
+
+
+msgtest "add_keys_with_verify_against_master_keyring"
+if [ ! -e $MASTER_KEYRING ]; then
+ echo -n "No $MASTER_KEYRING found"
+ msgskip
+ exit 0
+fi
+
+# test bad keyring and ensure its not added (LP: #857472)
+ADD_KEYRING=./keys/exploid-keyring-with-dupe-keys.pub
+if add_keys_with_verify_against_master_keyring $ADD_KEYRING $MASTER_KEYRING; then
+ msgfail
+else
+ msgpass
+fi
+
+# ensure the keyring is still empty
+gpg_out=$($GPG --list-keys)
+msgtest "Test if keyring is empty"
+if [ -n "" ]; then
+ msgfail
+else
+ msgpass
+fi
+
+
+# test another possible attack vector using subkeys (LP: #1013128)
+msgtest "add_keys_with_verify_against_master_keyring with subkey attack"
+ADD_KEYRING=./keys/exploid-keyring-with-dupe-subkeys.pub
+if add_keys_with_verify_against_master_keyring $ADD_KEYRING $MASTER_KEYRING; then
+ msgfail
+else
+ msgpass
+fi
+
+# ensure the keyring is still empty
+gpg_out=$($GPG --list-keys)
+msgtest "Test if keyring is empty"
+if [ -n "" ]; then
+ msgfail
+else
+ msgpass
+fi
+
+
+# test good keyring and ensure we get no errors
+ADD_KEYRING=/usr/share/keyrings/ubuntu-archive-keyring.gpg
+if add_keys_with_verify_against_master_keyring $ADD_KEYRING $MASTER_KEYRING; then
+ msgpass
+else
+ msgfail
+fi
+
+testequal './etc/apt/trusted.gpg
+---------------------
+pub 1024D/437D05B5 2004-09-12
+uid Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>
+sub 2048g/79164387 2004-09-12
+
+pub 1024D/FBB75451 2004-12-30
+uid Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com>
+
+pub 4096R/C0B21F32 2012-05-11
+uid Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>
+
+pub 4096R/EFE21092 2012-05-11
+uid Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>
+' $GPG --list-keys
+
diff --git a/test/integration/test-architecture-specification-parsing b/test/integration/test-architecture-specification-parsing
index 8f365dd55..2741509a7 100755
--- a/test/integration/test-architecture-specification-parsing
+++ b/test/integration/test-architecture-specification-parsing
@@ -4,7 +4,7 @@ set -e
TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
-configarchitecture 'amd64'
+configarchitecture 'amd64' 'armel'
buildsimplenativepackage 'pkg-arch-foo' 'amd64' '1.0' 'stable' 'Build-Depends: foo [amd64 !amd64]
Depends: foo [amd64 !amd64]'
@@ -14,6 +14,8 @@ buildsimplenativepackage 'pkg-arch-foo-unrelated-no' 'amd64' '1.0' 'stable' 'Bui
Depends: foo [!kfreebsd-any amd64]'
buildsimplenativepackage 'pkg-arch-foo-unrelated-no2' 'amd64' '1.0' 'stable' 'Build-Depends: foo [amd64 !kfreebsd-any]
Depends: foo [amd64 !kfreebsd-any]'
+buildsimplenativepackage 'no-depends' 'armel' '1.0' 'stable' 'Build-Depends: foo [armhf], bar [arm]
+Depends: foo [armhf], bar [arm]'
buildsimplenativepackage 'foo' 'amd64' '1.0' 'stable'
@@ -93,4 +95,15 @@ The following NEW packages will be installed:
Inst foo (1.0 stable [amd64])
Conf foo (1.0 stable [amd64])' aptget build-dep pkg-arch-foo-unrelated-no2 -s
+testequal 'Reading package lists...
+Building dependency tree...
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget build-dep no-depends -s
+# this is not really testing APT - more that dpkg is in line with us
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ no-depends:armel
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst no-depends:armel (1.0 stable [armel])
+Conf no-depends:armel (1.0 stable [armel])' aptget install no-depends -s
diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction
index 208c613a2..d90a103c9 100755
--- a/test/integration/test-bug-632221-cross-dependency-satisfaction
+++ b/test/integration/test-bug-632221-cross-dependency-satisfaction
@@ -21,7 +21,7 @@ insertpackage 'unstable' 'foreigner' 'amd64,armel' '1.0' 'Multi-Arch: foreign'
insertpackage 'unstable' 'arm-stuff' 'armel' '1.0'
insertpackage 'unstable' 'linux-stuff' 'amd64,armel' '1.0'
-insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev, arm-stuff [any-arm] | linux-stuff [ linux-any]'
+insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev, arm-stuff [any-armel] | linux-stuff [ linux-any]'
insertsource 'unstable' 'forbidden-none' 'any' '1' 'Build-Depends: amdboot:any'
insertsource 'unstable' 'forbidden-same' 'any' '1' 'Build-Depends: libc6:any'
@@ -63,6 +63,7 @@ Inst libc6 (1.0 unstable [amd64])
Inst specific (1.0 unstable [amd64])
Conf libc6 (1.0 unstable [amd64])
Conf specific (1.0 unstable [amd64])' aptget build-dep source-specific-amd64 -s -a armel
+
testequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
diff --git a/test/integration/test-bug-666772-multiarch-arch-all-build-deps b/test/integration/test-bug-666772-multiarch-arch-all-build-deps
new file mode 100755
index 000000000..cfae1fef3
--- /dev/null
+++ b/test/integration/test-bug-666772-multiarch-arch-all-build-deps
@@ -0,0 +1,118 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'armhf'
+
+insertinstalledpackage 'build-essential' 'all' '11.5'
+
+insertpackage 'unstable' 'doxygen' 'all' '1.0' 'Depends: language-support, language-tool'
+insertpackage 'unstable' 'libc6' 'amd64,armhf' '1.0' 'Multi-Arch: same'
+insertpackage 'unstable' 'libc6-dev' 'amd64,armhf' '1.0' 'Depends: libc6
+Multi-Arch: same'
+insertpackage 'unstable' 'language-support' 'amd64,armhf' '1.0' 'Multi-Arch: foreign'
+insertpackage 'unstable' 'language-tool' 'amd64,armhf' '1.0'
+
+insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ doxygen language-support language-tool libc6 libc6-dev
+0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
+Inst language-support (1.0 unstable [amd64])
+Inst language-tool (1.0 unstable [amd64])
+Inst doxygen (1.0 unstable [all])
+Inst libc6 (1.0 unstable [amd64])
+Inst libc6-dev (1.0 unstable [amd64])
+Conf language-support (1.0 unstable [amd64])
+Conf language-tool (1.0 unstable [amd64])
+Conf doxygen (1.0 unstable [all])
+Conf libc6 (1.0 unstable [amd64])
+Conf libc6-dev (1.0 unstable [amd64])' aptget build-dep apt -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ doxygen language-support language-tool libc6:armhf libc6-dev:armhf
+0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
+Inst language-support (1.0 unstable [amd64])
+Inst language-tool (1.0 unstable [amd64])
+Inst doxygen (1.0 unstable [all])
+Inst libc6:armhf (1.0 unstable [armhf])
+Inst libc6-dev:armhf (1.0 unstable [armhf])
+Conf language-support (1.0 unstable [amd64])
+Conf language-tool (1.0 unstable [amd64])
+Conf doxygen (1.0 unstable [all])
+Conf libc6:armhf (1.0 unstable [armhf])
+Conf libc6-dev:armhf (1.0 unstable [armhf])' aptget build-dep apt -s -a armhf
+
+configarchitecture 'armhf' 'amd64'
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ doxygen language-support language-tool libc6 libc6-dev
+0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
+Inst language-support (1.0 unstable [armhf])
+Inst language-tool (1.0 unstable [armhf])
+Inst doxygen (1.0 unstable [all])
+Inst libc6 (1.0 unstable [armhf])
+Inst libc6-dev (1.0 unstable [armhf])
+Conf language-support (1.0 unstable [armhf])
+Conf language-tool (1.0 unstable [armhf])
+Conf doxygen (1.0 unstable [all])
+Conf libc6 (1.0 unstable [armhf])
+Conf libc6-dev (1.0 unstable [armhf])' aptget build-dep apt -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ doxygen language-support language-tool libc6:amd64 libc6-dev:amd64
+0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
+Inst language-support (1.0 unstable [armhf])
+Inst language-tool (1.0 unstable [armhf])
+Inst doxygen (1.0 unstable [all])
+Inst libc6:amd64 (1.0 unstable [amd64])
+Inst libc6-dev:amd64 (1.0 unstable [amd64])
+Conf language-support (1.0 unstable [armhf])
+Conf language-tool (1.0 unstable [armhf])
+Conf doxygen (1.0 unstable [all])
+Conf libc6:amd64 (1.0 unstable [amd64])
+Conf libc6-dev:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64
+
+configarchitecture 'amd64' 'armhf'
+
+insertinstalledpackage 'language-support' 'armhf' '0.5' 'Multi-Arch: foreign'
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ doxygen language-tool libc6 libc6-dev
+0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded.
+Inst language-tool (1.0 unstable [amd64])
+Inst doxygen (1.0 unstable [all])
+Inst libc6 (1.0 unstable [amd64])
+Inst libc6-dev (1.0 unstable [amd64])
+Conf language-tool (1.0 unstable [amd64])
+Conf doxygen (1.0 unstable [all])
+Conf libc6 (1.0 unstable [amd64])
+Conf libc6-dev (1.0 unstable [amd64])' aptget build-dep apt -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ doxygen language-tool libc6:armhf libc6-dev:armhf
+0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded.
+Inst language-tool (1.0 unstable [amd64])
+Inst doxygen (1.0 unstable [all])
+Inst libc6:armhf (1.0 unstable [armhf])
+Inst libc6-dev:armhf (1.0 unstable [armhf])
+Conf language-tool (1.0 unstable [amd64])
+Conf doxygen (1.0 unstable [all])
+Conf libc6:armhf (1.0 unstable [armhf])
+Conf libc6-dev:armhf (1.0 unstable [armhf])' aptget build-dep apt -s -a armhf
diff --git a/test/integration/test-bug-679371-apt-get-autoclean-multiarch b/test/integration/test-bug-679371-apt-get-autoclean-multiarch
new file mode 100755
index 000000000..ba6857b73
--- /dev/null
+++ b/test/integration/test-bug-679371-apt-get-autoclean-multiarch
@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+buildsimplenativepackage 'pkgall' 'all' '1' 'stable'
+buildsimplenativepackage 'pkgnative' 'amd64' '1' 'stable'
+buildsimplenativepackage 'pkgforeign' 'i386' '1' 'stable'
+
+setupaptarchive
+
+changetowebserver
+
+aptget update -qq
+aptget install pkgall pkgnative pkgforeign -y -qq > /dev/null
+
+testdpkginstalled pkgall pkgnative pkgforeign
+
+testequal 'Reading package lists...
+Building dependency tree...
+Reading state information...' aptget autoclean -s
diff --git a/test/integration/test-bug-680041-apt-mark-holds-correctly b/test/integration/test-bug-680041-apt-mark-holds-correctly
new file mode 100755
index 000000000..2e5e39c8e
--- /dev/null
+++ b/test/integration/test-bug-680041-apt-mark-holds-correctly
@@ -0,0 +1,72 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'pkgarch' 'amd64' '1'
+insertinstalledpackage 'pkgall' 'all' '1'
+
+insertpackage 'unstable' 'pkgarch' 'amd64' '2'
+insertpackage 'unstable' 'pkgall' 'all' '2'
+
+setupaptarchive
+
+runtests() {
+ testempty aptmark showhold
+
+ testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be upgraded:
+ pkgall pkgarch
+2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+After this operation, 0 B of additional disk space will be used.
+E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only
+
+ testequal 'pkgarch set on hold.' aptmark hold pkgarch
+ testequal 'pkgarch' aptmark showhold
+
+ testequal 'Reading package lists...
+Building dependency tree...
+The following packages have been kept back:
+ pkgarch
+The following packages will be upgraded:
+ pkgall
+1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
+After this operation, 0 B of additional disk space will be used.
+E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only
+
+ testequal 'Canceled hold on pkgarch.' aptmark unhold pkgarch
+ testempty aptmark showhold
+
+ testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be upgraded:
+ pkgall pkgarch
+2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+After this operation, 0 B of additional disk space will be used.
+E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only
+
+ testequal 'pkgall set on hold.' aptmark hold pkgall
+ testequal 'pkgall' aptmark showhold
+
+ testequal 'Reading package lists...
+Building dependency tree...
+The following packages have been kept back:
+ pkgall
+The following packages will be upgraded:
+ pkgarch
+1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
+After this operation, 0 B of additional disk space will be used.
+E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only
+
+ testequal 'Canceled hold on pkgall.' aptmark unhold pkgall
+ testempty aptmark showhold
+}
+# single-arch
+runtests
+# multi-arch
+configarchitecture 'amd64' 'i386'
+runtests
diff --git a/test/integration/test-bug-683786-build-dep-on-virtual-packages b/test/integration/test-bug-683786-build-dep-on-virtual-packages
new file mode 100755
index 000000000..879d6a3bc
--- /dev/null
+++ b/test/integration/test-bug-683786-build-dep-on-virtual-packages
@@ -0,0 +1,81 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'armel'
+
+insertinstalledpackage 'build-essential' 'all' '11.5' 'Multi-Arch: foreign'
+
+insertpackage 'unstable' 'po-debconf' 'all' '1'
+insertsource 'unstable' 'dash' 'any' '1' 'Build-Depends: po-debconf'
+insertpackage 'unstable' 'make-po-debconf-pure-virtual' 'armel' '1' 'Depends: po-debconf'
+
+insertpackage 'unstable' 'po-debconf' 'amd64' '1'
+insertsource 'unstable' 'diffutils' 'any' '1' 'Build-Depends: texi2html'
+
+insertpackage 'unstable' 'libselinux1-dev' 'amd64' '1' 'Provides: libselinux-dev'
+insertsource 'unstable' 'sed' 'any' '1' 'Build-Depends: libselinux-dev'
+
+insertpackage 'unstable' 'libsehurd1-dev' 'amd64,armel' '1' 'Provides: libsehurd-dev'
+insertsource 'unstable' 'sed2' 'any' '1' 'Build-Depends: libsehurd-dev'
+
+setupaptarchive
+
+testequal 'Package: po-debconf:armel
+Versions:
+
+Reverse Depends:
+ make-po-debconf-pure-virtual:armel,po-debconf:armel
+Dependencies:
+Provides:
+Reverse Provides: ' aptcache showpkg po-debconf:armel
+testequal 'N: Unable to locate package texi2html' aptcache showpkg texi2html:armel -q=0
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ po-debconf
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst po-debconf (1 unstable, unstable [all])
+Conf po-debconf (1 unstable, unstable [all])' aptget build-dep dash -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+E: Build-Depends dependency for dash cannot be satisfied because the package po-debconf cannot be found' aptget build-dep -aarmel dash -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+E: Build-Depends dependency for diffutils cannot be satisfied because the package texi2html cannot be found' aptget build-dep -aarmel diffutils -s
+
+testequal "Reading package lists...
+Building dependency tree...
+Note, selecting 'libselinux1-dev' instead of 'libselinux-dev'
+The following NEW packages will be installed:
+ libselinux1-dev
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst libselinux1-dev (1 unstable [amd64])
+Conf libselinux1-dev (1 unstable [amd64])" aptget build-dep sed -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+E: Build-Depends dependency for sed cannot be satisfied because the package libselinux-dev cannot be found' aptget build-dep -aarmel sed -s
+
+testequal "Reading package lists...
+Building dependency tree...
+Note, selecting 'libsehurd1-dev' instead of 'libsehurd-dev'
+The following NEW packages will be installed:
+ libsehurd1-dev
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst libsehurd1-dev (1 unstable [amd64])
+Conf libsehurd1-dev (1 unstable [amd64])" aptget build-dep sed2 -s
+
+testequal "Reading package lists...
+Building dependency tree...
+Note, selecting 'libsehurd1-dev:armel' instead of 'libsehurd-dev:armel'
+The following NEW packages will be installed:
+ libsehurd1-dev:armel
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst libsehurd1-dev:armel (1 unstable [armel])
+Conf libsehurd1-dev:armel (1 unstable [armel])" aptget build-dep -aarmel sed2 -s
diff --git a/test/integration/test-cachecontainer-architecture-specification b/test/integration/test-cachecontainer-architecture-specification
index 174efb087..47abfb5b0 100755
--- a/test/integration/test-cachecontainer-architecture-specification
+++ b/test/integration/test-cachecontainer-architecture-specification
@@ -8,6 +8,7 @@ configarchitecture 'amd64' 'armel'
#insertinstalledpackage 'xserver-xorg-core' 'amd64' '2:1.7.6-2ubuntu7.10'
insertpackage 'unstable' 'libsame' 'armel,amd64' '1' 'Multi-Arch: same'
+insertpackage 'unstable' 'foo' 'all' '1'
setupaptarchive
@@ -27,6 +28,9 @@ Inst libsame:armel (1 unstable [armel])
Conf libsame:armel (1 unstable [armel])' aptget -s install libsame:armel
testequal 'Reading package lists...
Building dependency tree...
+E: Unable to locate package libsame' aptget -s install libsame:armhf
+testequal 'Reading package lists...
+Building dependency tree...
The following NEW packages will be installed:
libsame
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
@@ -85,3 +89,35 @@ Conf libsame:armel (1 unstable [armel])' aptget -s install libsame:linux-*
testequal 'Reading package lists...
Building dependency tree...
E: Unable to locate package libsame' aptget -s install libsame:windows-any
+
+testequal 'Reading package lists...
+Building dependency tree...
+E: Unable to locate package foo' aptget -s install foo:armel
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ foo
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1 unstable [all])
+Conf foo (1 unstable [all])' aptget -s install foo
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ foo
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1 unstable [all])
+Conf foo (1 unstable [all])' aptget -s install foo:all
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ foo
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1 unstable [all])
+Conf foo (1 unstable [all])' aptget -s install foo:amd64
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ foo
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1 unstable [all])
+Conf foo (1 unstable [all])' aptget -s install foo:native
diff --git a/test/integration/test-specific-architecture-dependencies b/test/integration/test-specific-architecture-dependencies
new file mode 100755
index 000000000..078a84654
--- /dev/null
+++ b/test/integration/test-specific-architecture-dependencies
@@ -0,0 +1,182 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertpackage 'unstable' 'libc6' 'amd64,i386' '1' 'Multi-Arch: same'
+insertinstalledpackage 'libold' 'amd64,i386' '1' 'Multi-Arch: same'
+insertinstalledpackage 'provider' 'amd64' '1' 'Provides: foo'
+
+insertpackage 'unstable' 'pre-depender' 'all' '1' 'Pre-Depends: libc6:i386'
+insertpackage 'unstable' 'depender' 'all' '1' 'Depends: libc6:i386'
+
+insertpackage 'unstable' 'breaker' 'all' '1' 'Breaks: libold (<< 2)'
+insertpackage 'unstable' 'breaker-x32' 'amd64' '1' 'Breaks: libold:i386 (<< 2)'
+insertpackage 'unstable' 'breaker-x64' 'i386' '1' 'Breaks: libold:amd64 (<< 2)'
+# conflicts with no effect
+insertpackage 'unstable' 'oldconflictor' 'all' '1' 'Conflicts: libold (<< 0)'
+insertpackage 'unstable' 'oldconflictor-x32' 'amd64' '1' 'Conflicts: libold:i386 (<< 0)'
+insertpackage 'unstable' 'oldconflictor-x64' 'i386' '1' 'Conflicts: libold:amd64 (<< 0)'
+
+insertpackage 'unstable' 'foo-depender' 'i386,amd64' '1' 'Depends: foo'
+insertpackage 'unstable' 'foo-foreign-depender' 'i386' '1' 'Depends: foo:amd64'
+
+insertpackage 'unstable' 'foo-conflictor' 'i386,amd64' '1' 'Conflicts: foo'
+insertpackage 'unstable' 'foo-foreign-conflictor' 'i386' '1' 'Conflicts: foo:amd64'
+insertpackage 'unstable' 'foo-no-conflictor' 'i386' '1' 'Conflicts: foo:i386'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ libc6:i386
+The following NEW packages will be installed:
+ libc6:i386 pre-depender
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libc6:i386 (1 unstable [i386])
+Conf libc6:i386 (1 unstable [i386])
+Inst pre-depender (1 unstable [all])
+Conf pre-depender (1 unstable [all])' aptget install pre-depender -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ libc6:i386
+The following NEW packages will be installed:
+ depender libc6:i386
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libc6:i386 (1 unstable [i386])
+Inst depender (1 unstable [all])
+Conf libc6:i386 (1 unstable [i386])
+Conf depender (1 unstable [all])' aptget install depender -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ libold libold:i386
+The following NEW packages will be installed:
+ breaker
+0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
+Remv libold [1]
+Remv libold:i386 [1]
+Inst breaker (1 unstable [all])
+Conf breaker (1 unstable [all])' aptget install breaker -s
+
+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, 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 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ libold
+The following NEW packages will be installed:
+ breaker-x64:i386
+0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Remv libold [1]
+Inst breaker-x64:i386 (1 unstable [i386])
+Conf breaker-x64:i386 (1 unstable [i386])' aptget install breaker-x64 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ oldconflictor
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst oldconflictor (1 unstable [all])
+Conf oldconflictor (1 unstable [all])' aptget install oldconflictor -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ oldconflictor-x32
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst oldconflictor-x32 (1 unstable [amd64])
+Conf oldconflictor-x32 (1 unstable [amd64])' aptget install oldconflictor-x32 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ oldconflictor-x64:i386
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst oldconflictor-x64:i386 (1 unstable [i386])
+Conf oldconflictor-x64:i386 (1 unstable [i386])' aptget install oldconflictor-x64 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ foo-depender
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst foo-depender (1 unstable [amd64])
+Conf foo-depender (1 unstable [amd64])' aptget install foo-depender -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+Some packages could not be installed. This may mean that you have
+requested an impossible situation or if you are using the unstable
+distribution that some required packages have not yet been created
+or been moved out of Incoming.
+The following information may help to resolve the situation:
+
+The following packages have unmet dependencies:
+ foo-depender:i386 : Depends: foo:i386 but it is not installable
+E: Unable to correct problems, you have held broken packages.' aptget install foo-depender:i386 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ foo-foreign-depender:i386
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst foo-foreign-depender:i386 (1 unstable [i386])
+Conf foo-foreign-depender:i386 (1 unstable [i386])' aptget install foo-foreign-depender:i386 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ provider
+The following NEW packages will be installed:
+ foo-conflictor
+0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Remv provider [1]
+Inst foo-conflictor (1 unstable [amd64])
+Conf foo-conflictor (1 unstable [amd64])' aptget install foo-conflictor -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ provider
+The following NEW packages will be installed:
+ foo-conflictor:i386
+0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Remv provider [1]
+Inst foo-conflictor:i386 (1 unstable [i386])
+Conf foo-conflictor:i386 (1 unstable [i386])' aptget install foo-conflictor:i386 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ provider
+The following NEW packages will be installed:
+ foo-foreign-conflictor:i386
+0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Remv provider [1]
+Inst foo-foreign-conflictor:i386 (1 unstable [i386])
+Conf foo-foreign-conflictor:i386 (1 unstable [i386])' aptget install foo-foreign-conflictor:i386 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ foo-no-conflictor:i386
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst foo-no-conflictor:i386 (1 unstable [i386])
+Conf foo-no-conflictor:i386 (1 unstable [i386])' aptget install foo-no-conflictor:i386 -s