summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/cachedb-lp1274466-old-format.dbbin0 -> 8192 bytes
-rw-r--r--test/integration/deb-lp1274466-cachedb.debbin0 -> 1270 bytes
-rw-r--r--test/integration/framework6
-rwxr-xr-xtest/integration/run-tests2
-rwxr-xr-xtest/integration/test-apt-ftparchive-cachedb-lp127446651
-rwxr-xr-xtest/integration/test-bug-745046-candidate-propagation-fails39
-rwxr-xr-xtest/integration/test-compressed-indexes2
-rwxr-xr-xtest/integration/test-essential-force-loopbreak18
-rwxr-xr-xtest/integration/test-external-dependency-solver-protocol65
9 files changed, 173 insertions, 10 deletions
diff --git a/test/integration/cachedb-lp1274466-old-format.db b/test/integration/cachedb-lp1274466-old-format.db
new file mode 100644
index 000000000..88da5f1ee
--- /dev/null
+++ b/test/integration/cachedb-lp1274466-old-format.db
Binary files differ
diff --git a/test/integration/deb-lp1274466-cachedb.deb b/test/integration/deb-lp1274466-cachedb.deb
new file mode 100644
index 000000000..43d7ee6f1
--- /dev/null
+++ b/test/integration/deb-lp1274466-cachedb.deb
Binary files differ
diff --git a/test/integration/framework b/test/integration/framework
index 4f0a69994..7959699fd 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -194,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-lp1274466 b/test/integration/test-apt-ftparchive-cachedb-lp1274466
new file mode 100755
index 000000000..211740a53
--- /dev/null
+++ b/test/integration/test-apt-ftparchive-cachedb-lp1274466
@@ -0,0 +1,51 @@
+#!/bin/sh
+set -e
+
+
+#
+# main()
+#
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+
+# gather the db and the deb, ensure mtime is not modfied as its saved in the DB
+cp -p $TESTDIR/deb-lp1274466-cachedb.deb foo_1_i386.deb
+cp $TESTDIR/cachedb-lp1274466-old-format.db old-format.db
+
+# verify that the format is different
+testsuccess aptftparchive --db new-format.db packages .
+db_dump new-format.db > new-format.dump
+db_dump old-format.db > old-format.dump
+testfailure diff -u old-format.dump new-format.dump
+
+# ensure the new format as the sha512
+testsuccess grep 7da58ff901a40ecf42a730dc33198b182e9ba9ec98799fc2c2b6fabeeee40cc12a0e7cadb4b66764235c56e1009dbfe8a9a566fb1eedf47a992d1fff2cc3332c new-format.dump
+# but the old format does not
+testfailure grep 7da58ff901a40ecf42a730dc33198b182e9ba9ec98799fc2c2b6fabeeee40cc12a0e7cadb4b66764235c56e1009dbfe8a9a566fb1eedf47a992d1fff2cc3332c old-format.dump
+
+# regression test for corruption with previous generation of cachedb
+testequal "Package: foo
+Priority: optional
+Section: others
+Installed-Size: 29
+Maintainer: Joe Sixpack <joe@example.org>
+Architecture: i386
+Version: 1
+Filename: ./foo_1_i386.deb
+Size: 1270
+MD5sum: 85d0e908c1a897700e2c5dea72d7e3c0
+SHA1: 858b09169032b7925a0e463f46b6634243fc40ce
+SHA256: 3750a2c9c6b5beee7f307564be3d51d3ec7cbb78fa4f0b47f84a7c41477bff59
+SHA512: 7da58ff901a40ecf42a730dc33198b182e9ba9ec98799fc2c2b6fabeeee40cc12a0e7cadb4b66764235c56e1009dbfe8a9a566fb1eedf47a992d1fff2cc3332c
+Description: an autogenerated dummy foo=1/test
+ If you find such a package installed on your system,
+ something went horribly wrong! They are autogenerated
+ und used only by testcases and surf no other proposeā€¦
+" aptftparchive --db old-format.db packages .
+
+# ensure that the db is updated
+db_dump old-format.db > old-format.dump
+testsuccess diff -u old-format.dump new-format.dump
+
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-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-essential-force-loopbreak b/test/integration/test-essential-force-loopbreak
index 842dce61c..d60c6cbd5 100755
--- a/test/integration/test-essential-force-loopbreak
+++ b/test/integration/test-essential-force-loopbreak
@@ -5,18 +5,18 @@ TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
-configarchitecture 'amd64'
+configarchitecture 'native'
-insertinstalledpackage 'sysvinit' 'amd64' '1' 'Essential: yes'
+insertinstalledpackage 'sysvinit' 'native' '1' 'Essential: yes'
-buildsimplenativepackage 'sysvinit' 'amd64' '2' 'sid' 'Pre-Depends: sysvinit-core | systemd-sysv
+buildsimplenativepackage 'sysvinit' 'native' '2' 'sid' 'Pre-Depends: sysvinit-core | systemd-sysv
Essential: yes'
-buildsimplenativepackage 'sysvinit-core' 'amd64' '2' 'sid'
+buildsimplenativepackage 'sysvinit-core' 'native' '2' 'sid'
-buildsimplenativepackage 'systemd-sysv' 'amd64' '2~conflict' 'sid-conflict' 'Conflicts: sysvinit (<< 2)
+buildsimplenativepackage 'systemd-sysv' 'native' '2~conflict' 'sid-conflict' 'Conflicts: sysvinit (<< 2)
Breaks: sysvinit-core'
-buildsimplenativepackage 'systemd-sysv' 'amd64' '2~break' 'sid-break' 'Breaks: sysvinit (<< 2), sysvinit-core'
+buildsimplenativepackage 'systemd-sysv' 'native' '2~break' 'sid-break' 'Breaks: sysvinit (<< 2), sysvinit-core'
setupaptarchive
@@ -25,7 +25,7 @@ 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...
+ testequal "Reading package lists...
Building dependency tree...
The following extra packages will be installed:
sysvinit
@@ -34,8 +34,8 @@ The following NEW packages will be installed:
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:amd64 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
+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'
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