summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/integration/framework9
-rwxr-xr-xtest/integration/run-tests2
-rwxr-xr-xtest/integration/test-apt-ftparchive-cachedb4
-rwxr-xr-xtest/integration/test-apt-ftparchive-src-cachedb10
-rwxr-xr-xtest/integration/test-bug-618288-multiarch-same-lockstep19
-rwxr-xr-xtest/integration/test-bug-673536-pre-depends-breaks-loop28
-rwxr-xr-xtest/integration/test-bug-745046-candidate-propagation-fails39
-rwxr-xr-xtest/integration/test-bug-747261-arch-specific-conflicts51
-rwxr-xr-xtest/integration/test-compressed-indexes2
-rwxr-xr-xtest/integration/test-conflicts-loop6
-rwxr-xr-xtest/integration/test-essential-force-loopbreak51
-rwxr-xr-xtest/integration/test-external-dependency-solver-protocol65
12 files changed, 259 insertions, 27 deletions
diff --git a/test/integration/framework b/test/integration/framework
index eda3cebad..7959699fd 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -36,7 +36,7 @@ msgndebug() { echo -n "${CDEBUG}D: $1${CNORMAL}"; }
msgtest() {
while [ -n "$1" ]; do
echo -n "${CINFO}$1${CCMD} "
- echo -n "$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} "
+ echo -n "$(echo "$2" | sed -e 's#^apt\([cgfs]\)#apt-\1#')${CINFO} "
shift
if [ -n "$1" ]; then shift; else break; fi
done
@@ -114,6 +114,7 @@ aptget() { runapt apt-get "$@"; }
aptftparchive() { runapt apt-ftparchive "$@"; }
aptkey() { runapt apt-key "$@"; }
aptmark() { runapt apt-mark "$@"; }
+aptsortpkgs() { runapt apt-sortpkgs "$@"; }
apt() { runapt apt "$@"; }
apthelper() { runapt "${APTHELPERBINDIR}/apt-helper" "$@"; }
aptwebserver() { runapt "${APTWEBSERVERBINDIR}/aptwebserver" "$@"; }
@@ -193,6 +194,12 @@ setupenvironment() {
touch var/lib/dpkg/available
mkdir -p usr/lib/apt
ln -s ${METHODSDIR} usr/lib/apt/methods
+ if [ "$BUILDDIRECTORY" = "$LIBRARYPATH" ]; then
+ mkdir -p usr/lib/apt/solvers
+ ln -s "${BUILDDIRECTORY}/apt-dump-solver" usr/lib/apt/solvers/dump
+ ln -s "${BUILDDIRECTORY}/apt-internal-solver" usr/lib/apt/solvers/apt
+ echo "Dir::Bin::Solvers \"${TMPWORKINGDIRECTORY}/rootdir/usr/lib/apt/solvers\";" > etc/apt/apt.conf.d/externalsolver.conf
+ fi
# use the autoremove from the BUILDDIRECTORY if its there, otherwise
# system
if [ -e ${BUILDDIRECTORY}/../../debian/apt.conf.autoremove ]; then
diff --git a/test/integration/run-tests b/test/integration/run-tests
index d700cc3fc..d39daeee5 100755
--- a/test/integration/run-tests
+++ b/test/integration/run-tests
@@ -39,7 +39,7 @@ fi
TOTAL="$(run-parts --list $DIR | grep '/test-' | wc -l)"
for testcase in $(run-parts --list $DIR | grep '/test-'); do
if [ "$MSGLEVEL" -le 2 ]; then
- echo -n "${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
+ echo -n "($(($ALL+1))/${TOTAL}) ${CTEST}Testcase ${CHIGH}$(basename ${testcase})${CRESET}: "
else
echo "${CTEST}Run Testcase ($(($ALL+1))/${TOTAL}) ${CHIGH}$(basename ${testcase})${CRESET}"
fi
diff --git a/test/integration/test-apt-ftparchive-cachedb b/test/integration/test-apt-ftparchive-cachedb
index 147272a2c..0e1986bcd 100755
--- a/test/integration/test-apt-ftparchive-cachedb
+++ b/test/integration/test-apt-ftparchive-cachedb
@@ -5,7 +5,7 @@ ensure_correct_packages_file() {
testequal "Package: foo
Priority: optional
Section: others
-Installed-Size: 29
+$(dpkg-deb -I ./aptarchive/pool/main/foo_1_i386.deb | grep 'Installed-Size:' | sed 's#^ ##')
Maintainer: Joe Sixpack <joe@example.org>
Architecture: i386
Version: 1
@@ -25,7 +25,7 @@ usr/share/doc/foo/copyright others/foo" cat ./aptarchive/dists/test/Conte
TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
-configarchitecture "i386"
+configarchitecture 'i386'
mkdir -p aptarchive/dists/test/main/i18n/
mkdir -p aptarchive/dists/test/main/source/
diff --git a/test/integration/test-apt-ftparchive-src-cachedb b/test/integration/test-apt-ftparchive-src-cachedb
index 1af193632..adcca6217 100755
--- a/test/integration/test-apt-ftparchive-src-cachedb
+++ b/test/integration/test-apt-ftparchive-src-cachedb
@@ -3,9 +3,9 @@ set -e
assert_correct_sources_file() {
testequal "Package: bar
-Binary: bar
-Version: 1.0
Architecture: all
+Version: 1.0
+Binary: bar
Format: 3.0 (native)
Directory: pool/main
Files:
@@ -24,9 +24,9 @@ Checksums-Sha512:
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 bar_1.0.tar.gz
Package: foo
-Binary: foo
-Version: 1.0
Architecture: all
+Version: 1.0
+Binary: foo
Format: 3.0 (native)
Directory: pool/main
Files:
@@ -43,7 +43,7 @@ Checksums-Sha256:
Checksums-Sha512:
3da0240fd764657c2f3661b4d750578a9a99b0580591b133756379d48117ebda87a5ed2467f513200d6e7eaf51422cbe91c15720eef7fb4bba2cc8ff81ebc547 171 foo_1.0.dsc
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e 0 foo_1.0.tar.gz
-" cat ./aptarchive/dists/test/main/source/Sources
+" aptsortpkgs ./aptarchive/dists/test/main/source/Sources
}
create_source_files() {
diff --git a/test/integration/test-bug-618288-multiarch-same-lockstep b/test/integration/test-bug-618288-multiarch-same-lockstep
index e0305b64b..536124c2c 100755
--- a/test/integration/test-bug-618288-multiarch-same-lockstep
+++ b/test/integration/test-bug-618288-multiarch-same-lockstep
@@ -16,22 +16,23 @@ buildsimplenativepackage 'apt' 'i386' '2' 'unstable' 'Depends: libsame (= 2)' ''
buildsimplenativepackage 'apt2' 'amd64' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required'
setupaptarchive
-aptget dist-upgrade -s >output.apt 2>&1
+testsuccess aptget dist-upgrade -s -o Debug::pkgPackageManager=1
# order in switch libsame:{amd64,i386} are unpacked is irrelevant, as both are installed - but we need to do it together
-LS_U_AMD="$(grep -o -n '^Inst libsame ' output.apt | cut -d: -f1)"
-LS_U_INT="$(grep -o -n '^Inst libsame:i386 ' output.apt | cut -d: -f1)"
-LS_C_AMD="$(grep -o -n '^Conf libsame ' output.apt | cut -d: -f1)"
-LS_C_INT="$(grep -o -n '^Conf libsame:i386 ' output.apt | cut -d: -f1)"
+OUTPUT=rootdir/tmp/testsuccess.output
+LS_U_AMD="$(grep -o -n '^Inst libsame ' $OUTPUT | cut -d: -f1)"
+LS_U_INT="$(grep -o -n '^Inst libsame:i386 ' $OUTPUT | cut -d: -f1)"
+LS_C_AMD="$(grep -o -n '^Conf libsame ' $OUTPUT | cut -d: -f1)"
+LS_C_INT="$(grep -o -n '^Conf libsame:i386 ' $OUTPUT | cut -d: -f1)"
-msgtest 'Test if libsame:amd64 unpack before configure'
+msgtest 'Test if' 'libsame:amd64 unpack before configure'
test "$LS_U_AMD" -lt "$LS_C_AMD" && msgpass || msgfail
-msgtest 'Test if libsame:i386 unpack before configure'
+msgtest 'Test if' 'libsame:i386 unpack before configure'
test "$LS_U_INT" -lt "$LS_C_INT" && msgpass || msgfail
-msgtest 'Test if libsame:amd64 unpack is before libsame:i386 configure'
+msgtest 'Test if' 'libsame:amd64 unpack is before libsame:i386 configure'
test "$LS_U_AMD" -lt "$LS_C_INT" && msgpass || msgfail
-msgtest 'Test if libsame:i386 unpack is before libsame:amd64 configure'
+msgtest 'Test if' 'libsame:i386 unpack is before libsame:amd64 configure'
test "$LS_U_INT" -lt "$LS_C_AMD" && msgpass || msgfail
diff --git a/test/integration/test-bug-673536-pre-depends-breaks-loop b/test/integration/test-bug-673536-pre-depends-breaks-loop
index f6a90b21f..21bd5e065 100755
--- a/test/integration/test-bug-673536-pre-depends-breaks-loop
+++ b/test/integration/test-bug-673536-pre-depends-breaks-loop
@@ -6,18 +6,32 @@ TESTDIR=$(readlink -f $(dirname $0))
setupenvironment
configarchitecture 'native'
-buildsimplenativepackage 'basic' 'native' '1' 'stable'
+buildsimplenativepackage 'advanced' 'native' '1' 'stable'
+buildsimplenativepackage 'advanced' 'native' '2' 'unstable' 'Pre-Depends: basic'
buildsimplenativepackage 'basic' 'native' '2' 'unstable' 'Pre-Depends: common'
-buildsimplenativepackage 'common' 'native' '2' 'unstable' 'Breaks: basic (<= 1)'
+
+buildsimplenativepackage 'common' 'native' '2~conflict' 'unstable-conflict' 'Conflicts: advanced (<= 1)'
+buildsimplenativepackage 'common' 'native' '2~break' 'unstable-break' 'Conflicts: advanced (<= 1)'
setupaptarchive
# we check with 'real' packages here as the simulation reports a 'Conf broken'
# which is technical correct for the simulation, but testing errormsg is ugly
-testsuccess aptget install basic=1 -y
-testdpkginstalled basic
-testdpkgnotinstalled common
+cp -a rootdir/var/lib/dpkg/status dpkg.status.backup
+
+testloopbreak() {
+ cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
+ rm -f rootdir/var/lib/apt/extended_states
+
+
+ testsuccess aptget install advanced=1 -y -t "$1" -o Debug::pkgPackageManager=1
+ testdpkginstalled advanced
+ testdpkgnotinstalled basic common
+
+ testsuccess aptget dist-upgrade -y -t "$1" -o Debug::pkgPackageManager=1
+ testdpkginstalled advanced basic common
+}
-testsuccess aptget dist-upgrade -y
-testdpkginstalled basic common
+testloopbreak 'unstable-break'
+testloopbreak 'unstable-conflict'
diff --git a/test/integration/test-bug-745046-candidate-propagation-fails b/test/integration/test-bug-745046-candidate-propagation-fails
new file mode 100755
index 000000000..e4aa67a72
--- /dev/null
+++ b/test/integration/test-bug-745046-candidate-propagation-fails
@@ -0,0 +1,39 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'gedit' 'amd64' '1'
+
+insertpackage 'unstable' 'gedit' 'amd64' '1'
+insertpackage 'experimental' 'gedit' 'amd64' '2' 'Depends: common (>= 2)'
+
+setupaptarchive
+
+testequal "Reading package lists...
+Building dependency tree...
+Selected version '2' (experimental [amd64]) for 'gedit'
+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:
+ gedit : Depends: common (>= 2) but it is not installable
+E: Unable to correct problems, you have held broken packages." aptget install gedit/experimental -sq=0
+
+insertinstalledpackage 'common' 'amd64' '2'
+
+testequal "Reading package lists...
+Building dependency tree...
+Selected version '2' (experimental [amd64]) for 'gedit'
+The following packages will be upgraded:
+ gedit
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+Inst gedit [1] (2 experimental [amd64])
+Conf gedit (2 experimental [amd64])" aptget install gedit/experimental -sq=0
diff --git a/test/integration/test-bug-747261-arch-specific-conflicts b/test/integration/test-bug-747261-arch-specific-conflicts
new file mode 100755
index 000000000..be971b89e
--- /dev/null
+++ b/test/integration/test-bug-747261-arch-specific-conflicts
@@ -0,0 +1,51 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'sparc' 'armel'
+
+msgtest 'Check that dpkg supports' 'arch-specific dependencies'
+set +e
+# this fails always, the question is just how it fails
+dpkg-checkbuilddeps -d 'foobar:barfoo' /dev/null 2>/dev/null >/dev/null
+RETURNCODE=$?
+set -e
+if [ "$RETURNCODE" != '1' ]; then
+ dpkg-checkbuilddeps -d 'foobar:barfoo' /dev/null || true
+ echo "Command had returncode: $RETURNCODE"
+ msgskip
+ exit 0
+else
+ msgpass
+fi
+
+buildsimplenativepackage 'libc6' 'amd64,sparc,armel' '1' 'stable' 'Multi-Arch: same'
+buildsimplenativepackage 'libc6-i386' 'amd64' '1' 'stable' 'Conflicts: libc6:sparc'
+
+setupaptarchive
+
+testsuccess aptget install 'libc6:amd64' 'libc6:sparc' -y
+testdpkginstalled 'libc6:amd64' 'libc6:sparc'
+testdpkgnotinstalled 'libc6-i386' 'libc6:armel'
+
+testsuccess aptget install libc6-i386 -y
+testdpkginstalled 'libc6:amd64' 'libc6-i386'
+testdpkgnotinstalled 'libc6:sparc' 'libc6:armel'
+
+testsuccess aptget install libc6:armel -y
+testdpkginstalled 'libc6:amd64' 'libc6:armel' 'libc6-i386'
+testdpkgnotinstalled 'libc6:sparc'
+
+testsuccess aptget install libc6:sparc -y
+testdpkginstalled 'libc6:amd64' 'libc6:armel' 'libc6:sparc'
+testdpkgnotinstalled 'libc6-i386'
+
+testsuccess aptget purge 'libc6:*' 'libc6-i386' -y
+testdpkgnotinstalled 'libc6:amd64' 'libc6:armel' 'libc6:sparc' 'libc6-i386'
+
+# check that (the actually simpler) single arch is fine, too
+configarchitecture 'amd64'
+testfailure aptget install libc6:sparc -s
+testsuccess aptget install libc6 libc6-i386 -y
diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes
index 67ca0ba27..6671dd75a 100755
--- a/test/integration/test-compressed-indexes
+++ b/test/integration/test-compressed-indexes
@@ -67,6 +67,8 @@ testrun() {
msgtest "\tdsc file is present"; testsuccess --nomsg test -f testpkg_1.0.dsc
msgtest "\tdirectory is present"; testsuccess --nomsg test -d testpkg-1.0
rm -rf testpkg-1.0
+ testequal "$(aptcache show testpkg -o Acquire::Languages=none)
+" aptcache dumpavail
}
echo 'Acquire::GzipIndexes "false";' > rootdir/etc/apt/apt.conf.d/02compressindex
diff --git a/test/integration/test-conflicts-loop b/test/integration/test-conflicts-loop
index 4978fe1e8..a2c411aaf 100755
--- a/test/integration/test-conflicts-loop
+++ b/test/integration/test-conflicts-loop
@@ -20,11 +20,13 @@ Building dependency tree...
The following packages will be upgraded:
openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-Remv openjdk-6-jre [6b16-1.8-0ubuntu1]
+Remv openjdk-6-jre-headless [6b16-1.8-0ubuntu1]
Remv openjdk-6-jre-lib [6b16-1.8-0ubuntu1]
-Inst openjdk-6-jre-headless [6b16-1.8-0ubuntu1] (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
Inst openjdk-6-jre [6b16-1.8-0ubuntu1] (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
Inst openjdk-6-jre-lib [6b16-1.8-0ubuntu1] (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
Conf openjdk-6-jre-lib (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
Conf openjdk-6-jre (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
+Inst openjdk-6-jre-headless [6b16-1.8-0ubuntu1] (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])
Conf openjdk-6-jre-headless (6b20-1.9.8-0ubuntu1~10.04.1 unstable [i386])' aptget dist-upgrade -s -o APT::Immediate-Configure-All=true
+
+testsuccess aptget dist-upgrade -s -o Debug::pkgPackageManager=1
diff --git a/test/integration/test-essential-force-loopbreak b/test/integration/test-essential-force-loopbreak
new file mode 100755
index 000000000..d60c6cbd5
--- /dev/null
+++ b/test/integration/test-essential-force-loopbreak
@@ -0,0 +1,51 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'native'
+
+insertinstalledpackage 'sysvinit' 'native' '1' 'Essential: yes'
+
+buildsimplenativepackage 'sysvinit' 'native' '2' 'sid' 'Pre-Depends: sysvinit-core | systemd-sysv
+Essential: yes'
+buildsimplenativepackage 'sysvinit-core' 'native' '2' 'sid'
+
+buildsimplenativepackage 'systemd-sysv' 'native' '2~conflict' 'sid-conflict' 'Conflicts: sysvinit (<< 2)
+Breaks: sysvinit-core'
+
+buildsimplenativepackage 'systemd-sysv' 'native' '2~break' 'sid-break' 'Breaks: sysvinit (<< 2), sysvinit-core'
+
+setupaptarchive
+
+cp -a rootdir/var/lib/dpkg/status dpkg.status.backup
+
+testforcebreak() {
+ cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
+ rm -f rootdir/var/lib/apt/extended_states
+ testequal "Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ sysvinit
+The following NEW packages will be installed:
+ systemd-sysv
+The following packages will be upgraded:
+ sysvinit
+1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+E: This installation run will require temporarily removing the essential package sysvinit:$(getarchitecture 'native') due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option.
+E: Internal Error, Could not early remove sysvinit:amd64 (2)" aptget install systemd-sysv -t "$1" -s
+ # ensure that really nothing happens
+ testfailure aptget install systemd-sysv -y -t "$1" -o Debug::pkgPackageManager=1
+ testdpkginstalled 'sysvinit'
+ testdpkgnotinstalled 'systemd-sysv'
+
+ # with enough force however …
+ cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
+ testsuccess aptget install systemd-sysv -y -t "$1" -o Debug::pkgPackageManager=1 -o APT::Force-LoopBreak=1
+ testdpkginstalled 'sysvinit' 'systemd-sysv'
+}
+
+testforcebreak 'sid-conflict'
+testforcebreak 'sid-break'
diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol
new file mode 100755
index 000000000..129565993
--- /dev/null
+++ b/test/integration/test-external-dependency-solver-protocol
@@ -0,0 +1,65 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+insertinstalledpackage 'cool' 'all' '1'
+insertinstalledpackage 'stuff' 'all' '1'
+
+insertpackage 'unstable' 'cool' 'all' '2' 'Multi-Arch: foreign'
+insertpackage 'unstable' 'stuff' 'all' '2' 'Multi-Arch: foreign'
+insertpackage 'unstable' 'coolstuff' 'i386,amd64' '2' 'Depends: cool, stuff'
+insertpackage 'unstable' 'awesome' 'all' '2' 'Multi-Arch: foreign'
+insertpackage 'unstable' 'awesomecoolstuff' 'i386' '2' 'Depends: coolstuff, awesome'
+
+insertpackage 'experimental' 'cool' 'all' '3' 'Multi-Arch: foreign'
+insertpackage 'experimental' 'stuff' 'all' '3' 'Multi-Arch: foreign'
+insertpackage 'experimental' 'coolstuff' 'i386,amd64' '3' 'Depends: cool, stuff'
+
+setupaptarchive
+
+rm -f /tmp/dump.edsp
+testequal 'Reading package lists...
+Building dependency tree...
+Execute external solver...
+The solver encountered an error of type: ERR_JUST_DUMPING
+The following information might help you to understand what is wrong:
+I am too dumb, i can just dump!
+Please use one of my friends instead!
+
+E: External solver failed with: I am too dumb, i can just dump!' aptget install --solver dump coolstuff -s
+testsuccess test -s /tmp/dump.edsp
+rm -f /tmp/dump.edsp
+
+#FIXME: this should be unstable, but we don't support pinning yet
+testequal 'Reading package lists...
+Building dependency tree...
+Execute external solver...
+The following NEW packages will be installed:
+ coolstuff
+0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
+Inst coolstuff (3 experimental [amd64])
+Conf coolstuff (3 experimental [amd64])' aptget install --solver apt coolstuff -s
+
+testsuccess aptget install awesomecoolstuff:i386 -s
+testsuccess aptget install --solver apt awesomecoolstuff:i386 -s
+
+rm -f /tmp/dump.edsp
+testfailure aptget install --solver dump awesomecoolstuff:i386 -s
+testsuccess test -s /tmp/dump.edsp
+
+configarchitecture 'armel'
+msgtest 'Test direct calling is okay for' 'apt-internal-solver'
+cat /tmp/dump.edsp | runapt apt-internal-solver > solver.result 2>&1 || true
+if [ "$(tail -n2 solver.result | head -n1 )" = "Message: Done" ]; then
+ msgpass
+else
+ cat solver.result
+ msgfail
+fi
+rm -f /tmp/dump.edsp
+
+testfailure aptget install --solver apt awesomecoolstuff:i386 -s