summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/framework12
-rwxr-xr-xtest/integration/test-bug-686346-package-missing-architecture109
-rwxr-xr-xtest/integration/test-conflicts-real-multiarch-same50
3 files changed, 165 insertions, 6 deletions
diff --git a/test/integration/framework b/test/integration/framework
index bec321240..11f1c7be2 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -468,7 +468,7 @@ insertpackage() {
local PRIORITY="${6:-optional}"
local ARCHS=""
for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do
- if [ "$arch" = "all" ]; then
+ if [ "$arch" = 'all' -o "$arch" = 'none' ]; then
ARCHS="$(getarchitectures)"
else
ARCHS="$arch"
@@ -482,9 +482,9 @@ insertpackage() {
Priority: $PRIORITY
Section: other
Installed-Size: 42
-Maintainer: Joe Sixpack <joe@example.org>
-Architecture: $arch
-Version: $VERSION
+Maintainer: Joe Sixpack <joe@example.org>" >> $FILE
+ test "$arch" = 'none' || echo "Architecture: $arch" >> $FILE
+ echo "Version: $VERSION
Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb" >> $FILE
test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
@@ -534,8 +534,8 @@ Priority: $PRIORITY
Section: other
Installed-Size: 42
Maintainer: Joe Sixpack <joe@example.org>
-Architecture: $arch
Version: $VERSION" >> $FILE
+ test "$arch" = 'none' || echo "Architecture: $arch" >> $FILE
test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
echo "Description: an autogenerated dummy ${NAME}=${VERSION}/installed
If you find such a package installed on your system,
@@ -828,7 +828,7 @@ testnopackage() {
testdpkginstalled() {
msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
- local PKGS="$(dpkg -l $* | grep '^i' | wc -l)"
+ local PKGS="$(dpkg -l $* 2>/dev/null | grep '^i' | wc -l)"
if [ "$PKGS" != $# ]; then
echo $PKGS
dpkg -l $* | grep '^[a-z]'
diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture
new file mode 100755
index 000000000..b2c9ec9ee
--- /dev/null
+++ b/test/integration/test-bug-686346-package-missing-architecture
@@ -0,0 +1,109 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'pkgb' 'none' '1'
+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
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ pkgb:none
+The following NEW packages will be installed:
+ pkgc
+0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Remv pkgb:none [1]
+Inst pkgc (1 unstable [amd64])
+Conf pkgc (1 unstable [amd64])' aptget install pkgc -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ pkgb
+The following packages will be REMOVED:
+ pkgb:none
+The following NEW packages will be installed:
+ pkga pkgb
+0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
+Remv pkgb:none [1]
+Inst pkgb (2 unstable [amd64])
+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 …
+testequal 'Reading package lists...
+Building dependency tree...
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade -s
+
+# pkgd has no update with an architecture
+testdpkginstalled pkgd
+msgtest 'Test apt-get purge' 'pkgd'
+aptget purge pkgd -y >/dev/null 2>&1 && msgpass || msgfail
+testdpkgnotinstalled pkgd
+
+# there is a pkgb with an architecture
+testdpkginstalled pkgb
+msgtest 'Test apt-get purge' 'pkgb:none'
+aptget purge pkgb:none -y >/dev/null 2>&1 && msgpass || msgfail
+testdpkgnotinstalled pkgb
+
+# check that dependencies are created after the none package exists in the cache
+rm rootdir/var/cache/apt/*.bin
+insertinstalledpackage 'pkgb' 'none' '1'
+insertinstalledpackage 'pkgf' 'none' '1' 'Conflicts: pkgb'
+insertinstalledpackage 'pkgg' 'amd64' '1' 'Conflicts: pkgb'
+insertinstalledpackage 'pkgb' 'amd64' '2'
+testequal "Reading package lists...
+Building dependency tree...
+Reading state information...
+You might want to run 'apt-get -f install' to correct these.
+The following packages have unmet dependencies:
+ pkgb : Conflicts: pkgb:none but 1 is installed
+ pkgb:none : Conflicts: pkgb but 2 is installed
+ pkgf:none : Conflicts: pkgb:none but 1 is installed
+ Conflicts: pkgb but 2 is installed
+ pkgg : Conflicts: pkgb but 2 is installed
+ Conflicts: pkgb:none but 1 is installed
+E: Unmet dependencies. Try using -f." aptget check
+
+# check that dependencies are generated for none-packages
+rm rootdir/var/lib/dpkg/status
+insertinstalledpackage 'pkgx' 'none' '1'
+insertinstalledpackage 'pkgy' 'none' '1' 'Depends: pkgz, pkgx (>= 1)'
+insertinstalledpackage 'pkgz' 'none' '1'
+testequal 'Reading package lists...
+Building dependency tree...
+Reading state information...
+The following packages will be REMOVED:
+ pkgx:none* pkgy:none*
+0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
+Purg pkgy:none [1]
+Purg pkgx:none [1]' aptget purge pkgx -s
+testequal 'Reading package lists...
+Building dependency tree...
+Reading state information...
+The following packages will be REMOVED:
+ pkgy:none* pkgz:none*
+0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
+Purg pkgy:none [1]
+Purg pkgz:none [1]' aptget purge pkgz -s
diff --git a/test/integration/test-conflicts-real-multiarch-same b/test/integration/test-conflicts-real-multiarch-same
new file mode 100755
index 000000000..d9111677c
--- /dev/null
+++ b/test/integration/test-conflicts-real-multiarch-same
@@ -0,0 +1,50 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertpackage 'unstable' 'virtual-provider' 'amd64,i386' '2' 'Provides: virtual
+Conflicts: virtual
+Multi-Arch: same'
+insertpackage 'unstable' 'real' 'amd64,i386' '2' 'Conflicts: real
+Multi-Arch: same'
+insertpackage 'unstable' 'real-provider' 'amd64,i386' '2' 'Provides: real-provider
+Conflicts: real-provider
+Multi-Arch: same'
+setupaptarchive
+
+testequal "Reading package lists...
+Building dependency tree...
+Note, selecting 'virtual-provider' instead of 'virtual'
+Note, selecting 'virtual-provider:i386' instead of 'virtual:i386'
+The following NEW packages will be installed:
+ virtual-provider virtual-provider:i386
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst virtual-provider (2 unstable [amd64])
+Inst virtual-provider:i386 (2 unstable [i386])
+Conf virtual-provider (2 unstable [amd64])
+Conf virtual-provider:i386 (2 unstable [i386])" aptget install virtual:* -s -q=0
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ real real:i386
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst real (2 unstable [amd64])
+Inst real:i386 (2 unstable [i386])
+Conf real (2 unstable [amd64])
+Conf real:i386 (2 unstable [i386])' aptget install real:* -s -q=0
+
+# ensure that we are not confused by the provides
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ real-provider real-provider:i386
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst real-provider (2 unstable [amd64])
+Inst real-provider:i386 (2 unstable [i386])
+Conf real-provider (2 unstable [amd64])
+Conf real-provider:i386 (2 unstable [i386])' aptget install real-provider:* -s -q=0