diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:48:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:48:10 +0000 |
commit | 7f9ceaec776a597e9ff8451038d57dd75e1e6d18 (patch) | |
tree | 284aa831d7c1c097a28b9048e594e071efa8e65c /test | |
parent | Releasing progress-linux version 2.9.3-0.0~progress7.99u1. (diff) | |
download | apt-7f9ceaec776a597e9ff8451038d57dd75e1e6d18.tar.xz apt-7f9ceaec776a597e9ff8451038d57dd75e1e6d18.zip |
Merging upstream version 2.9.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
56 files changed, 752 insertions, 88 deletions
diff --git a/test/integration/framework b/test/integration/framework index 9cb4081..e13888d 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -19,6 +19,9 @@ while [ -n "$1" -a -z "$CHECK_ARGS" ]; do elif [ "$1" = '--level' ]; then export MSGLEVEL=$2 shift + elif [ "$1" = '--solver' ]; then + export APT_SOLVER=$2 + shift else echo >&2 "WARNING: Unknown parameter »$1« will be ignored" fi @@ -537,7 +540,10 @@ exec fakeroot gdb --quiet -ex run '${DPKG:-dpkg}' --args '${DPKG:-dpkg}' --root= EOF chmod +x "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/gdb-dpkg" echo "Dir::Bin::dpkg \"${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg\";" > rootdir/etc/apt/apt.conf.d/99dpkg - + # Set the solver for the test case. + if [ "$APT_SOLVER" ]; then + echo "APT::Solver \"$APT_SOLVER\";" >> aptconfig.conf + fi { echo 'quiet "0";' echo 'quiet::NoUpdate "true";' @@ -585,6 +591,9 @@ EOF # prefer our apt binaries over the system apt binaries export PATH="${APTCMDLINEBINDIR}:${PATH}:/usr/sbin:/sbin" } +allowremovemanual() { + echo 'APT::Solver::RemoveManual "true";' >> ${TMPWORKINGDIRECTORY}/rootdir/etc/apt/apt.conf.d/allow-remove-manual.conf +} getarchitecture() { if [ "$1" = "native" -o -z "$1" ]; then @@ -1550,12 +1559,22 @@ downloadfile() { fi } +cleanup_solver3_pipe() { + if [ "$APT_SOLVER" != "3.0" ]; then + cat + else + # FIXME: We do not have support for listing autoremovals yet. + # FIXME: Progress output is different + sed -e '/Solving dependencies\.\.\./ d' \ + -e "/no longer required[.:]$/,/^Use '.* autoremove'/ d" + fi +} cleanup_output() { cat "$1" | sed \ -e '/gpgv: WARNING: This key is not suitable for signing in --compliance=gnupg mode/ d' \ - -e '/...$/ d' \ -e '/^profiling:/ d' \ | sed -e '/\.\.\.profiling:/ {N;s#\.\.\.profiling:.*\n#...#g}' \ + | cleanup_solver3_pipe \ >"$2" } diff --git a/test/integration/run-tests b/test/integration/run-tests index c1cc780..3100e8e 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -22,6 +22,15 @@ while [ -n "$1" ]; do elif [ "$1" = '-j' ]; then APT_TEST_JOBS=$2 shift + elif [ "$1" = '--solver' ]; then + export APT_SOLVER="$2" + shift + elif [ "$1" = '--skip' ]; then + export APT_SKIP_TEST_FILE="$2" + shift + elif [ "$1" = '--only' ]; then + TESTLIST="$2" + shift elif [ -x "$1" ]; then TESTTORUN="$1" else @@ -52,14 +61,22 @@ if [ -n "$TESTTORUN" ]; then CURRENTTRAP="rm -f \"$OUTPUT\"; $CURRENTTRAP" trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM { - if [ "$MSGLEVEL" -le 1 ]; then + if [ "$APT_SKIP_TEST_FILE" ] && grep -qFx "${TESTTORUN##*/}" "$APT_SKIP_TEST_FILE"; then + if [ "$MSGLEVEL" -le 2 ]; then + printf "${CTEST}Skip Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}" + else + printf "${CTEST}Skip Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}\n" + fi + SKIP='yes' + elif [ "$MSGLEVEL" -le 1 ]; then printf "${TESTTORUN##*/}" elif [ "$MSGLEVEL" -le 2 ]; then printf "${CTEST}Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}: " else printf "${CTEST}Run Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}\n" fi - if ! "$TESTTORUN"; then + + if [ "$SKIP" != "yes" ] && ! "$TESTTORUN"; then FAIL='yes' if [ "$MSGLEVEL" -le 2 ]; then printf >&2 "\n${CHIGH}Running ${TESTTORUN##*/} -> FAILED${CRESET}\n" @@ -83,6 +100,9 @@ if [ -n "$TESTTORUN" ]; then stty sane || true cat >&2 "$OUTPUT" stty sane || true + if [ "$STATS_FILE" ]; then + flock "$STATS_FILE" -c "echo $TESTTORUN skip=${SKIP:-no} fail=${FAIL:-no} >> \"$STATS_FILE\"" + fi if [ "$FAIL" = 'yes' ]; then exit 1 else @@ -96,8 +116,15 @@ ALL=0 FAILED_TESTS="" DIR="$(readlink -f "$(dirname "$0")")" cd "$DIR" -TESTLIST="$(find . -mindepth 1 -maxdepth 1 -regex '^\./test-[^/]*$' | sort)" +if [ -e "$TESTLIST" ]; then + TESTLIST="$(sort < "$TESTLIST" | sed 's#^#./#')" +else + TESTLIST="$(find . -mindepth 1 -maxdepth 1 -regex '^\./test-[^/]*$' | sort)" +fi if [ -n "$APT_TEST_JOBS" ]; then + export STATS_FILE="$(mktemp)" + CURRENTTRAP="rm -f \"$STATS_FILE\"; $CURRENTTRAP" + trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM if [ "$MSGCOLOR" != 'NO' ]; then export MSGCOLOR='ALWAYS' fi @@ -107,7 +134,26 @@ if [ -n "$APT_TEST_JOBS" ]; then elif command -v parallel.moreutils >/dev/null 2>&1; then parallel=parallel.moreutils fi - exec $parallel -j "$APT_TEST_JOBS" "./$(basename "$0")" -- $(echo "$TESTLIST") + $parallel -j "$APT_TEST_JOBS" "./$(basename "$0")" -- $(echo "$TESTLIST") || true + ALL=$(wc -l < "$STATS_FILE") + SKIP=$(grep -c "skip=yes" "$STATS_FILE" || true) + PASS=$(grep -c "skip=no fail=no" "$STATS_FILE" || true) + FAIL=$(grep -c "fail=yes" "$STATS_FILE" || true) + PASSED_TESTS=$(awk '! /fail=yes/ {print $1}' < "$STATS_FILE" | cut -f2 -d/ | sort | xargs) + SKIPPED_TESTS=$(awk '/fail=skip/ {print $1}' < "$STATS_FILE" | cut -f2 -d/ | sort | xargs) + FAILED_TESTS=$(awk '/fail=yes/ {print $1}' < "$STATS_FILE" | cut -f2 -d/ | sort | xargs) + echo >&2 "Statistics: $ALL tests were run: $PASS successfully and $FAIL failed, $SKIP skipped" + if [ -n "$FAILED_TESTS" ]; then + if [ $PASS -lt $FAIL ]; then + echo >&2 "Passed tests: $PASSED_TESTS" + else + echo >&2 "Failed tests: $FAILED_TESTS" + fi + else + echo >&2 'All tests seem to have been run successfully. What could possibly go wrong?' + fi + # ensure we don't overflow + exit $((FAIL <= 255 ? FAIL : 255)) fi APT_TEST_SIGNINGHOME="$(mktemp --directory --tmpdir 'apt-key-signinghome.XXXXXXXXXX')" @@ -125,6 +171,10 @@ if [ "$MSGLEVEL" -le 1 ]; then printf "${CTEST}Running testcases${CRESET}: " fi for testcase in $TESTLIST; do + if [ "$APT_SKIP_TEST_FILE" ] && grep -qFx "${TESTTORUN##*/}" "$APT_SKIP_TEST_FILE"; then + printf "${CTEST}Skipping Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}\n" + continue + fi if [ "$MSGLEVEL" -le 1 ]; then printf "${testcase##*/}" elif [ "$MSGLEVEL" -le 2 ]; then diff --git a/test/integration/solver3.broken b/test/integration/solver3.broken new file mode 100644 index 0000000..75ddbe5 --- /dev/null +++ b/test/integration/solver3.broken @@ -0,0 +1,32 @@ +test-allow-scores-for-all-dependency-types +test-apt-get-autoremove +test-apt-get-autoremove-kernel-module-providers +test-apt-get-upgrade-by-source +test-apt-install-file-reltag +test-apt-install-order-matters-a-bit +test-apt-move-and-forget-manual-sections +test-apt-patterns +test-apt-source-and-build-dep +test-bug-470115-new-and-tighten-recommends +test-bug-602412-dequote-redirect +test-bug-611729-mark-as-manual +test-bug-675449-essential-are-protected +test-bug-709560-set-candidate-release +test-bug-745046-candidate-propagation-fails +test-bug-753297-upgradable +test-bug-767891-force-essential-important +test-bug-961266-hold-means-hold +test-dont-forget-conflicts-via-unknown-architectures +test-explore-or-groups-in-markinstall +test-external-dependency-solver-protocol +test-method-mirror +test-parse-all-archs-into-cache +test-phased-updates-new-depends +test-phased-updates-upgrade +test-prevent-markinstall-multiarch-same-versionscrew +test-release-candidate-switching +test-resolve-by-keep-new-recommends +test-ubuntu-bug-1304403-obsolete-priority-standard +test-ubuntu-bug-1990586 +test-ubuntu-bug-2025462-phased-dist-upgrade +test-ubuntu-bug-614993 diff --git a/test/integration/test-allow-scores-for-all-dependency-types b/test/integration/test-allow-scores-for-all-dependency-types index 0a527da..0d9ec6e 100755 --- a/test/integration/test-allow-scores-for-all-dependency-types +++ b/test/integration/test-allow-scores-for-all-dependency-types @@ -42,9 +42,13 @@ setupaptarchive insertinstalledpackage 'libdb-dev' 'amd64' '5.1.7' 'Depends: libdb5.1-dev' insertinstalledpackage 'libdb5.1-dev' 'amd64' '5.1.29-7' testsuccess aptmark auto ~i -testsuccessequal 'Reading package lists... +testsuccessequal "Reading package lists... Building dependency tree... +Reading state information... Calculating upgrade... +The following packages were automatically installed and are no longer required: + libdb-dev libdb5.3-dev +Use 'apt autoremove' to remove them. The following packages will be REMOVED: libdb5.1-dev The following NEW packages will be installed: @@ -56,10 +60,14 @@ Remv libdb5.1-dev [5.1.29-7] [libdb-dev:amd64 ] Inst libdb-dev [5.1.7] (5.3.0 unversioned [amd64]) [] Inst libdb5.3-dev (5.3.28-3 unversioned [amd64]) Conf libdb-dev (5.3.0 unversioned [amd64]) -Conf libdb5.3-dev (5.3.28-3 unversioned [amd64])' aptget dist-upgrade -st unversioned -testsuccessequal 'Reading package lists... +Conf libdb5.3-dev (5.3.28-3 unversioned [amd64])" aptget dist-upgrade -st unversioned +testsuccessequal "Reading package lists... Building dependency tree... +Reading state information... Calculating upgrade... +The following packages were automatically installed and are no longer required: + libdb-dev libdb5.3-dev +Use 'apt autoremove' to remove them. The following packages will be REMOVED: libdb5.1-dev The following NEW packages will be installed: @@ -71,33 +79,49 @@ Remv libdb5.1-dev [5.1.29-7] [libdb-dev:amd64 ] Inst libdb-dev [5.1.7] (5.3.0 versioned [amd64]) [] Inst libdb5.3-dev (5.3.28-3 versioned [amd64]) Conf libdb-dev (5.3.0 versioned [amd64]) -Conf libdb5.3-dev (5.3.28-3 versioned [amd64])' aptget dist-upgrade -st versioned +Conf libdb5.3-dev (5.3.28-3 versioned [amd64])" aptget dist-upgrade -st versioned rm -f rootdir/var/lib/dpkg/status insertinstalledpackage 'foo' 'amd64' '1' insertinstalledpackage 'bar' 'amd64' '1' testsuccess aptmark auto ~i -testsuccessequal 'Reading package lists... +testsuccessequal "Reading package lists... Building dependency tree... +Reading state information... Calculating upgrade... +The following packages were automatically installed and are no longer required: + bar foo +Use 'apt autoremove' to remove them. The following packages have been kept back: bar foo -0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st unversioned -testsuccessequal 'Reading package lists... +0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded." aptget dist-upgrade -st unversioned +testsuccessequal "Reading package lists... Building dependency tree... +Reading state information... Calculating upgrade... +The following packages were automatically installed and are no longer required: + bar foo +Use 'apt autoremove' to remove them. The following packages have been kept back: bar foo -0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st versioned -testsuccessequal 'Reading package lists... +0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded." aptget dist-upgrade -st versioned +testsuccessequal "Reading package lists... Building dependency tree... +Reading state information... Calculating upgrade... +The following packages were automatically installed and are no longer required: + bar foo +Use 'apt autoremove' to remove them. The following packages have been kept back: bar foo -0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st multipleno -testsuccessequal 'Reading package lists... +0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded." aptget dist-upgrade -st multipleno +testsuccessequal "Reading package lists... Building dependency tree... +Reading state information... Calculating upgrade... +The following package was automatically installed and is no longer required: + bar +Use 'apt autoremove' to remove it. The following packages will be REMOVED: foo The following packages will be upgraded: @@ -105,10 +129,11 @@ The following packages will be upgraded: 1 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. Remv foo [1] Inst bar [1] (2.2 multipleyes [amd64]) -Conf bar (2.2 multipleyes [amd64])' aptget dist-upgrade -st multipleyes +Conf bar (2.2 multipleyes [amd64])" aptget dist-upgrade -st multipleyes testsuccessequal 'Reading package lists... Building dependency tree... +Reading state information... The following NEW packages will be installed: baz 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. @@ -116,6 +141,7 @@ Inst baz (2 unversioned [amd64]) Conf baz (2 unversioned [amd64])' aptget install baz -st unversioned testsuccessequal 'Reading package lists... Building dependency tree... +Reading state information... The following additional packages will be installed: bar The following packages will be REMOVED: @@ -139,6 +165,7 @@ insertinstalledpackage 'libaudit0' 'amd64' '1' testsuccess aptmark auto ~i testsuccessequal 'Reading package lists... Building dependency tree... +Reading state information... Calculating upgrade... The following packages will be REMOVED: gdm3 libaudit0 diff --git a/test/integration/test-apt-get-autoremove-real-virtual-provider b/test/integration/test-apt-get-autoremove-real-virtual-provider index 4940ab5..d5438f8 100755 --- a/test/integration/test-apt-get-autoremove-real-virtual-provider +++ b/test/integration/test-apt-get-autoremove-real-virtual-provider @@ -26,7 +26,17 @@ testsuccess aptget check -s testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... +Solving dependencies... +The following packages will be REMOVED: + needs-provider1 needs-provider4 +0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. +Remv needs-provider1 [1] +Remv needs-provider4 [1]' aptget autoremove -s --solver 3.0 + +testsuccessequal 'Reading package lists... +Building dependency tree... +Reading state information... The following packages will be REMOVED: needs-provider4 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. -Remv needs-provider4 [1]' aptget autoremove -s +Remv needs-provider4 [1]' aptget autoremove -s --solver internal diff --git a/test/integration/test-apt-get-build-dep b/test/integration/test-apt-get-build-dep index 403de8f..f6158a1 100755 --- a/test/integration/test-apt-get-build-dep +++ b/test/integration/test-apt-get-build-dep @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' insertpackage 'stable' 'build-essential' 'i386' '1' diff --git a/test/integration/test-apt-get-build-dep-barbarian b/test/integration/test-apt-get-build-dep-barbarian index 688f7a5..b8ab121 100755 --- a/test/integration/test-apt-get-build-dep-barbarian +++ b/test/integration/test-apt-get-build-dep-barbarian @@ -83,6 +83,7 @@ testsuccessequal "$(installsfoosamey 'amd64' 'i386')" apt build-dep cool-foo -s testsuccessequal "$(installsfoosamey 'i386' 'i386')" apt build-dep bad-amd64-foo -s -a i386 testsuccessequal "$(installsfoosamey 'amd64' 'i386')" apt build-dep bad-armel-foo -s -a i386 testsuccessequal "$(installsfoosamey 'i386' 'i386')" apt build-dep bad-amd64-armel-foo -s -a i386 +testfailuremsg 'E: Conflict: builddeps:bad-amd64-i386-foo:i386=1 -> not foo:i386=1 -> not builddeps:bad-amd64-i386-foo:i386=1 but builddeps:bad-amd64-i386-foo:i386=1' apt build-dep bad-amd64-i386-foo -s -a i386 --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -94,7 +95,8 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:bad-amd64-i386-foo:i386 : Depends: foo:i386 -E: Unable to correct problems, you have held broken packages.' apt build-dep bad-amd64-i386-foo -s -a i386 +E: Unable to correct problems, you have held broken packages.' apt build-dep bad-amd64-i386-foo -s -a i386 --solver internal +testfailuremsg 'E: Conflict: builddeps:bad-amd64-i386-armel-foo:i386=1 -> not foo:i386=1 -> not builddeps:bad-amd64-i386-armel-foo:i386=1 but builddeps:bad-amd64-i386-armel-foo:i386=1' apt build-dep bad-amd64-i386-armel-foo -s -a i386 --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -106,13 +108,14 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:bad-amd64-i386-armel-foo:i386 : Depends: foo:i386 -E: Unable to correct problems, you have held broken packages.' apt build-dep bad-amd64-i386-armel-foo -s -a i386 +E: Unable to correct problems, you have held broken packages.' apt build-dep bad-amd64-i386-armel-foo -s -a i386 --solver internal testsuccessequal "$(installsfoosamey 'amd64' 'armel')" apt build-dep cool-foo -s -a armel testsuccessequal "$(installsfoosamey 'i386' 'armel')" apt build-dep bad-amd64-foo -s -a armel testsuccessequal "$(installsfoosamey 'amd64' 'armel')" apt build-dep bad-armel-foo -s -a armel testsuccessequal "$(installsfoosamey 'i386' 'armel')" apt build-dep bad-amd64-armel-foo -s -a armel testsuccessequal "$(installsfoosamey 'armel' 'armel')" apt build-dep bad-amd64-i386-foo -s -a armel +FAILUREMSG="E: Conflict: builddeps:bad-amd64-i386-armel-foo:armel=1 -> not foo:armel=1 -> not builddeps:bad-amd64-i386-armel-foo:armel=1 but builddeps:bad-amd64-i386-armel-foo:armel=1" FAILURE='Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -124,8 +127,9 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:bad-amd64-i386-armel-foo:armel : Depends: foo:armel E: Unable to correct problems, you have held broken packages.' +testfailuremsg "$FAILUREMSG" apt build-dep bad-amd64-i386-armel-foo -s -a armel --solver 3.0 testfailureequal "Reading package lists... -$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel +$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel --solver internal msgmsg 'BarbarianArchitectures' 'cmdline options' rm rootdir/etc/apt/apt.conf.d/99barbarianarchs @@ -134,7 +138,10 @@ testsuccess aptcache gencaches testsuccessequal "$(installsfoosamey 'mipsel' 'armel')" apt build-dep bad-amd64-i386-armel-foo -s -a armel testsuccess aptcache gencaches -o APT::BarbarianArchitectures::=armel testsuccessequal "$(installsfoosamey 'mipsel' 'armel')" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=armel -testfailureequal "$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel -testfailureequal "$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel -o APT::BarbarianArchitectures::=armel +testfailuremsg "$FAILUREMSG" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel --solver 3.0 +testfailuremsg "$FAILUREMSG" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel -o APT::BarbarianArchitectures::=armel --solver 3.0 +testfailuremsg "$FAILUREMSG" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures=mipsel,armel --solver 3.0 +testfailureequal "$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel --solver internal +testfailureequal "$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel -o APT::BarbarianArchitectures::=armel --solver internal testfailureequal "Reading package lists... -$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures=mipsel,armel +$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures=mipsel,armel --solver internal diff --git a/test/integration/test-apt-get-build-dep-file b/test/integration/test-apt-get-build-dep-file index 88bf10b..bd30cfc 100755 --- a/test/integration/test-apt-get-build-dep-file +++ b/test/integration/test-apt-get-build-dep-file @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' insertpackage 'stable' 'debhelper' 'i386' '7' @@ -158,6 +159,8 @@ testsuccess aptget build-dep --simulate '..' cd ../.. testfailureequal 'E: Must specify at least one package to check builddeps for' aptget build-dep +testfailuremsg 'W: No architecture information available for armel. See apt.conf(5) APT::Architectures for setup +E: Unsatisfiable dependency group builddeps:./foo-1.0:armel=1 -> debhelper:armel' aptget build-dep --simulate ./foo-1.0 -a armel --solver 3.0 testfailureequal "Note, using directory './foo-1.0' to get the build dependencies Reading package lists... Building dependency tree... @@ -170,7 +173,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:./foo-1.0:armel : Depends: debhelper:armel (>= 7) but it is not installable W: No architecture information available for armel. See apt.conf(5) APT::Architectures for setup -E: Unable to correct problems, you have held broken packages." aptget build-dep --simulate ./foo-1.0 -a armel +E: Unable to correct problems, you have held broken packages." aptget build-dep --simulate ./foo-1.0 -a armel --solver internal testfailureequal 'Reading package lists... E: Unable to find a source package for foo' aptget build-dep --simulate foo diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb index bcf8bae..6cbd25c 100755 --- a/test/integration/test-apt-get-install-deb +++ b/test/integration/test-apt-get-install-deb @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' # regression test for #754904 @@ -31,6 +32,7 @@ done buildsimplenativepackage 'foo' 'i386,amd64' '1.0' +testfailuremsg "E: Conflict: -> foo:amd64=1.0 but foo:i386=1.0 -> not foo:amd64=1.0" aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s --solver 3.0 testfailureequal "Reading package lists... Building dependency tree... Note, selecting 'foo:i386' instead of './incoming/foo_1.0_i386.deb' @@ -44,7 +46,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo:i386 : Conflicts: foo but 1.0 is to be installed foo : Conflicts: foo:i386 but 1.0 is to be installed -E: Unable to correct problems, you have held broken packages." aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s +E: Unable to correct problems, you have held broken packages." aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s --solver internal testsuccess apt show foo --with-source ./incoming/foo_1.0_amd64.deb testequal 'Package: foo @@ -175,7 +177,8 @@ echo 'Package: /pkg-/ Pin: release a=experimental Pin-Priority: 501' > rootdir/etc/apt/preferences.d/pinit -testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install -q=0 ./incoming/pkg-last-line-parse_0_all.deb +testfailuremsg 'E: Unsatisfiable dependency group pkg-last-line-parse:amd64=0 -> pkg-as-it-should-be:amd64' aptget install -q=0 ./incoming/pkg-last-line-parse_0_all.deb --solver 3.0 +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install -q=0 ./incoming/pkg-last-line-parse_0_all.deb --solver internal testsuccess aptget install ./incoming/pkg-as-it-should-be_0_all.deb testsuccess aptget install ./incoming/pkg-last-line-parse_0_all.deb testsuccess aptget install "$(readlink -f ./incoming/pkg-leading-newline_0_all.deb)" diff --git a/test/integration/test-apt-get-satisfy b/test/integration/test-apt-get-satisfy index 267760f..fc7e805 100755 --- a/test/integration/test-apt-get-satisfy +++ b/test/integration/test-apt-get-satisfy @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' 'amd64' insertpackage 'stable' 'depends' 'i386' '1' @@ -79,6 +80,8 @@ testrun 'External' 'Reading package lists... Building dependency tree... Execute external solver...' --solver apt +testfailuremsg "E: Unsatisfiable dependency group satisfy:command-line:i386=1 -> depends:i386" aptget satisfy --simulate "depends (>= 2)" "Conflicts: conflicts:i386 (>= 1) [i386], conflicts:amd64 (>= 1) [amd64]" --solver 3.0 + testfailureequal "Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -89,8 +92,10 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: satisfy:command-line : Depends: depends (>= 2) but it is not going to be installed -E: Unable to correct problems, you have held broken packages." aptget satisfy --simulate "depends (>= 2)" "Conflicts: conflicts:i386 (>= 1) [i386], conflicts:amd64 (>= 1) [amd64]" +E: Unable to correct problems, you have held broken packages." aptget satisfy --simulate "depends (>= 2)" "Conflicts: conflicts:i386 (>= 1) [i386], conflicts:amd64 (>= 1) [amd64]" --solver internal +if [ "$APT_SOLVER" != "3.0" ]; then +# FIXME: solver3 doesn't produce nice errors in the external solver scenario testfailureequal "Reading package lists... Building dependency tree... Execute external solver... @@ -109,3 +114,4 @@ The following packages have unmet dependencies: satisfy:command-line : Depends: depends (>= 2) but it is not going to be installed Conflicts: conflicts:i386 (>= 1) E: External solver failed with: The following packages have unmet dependencies:" aptget satisfy --simulate "depends (>= 2)" "Conflicts: conflicts:i386 (>= 1) [i386], conflicts:amd64 (>= 1) [amd64]" --solver apt +fi diff --git a/test/integration/test-apt-get-source-only b/test/integration/test-apt-get-source-only index 93d8284..b974146 100755 --- a/test/integration/test-apt-get-source-only +++ b/test/integration/test-apt-get-source-only @@ -29,6 +29,31 @@ DOWNLOADNOTFOO="Need to get 0 B/33 B of source archives. 'file:${APTARCHIVE}/not-foo_1.0.dsc' not-foo_1.0.dsc 15 SHA256:db578a571c87d2555e90245732042845be4f481755f5b2f5786ac7a26bde9f4f 'file:${APTARCHIVE}/not-foo_1.0.tar.gz' not-foo_1.0.tar.gz 18 SHA256:8701846f1cba0ca81c552ac0ec93e2a89ae113cf2872b9cd51b29b4a9ff6b122" +if [ "$APT_SOLVER" = "3.0" ]; then +BUILDDEPFOO="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: + builddeps:foo : Depends: foo-bd but it is not installable +E: Unsatisfiable dependency group builddeps:foo:amd64=1 -> foo-bd:amd64" + +BUILDDEPNOTFOO="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: + builddeps:not-foo : Depends: not-foo-bd but it is not installable +E: Unsatisfiable dependency group builddeps:not-foo:amd64=1 -> not-foo-bd:amd64" +else BUILDDEPFOO="Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -52,6 +77,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:not-foo : Depends: not-foo-bd but it is not installable E: Unable to correct problems, you have held broken packages." +fi testsuccessequal "$HEADER Picking 'not-foo' as source package instead of 'foo' diff --git a/test/integration/test-apt-get-upgrade b/test/integration/test-apt-get-upgrade index 50a90ce..c9e56d9 100755 --- a/test/integration/test-apt-get-upgrade +++ b/test/integration/test-apt-get-upgrade @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture "i386" # simple case @@ -60,6 +61,30 @@ Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) Conf new-dep (1.0 stable [all]) Conf upgrade-simple (2.0 unstable [all]) Conf upgrade-with-new-dep (2.0 unstable [all])' +if [ "$APT_SOLVER" = "3.0" ]; then +# FIXME: It would be better if we would keep back the upgrade rather than switch to sysvinit, +# but it's not clear that is reliably possible. +UPGRADENEW="Reading package lists... +Building dependency tree... +Calculating upgrade... +The following NEW packages will be installed: + new-dep sysvinit +The following packages have been kept back: + upgrade-with-conflict +The following packages will be upgraded: + init upgrade-simple upgrade-with-new-dep +3 upgraded, 2 newly installed, 0 to remove and 1 not upgraded. +Inst sysvinit (2 unstable [all]) +Conf sysvinit (2 unstable [all]) +Inst init [1] (2 unstable [all]) +Inst new-dep (1.0 stable [all]) +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf init (2 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-simple (2.0 unstable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])" +fi testsuccessequal "$UPGRADENEW" aptget upgrade -s --with-new-pkgs testsuccessequal "$UPGRADENEW" apt upgrade -s @@ -142,3 +167,54 @@ Conf upgrade-with-conflict (2.0 unstable [all]) Conf new-dep (1.0 stable [all]) Conf upgrade-simple (2.0 unstable [all]) Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade + +# --no-strict-pinning pulls in systemd due to the dependency +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages will be REMOVED: + conflicting-dep +The following NEW packages will be installed: + new-dep systemd +The following packages will be upgraded: + init upgrade-simple upgrade-with-conflict upgrade-with-new-dep +4 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv conflicting-dep [1.0] +Inst systemd (2 unstable [all]) +Conf systemd (2 unstable [all]) +Inst init [1] (2 unstable [all]) +Inst upgrade-with-conflict [1.0] (2.0 unstable [all]) +Inst new-dep (1.0 stable [all]) +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf init (2 unstable [all]) +Conf upgrade-with-conflict (2.0 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-simple (2.0 unstable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade --no-strict-pinning --solver 3.0 + +# --no-strict-pinning does not cause a package to be upgraded on its own, though. +echo 'Package: upgrade-simple +Pin: release unstable +Pin-Priority: -1' > rootdir/etc/apt/preferences.d/no-strict-pinning.pref +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages will be REMOVED: + conflicting-dep +The following NEW packages will be installed: + new-dep systemd +The following packages will be upgraded: + init upgrade-with-conflict upgrade-with-new-dep +3 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv conflicting-dep [1.0] +Inst systemd (2 unstable [all]) +Conf systemd (2 unstable [all]) +Inst init [1] (2 unstable [all]) +Inst upgrade-with-conflict [1.0] (2.0 unstable [all]) +Inst new-dep (1.0 stable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf init (2 unstable [all]) +Conf upgrade-with-conflict (2.0 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade --no-strict-pinning --solver 3.0 diff --git a/test/integration/test-apt-never-markauto-sections b/test/integration/test-apt-never-markauto-sections index b47966e..a1fc873 100755 --- a/test/integration/test-apt-never-markauto-sections +++ b/test/integration/test-apt-never-markauto-sections @@ -47,7 +47,8 @@ Remv foreignpkg:i386 [1] Remv nosection [1] Remv texteditor [1]' aptget autoremove mydesktop -s -testequal 'Reading package lists... +testfailuremsg 'E: Conflict: not texteditor:amd64 -> not texteditor:amd64=1 -> not bad-texteditor:amd64=1 -> not mydesktop-core:amd64=1 but mydesktop:amd64 -> mydesktop:amd64=1 -> mydesktop-core:amd64=1' aptget autoremove texteditor -s --solver 3.0 #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 +testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... The following packages will be REMOVED: @@ -55,8 +56,8 @@ The following packages will be REMOVED: 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. Remv mydesktop [1] Remv mydesktop-core [1] -Remv texteditor [1]' aptget autoremove texteditor -s #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -testsuccess aptget autoremove texteditor -y +Remv texteditor [1]' aptget autoremove texteditor -s --solver internal #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 +testsuccess aptget autoremove texteditor -y --solver internal testdpkgnotinstalled mydesktop mydesktop-core texteditor testdpkginstalled browser diff --git a/test/integration/test-bug-549968-install-depends-of-not-installed b/test/integration/test-bug-549968-install-depends-of-not-installed index 90ce58a..39c86cc 100755 --- a/test/integration/test-bug-549968-install-depends-of-not-installed +++ b/test/integration/test-bug-549968-install-depends-of-not-installed @@ -25,4 +25,24 @@ The following NEW packages will be installed: coolstuff 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Inst coolstuff (1.0 unstable [all]) -Conf coolstuff (1.0 unstable [all])" aptget install coolstuff extracoolstuff- -o Debug::pkgDepCache::Marker=1 -s +Conf coolstuff (1.0 unstable [all])" aptget install coolstuff extracoolstuff- -o Debug::pkgDepCache::Marker=1 -s --solver internal + +# We check the Markers here as the autoremove nuker will also +# prevent it, but to late - its better to fail earlier +testsuccessequal "Reading package lists... +Building dependency tree... +Package 'extracoolstuff' is not installed, so not removed +Solving dependencies...MANUAL coolstuff:i386 +[0] Install:coolstuff:i386=1.0 () +Delete extracoolstuff:i386 +[0] Reject:extracoolstuff:i386 () +[0] Reject:extracoolstuff:i386=1.0 (not extracoolstuff:i386) +Optional Item (0@0) coolstuff:i386=1.0 -> | extracoolstuff:i386=1.0 + +Recommended packages: + extracoolstuff +The following NEW packages will be installed: + coolstuff +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst coolstuff (1.0 unstable [all]) +Conf coolstuff (1.0 unstable [all])" aptget install coolstuff extracoolstuff- -o Debug::APT::Solver=1 -s --solver 3.0 diff --git a/test/integration/test-bug-591882-conkeror b/test/integration/test-bug-591882-conkeror index 6b90343..21c5697 100755 --- a/test/integration/test-bug-591882-conkeror +++ b/test/integration/test-bug-591882-conkeror @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture "i386" setupaptarchive @@ -73,5 +74,5 @@ After this operation, 36.0 MB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation." # Test that the old behavior can be restored with the option -testfailureequal "$UPGRADEFAIL" aptget dist-upgrade --trivial-only -o pkgProblemResolver::FixByInstall=0 +testfailureequal "$UPGRADEFAIL" aptget dist-upgrade --trivial-only -o pkgProblemResolver::FixByInstall=0 --solver internal testfailureequal "$UPGRADESUCCESS" aptget dist-upgrade --trivial-only #-o pkgProblemResolver::FixByInstall=0 diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo index 4d0e3dc..2cfdc53 100755 --- a/test/integration/test-bug-596498-trusted-unsigned-repo +++ b/test/integration/test-bug-596498-trusted-unsigned-repo @@ -15,10 +15,15 @@ aptgetupdate() { rm -rf rootdir/var/lib/apt/ rootdir/var/cache/apt/*.bin ${1:-testwarning} aptget update --allow-insecure-repositories } - -PKGTEXT="$(aptget install cool --assume-no -d | head -n 8)" -DOWNLOG="$(echo "$PKGTEXT" | tail -n 1)" -PKGTEXT="$(echo "$PKGTEXT" | head -n 7)" +PKGSIZE=$(aptcache show cool | awk '/^Size:/ {print $2}') +PKGTEXT="Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + cool +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/$PKGSIZE B of archives. +After this operation, 11.3 kB of additional disk space will be used." +DOWNLOG="Get:1 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main i386 cool i386 1.0 [$PKGSIZE B]" DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-*.list' testsuccessequal "$PKGTEXT diff --git a/test/integration/test-bug-598669-install-postfix-gets-exim-heavy b/test/integration/test-bug-598669-install-postfix-gets-exim-heavy index e7e4093..e27ddb2 100755 --- a/test/integration/test-bug-598669-install-postfix-gets-exim-heavy +++ b/test/integration/test-bug-598669-install-postfix-gets-exim-heavy @@ -7,6 +7,8 @@ setupenvironment configarchitecture "i386" setupaptarchive +testfailuremsg "E: Conflict: -> postfix:i386=2.7.1-1 but exim4-daemon-light:i386 -> exim4-daemon-light:i386=4.72-1 -> not postfix:i386=2.7.1-1" aptget install postfix --solver 3.0 +allowremovemanual testfailureequal "Reading package lists... Building dependency tree... The following packages will be REMOVED: diff --git a/test/integration/test-bug-601961-install-info b/test/integration/test-bug-601961-install-info index 3e13560..94a5ad2 100755 --- a/test/integration/test-bug-601961-install-info +++ b/test/integration/test-bug-601961-install-info @@ -47,4 +47,17 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: findutils : Depends: essentialpkg but it is not going to be installed -E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' aptget remove essentialpkg --trivial-only +E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' aptget remove essentialpkg --trivial-only --solver internal + +testfailureequal 'Reading package lists... +Building dependency tree... +Solving dependencies... +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: + findutils : Depends: essentialpkg but it is not going to be installed +E: Conflict: -> findutils:i386 but not essentialpkg:i386 -> not essentialpkg:i386=4.13a.dfsg.1-6 -> not findutils:i386=4.4.2-1+b1 -> not findutils:i386' aptget remove essentialpkg --trivial-only --solver 3.0 diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index 78a2882..a53fcb7 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -18,9 +18,13 @@ insertpackage 'stable' 'libkf5kipi-data' 'i386' '4:16.08.0-1' 'Breaks: libkipi-d insertpackage 'stable' 'libkipi-data' 'i386' '4:15.08.0-1' '' 'important' insertpackage 'stable' 'libgphoto2-l10n' 'all' '2' -insertpackage 'installed,stable' 'photoapp1' 'all' '1' 'Recommends: libgphoto2-l10n (= 1)' +insertinstalledpackage 'libfoto1' 'i386' '1' +insertpackage 'installed,stable' 'photoapp1' 'all' '1' 'Depends: libfoto1 +Recommends: libgphoto2-l10n (= 1)' insertinstalledpackage 'photoapp2' 'all' '1' +insertpackage 'stable' 'libfoto1t64' 'i386' '1' 'Provides: libfoto1' insertpackage 'stable' 'photoapp2' 'all' '2' 'Conflicts: photoapp1 +Depends: libfoto1t64 Recommends: libgphoto2-l10n (= 2)' setupaptarchive @@ -89,6 +93,25 @@ E: Trivial Only specified but this is not a trivial operation." aptget install d rm -f rootdir/var/lib/dpkg/status rootdir/var/lib/apt/extended_states +if [ "$APT_SOLVER" = "3.0" ]; then +CONFLICTING='Reading package lists... +Building dependency tree... +Solving dependencies...MANUAL dummy-archive:i386 +[0] Install:dummy-archive:i386=0.invalid.0 () +[0] Install:libavcodec52:i386=4:0.5.2-6 (dummy-archive:i386=0.invalid.0) +[0] Reject:libvtk5-dev:i386=5.4.2-8 (dummy-archive:i386=0.invalid.0 -> libavcodec52:i386=4:0.5.2-6) +Item (1@0) dummy-archive:i386=0.invalid.0 -> | libvtk5-dev:i386=5.4.2-8 | libopenal-dev:i386=1:1.12.854-2 +[0] Install:libopenal-dev:i386=1:1.12.854-2 (dummy-archive:i386=0.invalid.0) + +The following additional packages will be installed: + libavcodec52 libopenal-dev +The following NEW packages will be installed: + dummy-archive libavcodec52 libopenal-dev +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/126 B of archives. +After this operation, 129 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' +else CONFLICTING='Reading package lists... Building dependency tree... MarkInstall dummy-archive:i386 < none -> 0.invalid.0 @un puN Ib > FU=1 @@ -104,10 +127,11 @@ The following NEW packages will be installed: Need to get 0 B/126 B of archives. After this operation, 129 kB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation.' +fi -testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=0 -testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=1 -testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=small +testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=0 -o Debug::APT::Solver=1 +testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=1 -o Debug::APT::Solver=1 +testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=small -o Debug::APT::Solver=1 insertinstalledpackage 'my-metapackage' 'i386' '1' 'Depends: gwenview' insertinstalledpackage 'gwenview' 'i386' '4:15.08.0-1' 'Depends: libkipi-data diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts index bc57395..a005127 100755 --- a/test/integration/test-bug-612099-multiarch-conflicts +++ b/test/integration/test-bug-612099-multiarch-conflicts @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' 'amd64' buildsimplenativepackage 'libc6' 'i386' '1.0' 'stable' diff --git a/test/integration/test-bug-612557-garbage-upgrade b/test/integration/test-bug-612557-garbage-upgrade index e0ede78..2a4c952 100755 --- a/test/integration/test-bug-612557-garbage-upgrade +++ b/test/integration/test-bug-612557-garbage-upgrade @@ -17,6 +17,8 @@ testsuccess aptmark markauto python-uno openoffice.org-common #aptmark unmarkauto openoffice.org-emailmerge testmarkedauto python-uno openoffice.org-common +# The 3.0 solver does not remove openoffice.org-emailmerge because it is manually installed. +testfailuremsg "E: Conflict: -> openoffice.org-emailmerge:i386 but python-uno:i386=1:3.3.0-2 -> libreoffice-common:i386=1:3.3.0-2 -> not openoffice.org-common:i386=1:3.2.1-11+squeeze2 -> not openoffice.org-emailmerge:i386=1:3.2.1-11+squeeze2 -> not openoffice.org-emailmerge:i386" aptget --trivial-only install python-uno --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Reading state information... @@ -31,7 +33,7 @@ The following packages will be upgraded: 1 upgraded, 1 newly installed, 2 to remove and 0 not upgraded. Need to get 0 B/84 B of archives. After this operation, 53.2 MB disk space will be freed. -E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only install python-uno +E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only install python-uno --solver internal testsuccess aptmark markauto openoffice.org-emailmerge testmarkedauto python-uno openoffice.org-common openoffice.org-emailmerge diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency index 75a653c..0d83097 100755 --- a/test/integration/test-bug-613420-new-garbage-dependency +++ b/test/integration/test-bug-613420-new-garbage-dependency @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture "i386" insertpackage 'unstable' 'libreoffice' 'all' '1:3.3.1~rc1-2' 'Depends: libreoffice-core' diff --git a/test/integration/test-bug-618848-always-respect-user-requests b/test/integration/test-bug-618848-always-respect-user-requests index 225db29..8b7b17b 100755 --- a/test/integration/test-bug-618848-always-respect-user-requests +++ b/test/integration/test-bug-618848-always-respect-user-requests @@ -13,6 +13,17 @@ insertpackage 'unstable' 'exim4-daemon-heavy' 'all' '1.0' 'Depends: libdb4.8' setupaptarchive +# This does not work in 3.0 solver: We do not remove manually installed packages. +testfailuremsg "E: Conflict: not libdb4.8:i386 -> not libdb4.8:i386=1.0 -> not exim4-daemon-light:i386=1.0 -> not exim4:i386=1.0 but exim4:i386 -> exim4:i386=1.0" aptget remove libdb4.8 --solver 3.0 -s +allowremovemanual +testsuccessequal "Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + exim4 exim4-daemon-light libdb4.8 +0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. +Remv exim4 [1.0] +Remv exim4-daemon-light [1.0] +Remv libdb4.8 [1.0]" aptget remove libdb4.8 -s testsuccessequal "Reading package lists... Building dependency tree... MarkDelete libdb4.8:i386 < 1.0 @ii pmK > FU=1 @@ -28,4 +39,4 @@ Remv exim4 [1.0] MarkDelete exim4-daemon-light:i386 < 1.0 @ii K > FU=1 Remv exim4-daemon-light [1.0] MarkDelete libdb4.8:i386 < 1.0 @ii K > FU=1 -Remv libdb4.8 [1.0]" aptget remove libdb4.8 -s -o Debug::pkgDepCache::Marker=1 +Remv libdb4.8 [1.0]" aptget remove libdb4.8 -s -o Debug::pkgDepCache::Marker=1 --solver internal diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction index 0cf8d35..90cb868 100755 --- a/test/integration/test-bug-632221-cross-dependency-satisfaction +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -35,6 +35,7 @@ insertsource 'unstable' 'source-specific-armel' 'armel' '1' 'Build-Depends: spec setupaptarchive +testfailuremsg "E: Unsatisfiable dependency group builddeps:forbidden-no:armel=1 -> amdboot:any:any" aptget build-dep forbidden-no -s -a armel --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -46,7 +47,9 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:forbidden-no:armel : Depends: amdboot:any but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-no -s -a armel +E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-no -s -a armel --solver internal + +testfailuremsg "E: Unsatisfiable dependency group builddeps:forbidden-same:armel=1 -> libc6:any:any" aptget build-dep forbidden-same -s -a armel --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -58,7 +61,9 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:forbidden-same:armel : Depends: libc6:any but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-same -s -a armel +E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-same -s -a armel --solver internal + +testfailuremsg 'E: Unsatisfiable dependency group builddeps:forbidden-foreign:armel=1 -> doxygen:any:any' aptget build-dep forbidden-foreign -s -a armel --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -70,7 +75,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:forbidden-foreign:armel : Depends: doxygen:any but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-foreign -s -a armel +E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-foreign -s -a armel --solver internal testsuccessequal 'Reading package lists... Reading package lists... diff --git a/test/integration/test-bug-64141-install-dependencies-for-on-hold b/test/integration/test-bug-64141-install-dependencies-for-on-hold index fe3bde6..2565c94 100755 --- a/test/integration/test-bug-64141-install-dependencies-for-on-hold +++ b/test/integration/test-bug-64141-install-dependencies-for-on-hold @@ -19,6 +19,38 @@ insertpackage 'unstable' 'libdb4.8' 'native' '4.8.30-3' setupaptarchive +# Solver 3.0 does not remove manual packages +testfailureequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + apt +The following packages will be upgraded: + libc6 +1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +Need to get 0 B/42 B of archives. +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 --solver 3.0 + +testfailure aptget dist-upgrade --trivial-only --solver 3.0 -o debug::apt::solver=2 +testsuccess grep -Fx 'Branch failed: Conflict: apt:amd64 -> apt:amd64=0.8.10 -> not oldcrap:amd64=1-1 but oldcrap:amd64 -> oldcrap:amd64=1-1' rootdir/tmp/testfailure.output + +allowremovemanual + +testfailureequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages will be REMOVED: + oldcrap +The following NEW packages will be installed: + libdb4.8 +The following packages will be upgraded: + apt libc6 +2 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Need to get 0 B/126 B of archives. +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 + testfailureequal 'Reading package lists... Building dependency tree... Calculating upgrade... diff --git a/test/integration/test-bug-657695-resolver-breaks-on-virtuals b/test/integration/test-bug-657695-resolver-breaks-on-virtuals index 42b8521..e3ff6d1 100755 --- a/test/integration/test-bug-657695-resolver-breaks-on-virtuals +++ b/test/integration/test-bug-657695-resolver-breaks-on-virtuals @@ -16,6 +16,15 @@ insertpackage 'unstable' 'xserver-xorg-core' 'amd64' '2:1.11.3-0ubuntu9' 'Breaks setupaptarchive +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + xserver-xorg-core +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.' aptget dist-upgrade --trivial-only --solver 3.0 + +allowremovemanual + testfailureequal 'Reading package lists... Building dependency tree... Calculating upgrade... diff --git a/test/integration/test-bug-683786-build-dep-on-virtual-packages b/test/integration/test-bug-683786-build-dep-on-virtual-packages index 831e1f8..45e40e2 100755 --- a/test/integration/test-bug-683786-build-dep-on-virtual-packages +++ b/test/integration/test-bug-683786-build-dep-on-virtual-packages @@ -41,6 +41,7 @@ The following NEW packages will be installed: Inst po-debconf (1 unstable [all]) Conf po-debconf (1 unstable [all])' aptget build-dep dash -s +testfailuremsg 'E: Unsatisfiable dependency group builddeps:dash:armel=1 -> po-debconf:armel' aptget build-dep -aarmel dash -s --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -52,7 +53,9 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:dash:armel : Depends: po-debconf:armel but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel dash -s +E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel dash -s --solver internal + +testfailuremsg 'E: Unsatisfiable dependency group builddeps:diffutils:armel=1 -> texi2html:armel' aptget build-dep -aarmel diffutils -s --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -64,7 +67,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:diffutils:armel : Depends: texi2html:armel but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel diffutils -s +E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel diffutils -s --solver internal testsuccessequal "Reading package lists... Reading package lists... @@ -75,6 +78,7 @@ The following NEW packages will be installed: Inst libselinux1-dev (1 unstable [amd64]) Conf libselinux1-dev (1 unstable [amd64])" aptget build-dep sed -s +testfailuremsg 'E: Unsatisfiable dependency group builddeps:sed:armel=1 -> libselinux-dev:armel' aptget build-dep -aarmel sed -s --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -86,7 +90,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:sed:armel : Depends: libselinux-dev:armel but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel sed -s +E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel sed -s --solver internal testsuccessequal "Reading package lists... Reading package lists... diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture index d28600a..a064e5d 100755 --- a/test/integration/test-bug-686346-package-missing-architecture +++ b/test/integration/test-bug-686346-package-missing-architecture @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' insertinstalledpackage 'pkgb' 'none' '1' diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch index 9c96bbe..3bad617 100755 --- a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch +++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' buildsimplenativepackage 'toolkit' 'all' '1' 'stable' 'Multi-Arch: foreign' @@ -89,7 +90,8 @@ stuff 2 amd64 none > - - none **REMOVE**' testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE**' testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE**' - observehook install stuff:i386/stable libsame:i386/stable toolkit/stable + # FIXME: solver3: This should not require no-strict-pinning + observehook install stuff:i386/stable libsame:i386/stable toolkit/stable $(test "$APT_SOLVER" != "3.0" || printf '%s' '--no-strict-pinning') testfileequal "${hook}-v2.list" 'libsame 2 > 1 **CONFIGURE** stuff 2 > 1 **CONFIGURE** toolkit 2 > 1 **CONFIGURE**' diff --git a/test/integration/test-bug-720597-build-dep-purge b/test/integration/test-bug-720597-build-dep-purge index 4b36989..9ff0d23 100755 --- a/test/integration/test-bug-720597-build-dep-purge +++ b/test/integration/test-bug-720597-build-dep-purge @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual # we need this construct here as it isn't really possible to fake native arch for dpkg-* tools NATIVE="$(command dpkg --print-architecture)" diff --git a/test/integration/test-bug-723586-any-stripped-in-single-arch b/test/integration/test-bug-723586-any-stripped-in-single-arch index 38eb026..441bc29 100755 --- a/test/integration/test-bug-723586-any-stripped-in-single-arch +++ b/test/integration/test-bug-723586-any-stripped-in-single-arch @@ -29,6 +29,20 @@ Inst python3-gnupg (0.3.5-2 stable [all]) Conf python3 (3.3.2-16 unstable [amd64]) Conf python3-gnupg (0.3.5-2 stable [all])' +if [ "$APT_SOLVER" = "3.0" ]; then +FAILLOG='Reading package lists... +Building dependency tree... +Solving dependencies... +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: + python-mips : Depends: python3:mips but it is not installable +E: Unsatisfiable dependency group python-mips:amd64=3 -> python3:mips:any' +else FAILLOG='Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -40,6 +54,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: python-mips : Depends: python3:mips but it is not installable E: Unable to correct problems, you have held broken packages.' +fi testsuccessequal "$INSTALLLOG" aptget install python3-gnupg -s aptcache showpkg python3 > showpkg.log diff --git a/test/integration/test-bug-735967-lib32-to-i386-unavailable b/test/integration/test-bug-735967-lib32-to-i386-unavailable index b836451..cc925d1 100755 --- a/test/integration/test-bug-735967-lib32-to-i386-unavailable +++ b/test/integration/test-bug-735967-lib32-to-i386-unavailable @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' 'amd64' insertpackage 'unstable' 'lib32nss-mdns' 'amd64' '0.10-6' 'Depends: libnss-mdns-i386 (= 0.10-6)' @@ -43,6 +44,7 @@ Remv lib32nss-mdns [0.9-1] Inst libnss-mdns [0.9-1] (0.10-6 unstable [amd64]) Conf libnss-mdns (0.10-6 unstable [amd64])' aptget dist-upgrade -s +testfailuremsg 'E: Unsatisfiable dependency group libfoo:amd64=1 -> libfoo-bin:amd64' aptget install foo -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -53,7 +55,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: libfoo : Depends: libfoo-bin but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget install foo -s +E: Unable to correct problems, you have held broken packages.' aptget install foo -s --solver internal # activate multiarch configarchitecture 'amd64' 'i386' diff --git a/test/integration/test-bug-747261-arch-specific-conflicts b/test/integration/test-bug-747261-arch-specific-conflicts index e137043..093542d 100755 --- a/test/integration/test-bug-747261-arch-specific-conflicts +++ b/test/integration/test-bug-747261-arch-specific-conflicts @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'sparc' 'armel' insertinstalledpackage 'foobar' 'armel' '1' diff --git a/test/integration/test-bug-758153-versioned-provides-support b/test/integration/test-bug-758153-versioned-provides-support index 7bf9d76..a057d33 100755 --- a/test/integration/test-bug-758153-versioned-provides-support +++ b/test/integration/test-bug-758153-versioned-provides-support @@ -7,6 +7,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' insertinstalledpackage 'webapp' 'all' '1' 'Depends: httpd' @@ -393,11 +394,18 @@ Inst needsselfprov12 (1 unstable [amd64]) Conf selfprov (2 unstable [amd64]) Conf needsselfprov12 (1 unstable [amd64])" aptget install needsselfprov12 -s --solver $solver if [ "$solver" = 'apt' ]; then +if [ "$APT_SOLVER" = "3.0" ]; then +TOPDEPENDS=" needsselfprov123 : Depends: selfprov (= 1) + Depends: selfprov (= 2) + Depends: selfprov (= 3)" +else +TOPDEPENDS=" needsselfprov123 : Depends: selfprov (= 3)" +fi testfailureequal "$HEADER The solver encountered an error of type: ERR_UNSOLVABLE The following information might help you to understand what is wrong: The following packages have unmet dependencies: - needsselfprov123 : Depends: selfprov (= 3) +$TOPDEPENDS $SOMEPACKAGESCOULDNOT needsselfprov123 : Depends: selfprov (= 1) diff --git a/test/integration/test-bug-769609-triggers-still-pending-after-run b/test/integration/test-bug-769609-triggers-still-pending-after-run index ce2c193..0a2dd25 100755 --- a/test/integration/test-bug-769609-triggers-still-pending-after-run +++ b/test/integration/test-bug-769609-triggers-still-pending-after-run @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' msgtest 'Check if installed dpkg supports' 'noawait trigger' diff --git a/test/integration/test-bug-796070-downgrade-simulate b/test/integration/test-bug-796070-downgrade-simulate index 61ecc87..d1b6b7f 100755 --- a/test/integration/test-bug-796070-downgrade-simulate +++ b/test/integration/test-bug-796070-downgrade-simulate @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' insertpackage 'unstable' 'apt' 'all' '1.0.10.1' 'Depends: libapt-pkg4.16 (>= 1.0.10.1)' diff --git a/test/integration/test-bug-960705-propagate-protected-to-satisfied-conflict b/test/integration/test-bug-960705-propagate-protected-to-satisfied-conflict index 272378b..270536f 100755 --- a/test/integration/test-bug-960705-propagate-protected-to-satisfied-conflict +++ b/test/integration/test-bug-960705-propagate-protected-to-satisfied-conflict @@ -15,6 +15,7 @@ Important: yes' setupaptarchive +# This only works on internal, we do not have magic essential autoswitch ability for 3.0 testsuccessequal "Reading package lists... Building dependency tree... Removing: systemd-sysv:amd64 as upgrade is not an option for runit-init:amd64 (1) @@ -50,4 +51,4 @@ Remv init [1] MarkDelete systemd-sysv:amd64 < 1 | none @ii H > FU=1 Remv systemd-sysv [1] Inst runit-init (1 unstable [all]) -Conf runit-init (1 unstable [all])" apt install runit-init -so Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 -o APT::Get::Allow-Solver-Remove-Essential=1 +Conf runit-init (1 unstable [all])" apt install runit-init -so Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 -o APT::Get::Allow-Solver-Remove-Essential=1 --solver internal diff --git a/test/integration/test-bug-960705-propagate-protected-to-satisfied-depends b/test/integration/test-bug-960705-propagate-protected-to-satisfied-depends index ca6bf8d..da11fc8 100755 --- a/test/integration/test-bug-960705-propagate-protected-to-satisfied-depends +++ b/test/integration/test-bug-960705-propagate-protected-to-satisfied-depends @@ -20,6 +20,35 @@ setupaptarchive testsuccessequal "Reading package lists... Building dependency tree... +Solving dependencies...MANUAL foobar:amd64 +[0] Install:foobar:amd64=1 () +[0] Install:requires-foo:amd64=1 (foobar:amd64=1) +[0] Install:foo:amd64=1 (foobar:amd64=1 -> requires-foo:amd64=1) +[0] Install:foo-depends:amd64=1 (foobar:amd64=1 -> requires-foo:amd64=1 -> foo:amd64=1) +Item (2@0) foobar:amd64=1 -> | conflicts-foo:amd64=1 | fine-foo:amd64=1 +[1] Install:conflicts-foo:amd64=1 (foobar:amd64=1) +[0] Reject:conflicts-foo:amd64=1 () +Item (1@0) foobar:amd64=1 -> | conflicts-foo:amd64=1 | fine-foo:amd64=1 +[0] Install:fine-foo:amd64=1 (foobar:amd64=1) + +The following additional packages will be installed: + fine-foo foo foo-depends requires-foo +The following NEW packages will be installed: + fine-foo foo foo-depends foobar requires-foo +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +Inst fine-foo (1 unstable [all]) +Inst foo-depends (1 unstable [all]) +Inst foo (1 unstable [all]) +Inst requires-foo (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf fine-foo (1 unstable [all]) +Conf foo-depends (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf requires-foo (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar -so Debug::APT::Solver=1 --solver 3.0 + +testsuccessequal "Reading package lists... +Building dependency tree... Installing foo:amd64 as Depends of foobar:amd64 Installing foo-depends:amd64 as Depends of foo:amd64 Installing requires-foo:amd64 as Depends of foobar:amd64 @@ -42,4 +71,4 @@ Conf fine-foo (1 unstable [all]) Conf foo-depends (1 unstable [all]) Conf foo (1 unstable [all]) Conf requires-foo (1 unstable [all]) -Conf foobar (1 unstable [all])" apt install foobar -so Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::AutoInstall=1 +Conf foobar (1 unstable [all])" apt install foobar -so Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::AutoInstall=1 --solver internal diff --git a/test/integration/test-bug-lp1562402-nomark-removals-as-keep b/test/integration/test-bug-lp1562402-nomark-removals-as-keep index 6e8225a..41a9591 100755 --- a/test/integration/test-bug-lp1562402-nomark-removals-as-keep +++ b/test/integration/test-bug-lp1562402-nomark-removals-as-keep @@ -18,6 +18,15 @@ insertinstalledpackage 'maas-region-controller' 'all' '2.0.0~alpha3+bzr4810-0ubu setupaptarchive +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + maas-common maas-region-controller maas-region-controller-min +0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.' aptget dist-upgrade -s --solver 3.0 + +allowremovemanual + testsuccess aptget dist-upgrade -s -o Debug::pkgDepCache::AutoInstall=true -o Debug::pkgPackageManager=yes -o Debug::pkgProblemResolver=yes testsuccessequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-crossgrades b/test/integration/test-crossgrades index 6398e7e..b428215 100755 --- a/test/integration/test-crossgrades +++ b/test/integration/test-crossgrades @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' 'amd64' 'armel' configdpkgnoopchroot diff --git a/test/integration/test-dpkg-i-apt-install-fix-broken b/test/integration/test-dpkg-i-apt-install-fix-broken index 0b75b5f..5c517aa 100755 --- a/test/integration/test-dpkg-i-apt-install-fix-broken +++ b/test/integration/test-dpkg-i-apt-install-fix-broken @@ -14,6 +14,28 @@ setupaptarchive testfailure dpkg -i incoming/autopkgtest-*.deb testsuccessequal 'Reading package lists... Building dependency tree... +Correcting dependencies...MANUAL autopkgtest-satdep:amd64 +[0] Install:autopkgtest-satdep:amd64 () +[0] Install:autopkgtest-satdep:amd64=1 (autopkgtest-satdep:amd64) +[0] Install:debhelper:amd64=1 (autopkgtest-satdep:amd64 -> autopkgtest-satdep:amd64=1) + Done +Solving dependencies...AUTOMATIC debhelper:amd64 - upgrade +MANUAL autopkgtest-satdep:amd64 +[0] Install:autopkgtest-satdep:amd64 () +[0] Install:autopkgtest-satdep:amd64=1 (autopkgtest-satdep:amd64) +[0] Install:debhelper:amd64=1 (autopkgtest-satdep:amd64 -> autopkgtest-satdep:amd64=1) + +The following additional packages will be installed: + debhelper +The following NEW packages will be installed: + debhelper +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +1 not fully installed or removed. +Inst debhelper (1 stable [all]) +Conf debhelper (1 stable [all]) +Conf autopkgtest-satdep (1 stable [amd64])' apt install -fso Debug::APT::Solver=1 --solver 3.0 +testsuccessequal 'Reading package lists... +Building dependency tree... Correcting dependencies... MarkInstall autopkgtest-satdep:amd64 < 1 @iU K Nb Ib > FU=0 MarkInstall debhelper:amd64 < none -> 1 @un uN > FU=0 Starting pkgProblemResolver with broken count: 0 @@ -31,4 +53,4 @@ The following NEW packages will be installed: 1 not fully installed or removed. Inst debhelper (1 stable [all]) Conf debhelper (1 stable [all]) -Conf autopkgtest-satdep (1 stable [amd64])' apt install -fso Debug::pkgProblemResolver=1 -o DEbug::pkgDepCache::Marker=1 +Conf autopkgtest-satdep (1 stable [amd64])' apt install -fso Debug::pkgProblemResolver=1 -o DEbug::pkgDepCache::Marker=1 --solver internal diff --git a/test/integration/test-external-installation-planner-protocol b/test/integration/test-external-installation-planner-protocol index 192f21b..1a04d24 100755 --- a/test/integration/test-external-installation-planner-protocol +++ b/test/integration/test-external-installation-planner-protocol @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' buildsimplenativepackage 'libfoo' 'amd64' '3' 'experimental' 'Multi-Arch: same' diff --git a/test/integration/test-handling-broken-orgroups b/test/integration/test-handling-broken-orgroups index 564ea88..1c20ae4 100755 --- a/test/integration/test-handling-broken-orgroups +++ b/test/integration/test-handling-broken-orgroups @@ -47,6 +47,7 @@ Inst coolstuff2 (1.0-1 unstable [all]) Conf stuff (1.0-1 unstable [all]) Conf coolstuff2 (1.0-1 unstable [all])' aptget install coolstuff2 -s +testfailuremsg 'E: Unsatisfiable dependency group coolstuff-broken:i386=1.0-1 -> cool2:i386' aptget install coolstuff-broken --solver 3.0 -s testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -58,7 +59,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: coolstuff-broken : Depends: cool2 but it is not installable or stuff2 but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-broken -s +E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-broken --solver internal -s testsuccessequal 'Reading package lists... Building dependency tree... @@ -94,6 +95,7 @@ Inst coolstuff-provided (1.0-1 unstable [all]) Conf extrastuff (1.0-1 unstable [all]) Conf coolstuff-provided (1.0-1 unstable [all])' aptget install coolstuff-provided -s +testfailuremsg 'E: Unsatisfiable dependency group coolstuff-provided-broken:i386=1.0-1 -> cool2:i386' aptget install coolstuff-provided-broken --solver 3.0 -s testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -105,4 +107,4 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: coolstuff-provided-broken : Depends: cool2 but it is not installable or stuff-abi-2 -E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-provided-broken -s +E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-provided-broken --solver internal -s diff --git a/test/integration/test-ignore-provides-if-versioned-breaks b/test/integration/test-ignore-provides-if-versioned-breaks index ebcbecf..7947d6d 100755 --- a/test/integration/test-ignore-provides-if-versioned-breaks +++ b/test/integration/test-ignore-provides-if-versioned-breaks @@ -32,7 +32,10 @@ insertpackage 'unstable' 'foo-same-breaker-none' 'i386' '1.0' 'Breaks: foo-same' setupaptarchive - +testfailuremsg 'E: Conflict: foo:i386 but no versions are installable +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=4.0 +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=2.0 +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=2.0' aptget install foo-provider foo-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -43,7 +46,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-breaker-none : Breaks: foo -E: Unable to correct problems, you have held broken packages.' aptget install foo-provider foo-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-provider foo-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... @@ -71,6 +74,10 @@ Conf foo (4.0 unstable [i386]) Conf foo-breaker-3 (1.0 unstable [i386]) Conf foo-provider (1.0 unstable [i386])' aptget install foo-provider foo-breaker-3 -s +testfailuremsg 'E: Conflict: foo-foreign:amd64 but no versions are installable +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=4.0 +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=2.0 +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=4.0' aptget install foo-foreign-provider foo-foreign-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -81,7 +88,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-foreign-breaker-none : Breaks: foo-foreign -E: Unable to correct problems, you have held broken packages.' aptget install foo-foreign-provider foo-foreign-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-foreign-provider foo-foreign-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... @@ -109,6 +116,7 @@ Conf foo-foreign:amd64 (4.0 unstable [amd64]) Conf foo-foreign-breaker-3 (1.0 unstable [i386]) Conf foo-foreign-provider (1.0 unstable [i386])' aptget install foo-foreign-provider foo-foreign-breaker-3 -s +testfailuremsg 'E: Conflict: -> foo-same:i386 but foo-same-breaker-none:i386=1.0 -> not foo-same:i386=2.0 -> not foo-same:i386' aptget install foo-same-provider foo-same-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -119,7 +127,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-same-breaker-none : Breaks: foo-same -E: Unable to correct problems, you have held broken packages.' aptget install foo-same-provider foo-same-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-same-provider foo-same-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-ignore-provides-if-versioned-conflicts b/test/integration/test-ignore-provides-if-versioned-conflicts index 3243cfb..dd24263 100755 --- a/test/integration/test-ignore-provides-if-versioned-conflicts +++ b/test/integration/test-ignore-provides-if-versioned-conflicts @@ -33,6 +33,10 @@ insertpackage 'unstable' 'foo-same-breaker-none' 'i386' '1.0' 'Conflicts: foo-sa setupaptarchive +testfailuremsg 'E: Conflict: foo:i386 but no versions are installable +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=4.0 +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=2.0 +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=2.0' aptget install foo-provider foo-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -43,7 +47,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-breaker-none : Conflicts: foo -E: Unable to correct problems, you have held broken packages.' aptget install foo-provider foo-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-provider foo-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... @@ -71,6 +75,10 @@ Conf foo (4.0 unstable [i386]) Conf foo-breaker-3 (1.0 unstable [i386]) Conf foo-provider (1.0 unstable [i386])' aptget install foo-provider foo-breaker-3 -s +testfailuremsg 'E: Conflict: foo-foreign:amd64 but no versions are installable +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=4.0 +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=2.0 +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=4.0' aptget install foo-foreign-provider foo-foreign-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -81,7 +89,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-foreign-breaker-none : Conflicts: foo-foreign -E: Unable to correct problems, you have held broken packages.' aptget install foo-foreign-provider foo-foreign-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-foreign-provider foo-foreign-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... @@ -109,6 +117,7 @@ Conf foo-foreign:amd64 (4.0 unstable [amd64]) Conf foo-foreign-breaker-3 (1.0 unstable [i386]) Conf foo-foreign-provider (1.0 unstable [i386])' aptget install foo-foreign-provider foo-foreign-breaker-3 -s +testfailuremsg 'E: Conflict: -> foo-same:i386 but foo-same-breaker-none:i386=1.0 -> not foo-same:i386=2.0 -> not foo-same:i386' aptget install foo-same-provider foo-same-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -119,7 +128,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-same-breaker-none : Conflicts: foo-same -E: Unable to correct problems, you have held broken packages.' aptget install foo-same-provider foo-same-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-same-provider foo-same-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed index fc63d0e..298867c 100755 --- a/test/integration/test-multiarch-allowed +++ b/test/integration/test-multiarch-allowed @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' insertpackage 'unstable' 'foo' 'amd64,i386' '1' 'Multi-Arch: allowed' @@ -63,20 +64,23 @@ Inst needsfoo:i386 (1 unstable [i386]) Conf foo:i386 (1 unstable [i386]) Conf needsfoo:i386 (1 unstable [i386])' aptget install needsfoo:i386 -s # FIXME: same problem, but two different unmet dependency messages depending on install order +testfailuremsg "E: Conflict: -> needsfoo:i386=1 but foo:amd64=1 -> not foo:i386=1 -> not needsfoo:i386=1" aptget install needsfoo:i386 foo:amd64 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: foo : Conflicts: foo:i386 but 1 is to be installed foo:i386 : Conflicts: foo but 1 is to be installed -E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s +E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s --solver internal +testfailuremsg "E: Conflict: -> needsfoo:i386=1 but foo:amd64=1 -> not foo:i386=1 -> not needsfoo:i386=1" aptget install foo:amd64 needsfoo:i386 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: needsfoo:i386 : Depends: foo:i386 but it is not installable -E: Unable to correct problems, you have held broken packages." aptget install foo:amd64 needsfoo:i386 -s +E: Unable to correct problems, you have held broken packages." aptget install foo:amd64 needsfoo:i386 -s --solver internal +testfailuremsg "E: Conflict: -> needsfoo:amd64=1 but foo:i386=1 -> not foo:amd64=1 -> not needsfoo:amd64=1" aptget install needsfoo foo:i386 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: foo : Conflicts: foo:i386 but 1 is to be installed foo:i386 : Conflicts: foo but 1 is to be installed -E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s +E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s --solver internal solveableinsinglearch1() { testsuccessequal "Reading package lists... @@ -127,6 +131,16 @@ Conf $1 (1 unstable [amd64])" aptget install $1 foo:i386 -s testneedsfooallgood 'needsfooany' testneedsfooallgood 'needsfoover1' +if [ "$APT_SOLVER" = "3.0" ]; then +NEEDSFOO2NATIVE="$BADPREFIX +The following packages have unmet dependencies: + needsfoover2 : Depends: foo:any (>= 2) +E: Unsatisfiable dependency group needsfoover2:amd64=1 -> foo:any:any" +NEEDSFOO2FOREIGN="$BADPREFIX +The following packages have unmet dependencies: + needsfoover2:i386 : Depends: foo:any (>= 2) +E: Unsatisfiable dependency group needsfoover2:i386=1 -> foo:any:any" +else NEEDSFOO2NATIVE="$BADPREFIX The following packages have unmet dependencies: needsfoover2 : Depends: foo:any (>= 2) @@ -135,32 +149,38 @@ NEEDSFOO2FOREIGN="$BADPREFIX The following packages have unmet dependencies: needsfoover2:i386 : Depends: foo:any (>= 2) E: Unable to correct problems, you have held broken packages." +fi testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 -s testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 foo:i386 -s testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 foo:i386 -s solveableinsinglearch2() { + testfailuremsg 'E: Conflict: hatesfoo:amd64=1 -> not foo:amd64=1 but foo:amd64=1' aptget install foo hatesfoo -s --solver 3.0 + testfailuremsg 'E: Conflict: hatesfooany:amd64=1 -> not foo:amd64=1 but foo:amd64=1' aptget install foo hatesfooany -s --solver 3.0 + testfailuremsg 'E: Conflict: hatesfoonative:amd64=1 -> not foo:amd64=1 but foo:amd64=1' aptget install foo hatesfoonative -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfoo : Conflicts: foo but 1 is to be installed -E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s +E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s --solver internal # the message differs slightly between single and multiarch - testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install foo hatesfooany -s + testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install foo hatesfooany -s --solver internal testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfoonative : Conflicts: foo:amd64 -E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoonative -s +E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoonative -s --solver internal } solveableinsinglearch2 +testfailuremsg "E: Conflict: hatesfoo:amd64=1 -> not foo:i386=1 but foo:i386=1" aptget install foo:i386 hatesfoo -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfoo : Conflicts: foo:i386 but 1 is to be installed -E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfoo -s +E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfoo -s --solver internal +testfailuremsg "E: Conflict: hatesfooany:amd64=1 -> not foo:i386=1 but foo:i386=1" aptget install foo:i386 hatesfooany -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfooany : Conflicts: foo:any -E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s +E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: @@ -171,11 +191,12 @@ Inst hatesfoonative (1 unstable [amd64]) Conf foo:i386 (1 unstable [i386]) Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative -s +testfailuremsg "E: Unsatisfiable dependency group needscoolfoo:i386=1 -> coolfoo:i386" aptget install needscoolfoo:i386 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: needscoolfoo:i386 : Depends: coolfoo:i386 but it is not installable Depends: coolbar:i386 but it is not installable -E: Unable to correct problems, you have held broken packages." aptget install needscoolfoo:i386 -s +E: Unable to correct problems, you have held broken packages." aptget install needscoolfoo:i386 -s --solver internal solveneedscoolfooanyin() { local NEEDSCOOL='needscoolfooany' if [ "$1" != 'amd64' ]; then NEEDSCOOL="${NEEDSCOOL}:$1"; fi @@ -243,15 +264,17 @@ Inst needscoolfoover1 (1 unstable [amd64]) Conf coolfoo (1 unstable [amd64]) Conf coolfoover (1 unstable [amd64]) Conf needscoolfoover1 (1 unstable [amd64])' aptget install needscoolfoover1 -s + testfailuremsg "E: Unsatisfiable dependency group needscoolfoover2:amd64=1 -> coolfoo:any:any" aptget install needscoolfoover2 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: needscoolfoover2 : Depends: coolfoo:any (>= 2) -E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s +E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s --solver internal + testfailuremsg "E: Unsatisfiable dependency group needscoolfoover3:amd64=1 -> coolfoo:any:any" aptget install needscoolfoover3 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: needscoolfoover3 : Depends: coolfoo:any (>= 2) Depends: coolbar:any (>= 3) -E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s +E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s --solver internal } solveableinsinglearch3 diff --git a/test/integration/test-multiarch-barbarian b/test/integration/test-multiarch-barbarian index 293f227..b897834 100755 --- a/test/integration/test-multiarch-barbarian +++ b/test/integration/test-multiarch-barbarian @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' buildsimplenativepackage 'foreign-foo' 'amd64,i386' '1' 'stable' 'Multi-Arch: foreign diff --git a/test/integration/test-multiarch-foreign b/test/integration/test-multiarch-foreign index 713b27b..228fa88 100755 --- a/test/integration/test-multiarch-foreign +++ b/test/integration/test-multiarch-foreign @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' 'armel' insertpackage 'unstable' 'cool-foo' 'amd64,i386' '1.0' 'Depends: foo' @@ -178,16 +179,18 @@ 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: ' + testfailuremsg "E: Conflict: -> ${1%:*}:$4=1.0 but hates-foo:amd64=1.0 -> not ${1%:*}:$4=1.0" aptget install $1 hates-foo -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: hates-foo : Conflicts: foo Conflicts: foo:i386 Conflicts: foo:armel -E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo -s +E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo -s --solver internal + testfailuremsg "E: Conflict: $2:amd64=1.0 -> not foo:$4=1.0 but foo:$4=1.0" aptget install $1 $2 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: $2 : Conflicts: foo:$4 -E: Unable to correct problems, you have held broken packages." aptget install $1 $2 -s +E: Unable to correct problems, you have held broken packages." aptget install $1 $2 -s --solver internal testsuccessequal "Reading package lists... Building dependency tree... The following NEW packages will be installed: diff --git a/test/integration/test-not-upgrading-removed-depends b/test/integration/test-not-upgrading-removed-depends index 54b2042..c7d67af 100755 --- a/test/integration/test-not-upgrading-removed-depends +++ b/test/integration/test-not-upgrading-removed-depends @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' insertpackage 'unstable' 'untouchable-for-solving' 'all' '1' 'Conflicts: main' diff --git a/test/integration/test-prefer-higher-priority-providers b/test/integration/test-prefer-higher-priority-providers index 7c3f323..6f07db5 100755 --- a/test/integration/test-prefer-higher-priority-providers +++ b/test/integration/test-prefer-higher-priority-providers @@ -90,6 +90,10 @@ Inst awesome (1 unstable [all]) Conf baz (1 unstable [all]) Conf awesome (1 unstable [all])" aptget install awesome foo- bar- -s +testfailuremsg "E: Unsatisfiable dependency: awesome:amd64=1 -> foo:amd64=1 | bar:amd64=1 | baz:amd64=1 +E: Not considered: foo:amd64=1: not foo:amd64 -> not foo:amd64=1 +E: Not considered: bar:amd64=1: not bar:amd64 -> not bar:amd64=1 +E: Not considered: baz:amd64=1: not baz:amd64 -> not baz:amd64=1" aptget install awesome foo- bar- baz- -s --solver 3.0 testfailureequal "Reading package lists... Building dependency tree... Package 'foo' is not installed, so not removed @@ -103,4 +107,4 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: awesome : Depends: stuff -E: Unable to correct problems, you have held broken packages." aptget install awesome foo- bar- baz- -s +E: Unable to correct problems, you have held broken packages." aptget install awesome foo- bar- baz- -s --solver internal diff --git a/test/integration/test-resolver-delays-remove-decisions b/test/integration/test-resolver-delays-remove-decisions index a069954..062a2e7 100755 --- a/test/integration/test-resolver-delays-remove-decisions +++ b/test/integration/test-resolver-delays-remove-decisions @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' insertinstalledpackage 'stuff' 'all' '1' @@ -21,6 +22,18 @@ setupaptarchive # as we do not question the remove later on testsuccessequal "Reading package lists... Building dependency tree... +The following additional packages will be installed: + bar +The following NEW packages will be installed: + bar foobar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf bar (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar -s + +testsuccessequal "Reading package lists... +Building dependency tree... MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1 Installing foo:amd64 as Depends of foobar:amd64 Delayed Removing: stuff:amd64 as upgrade is not an option for foo:amd64 (1) @@ -41,12 +54,29 @@ The following NEW packages will be installed: Inst bar (1 unstable [all]) Inst foobar (1 unstable [all]) Conf bar (1 unstable [all]) -Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 +Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 --solver internal insertinstalledpackage 'uninstallable' 'all' '1' testsuccessequal "Reading package lists... Building dependency tree... +The following additional packages will be installed: + foo foo-dep +The following packages will be REMOVED: + stuff +The following NEW packages will be installed: + foo foo-dep foobar +0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded. +Remv stuff [1] +Inst foo-dep (1 unstable [all]) +Inst foo (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf foo-dep (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar -s + +testsuccessequal "Reading package lists... +Building dependency tree... MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1 Installing foo:amd64 as Depends of foobar:amd64 Delayed Removing: stuff:amd64 as upgrade is not an option for foo:amd64 (1) @@ -71,11 +101,29 @@ Inst foo (1 unstable [all]) Inst foobar (1 unstable [all]) Conf foo-dep (1 unstable [all]) Conf foo (1 unstable [all]) -Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 +Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 --solver internal # Same solution but the installs are considered protected now as there is no other solution testsuccessequal "Reading package lists... Building dependency tree... +Package 'bar' is not installed, so not removed +The following additional packages will be installed: + foo foo-dep +The following packages will be REMOVED: + stuff +The following NEW packages will be installed: + foo foo-dep foobar +0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded. +Remv stuff [1] +Inst foo-dep (1 unstable [all]) +Inst foo (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf foo-dep (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar bar- -q=0 -s + +testsuccessequal "Reading package lists... +Building dependency tree... MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1 Installing foo:amd64 as Depends of foobar:amd64 Removing: stuff:amd64 as upgrade is not an option for foo:amd64 (1) @@ -103,4 +151,4 @@ Inst foo (1 unstable [all]) Inst foobar (1 unstable [all]) Conf foo-dep (1 unstable [all]) Conf foo (1 unstable [all]) -Conf foobar (1 unstable [all])" apt install foobar bar- -q=0 -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 +Conf foobar (1 unstable [all])" apt install foobar bar- -q=0 -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 --solver internal diff --git a/test/integration/test-resolver-provider-exchange b/test/integration/test-resolver-provider-exchange index 0a85db3..45d9369 100755 --- a/test/integration/test-resolver-provider-exchange +++ b/test/integration/test-resolver-provider-exchange @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' insertinstalledpackage 'fuse' 'all' '2' diff --git a/test/integration/test-specific-architecture-dependencies b/test/integration/test-specific-architecture-dependencies index 447e407..ca39f18 100755 --- a/test/integration/test-specific-architecture-dependencies +++ b/test/integration/test-specific-architecture-dependencies @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' insertpackage 'unstable' 'libc6' 'amd64,i386' '1' 'Multi-Arch: same' @@ -193,6 +194,7 @@ The following NEW packages will be installed: Inst foo-depender (1 unstable [amd64]) Conf foo-depender (1 unstable [amd64])' aptget install foo-depender -s +testfailuremsg 'E: Unsatisfiable dependency group foo-depender:i386=1 -> foo:i386' aptget install foo-depender:i386 -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -203,7 +205,7 @@ 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 +E: Unable to correct problems, you have held broken packages.' aptget install foo-depender:i386 -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... @@ -311,6 +313,7 @@ Remv libold [1] Inst breaker-x64 (1 unstable [amd64]) Conf breaker-x64 (1 unstable [amd64])' aptget install breaker-x64:amd64 -s +testfailuremsg 'E: Unsatisfiable dependency group depender-x32:amd64=1 -> libc6:i386:any' aptget install depender-x32 -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -321,4 +324,4 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: depender-x32 : Depends: libc6:i386 but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget install depender-x32 -s +E: Unable to correct problems, you have held broken packages.' aptget install depender-x32 -s --solver internal diff --git a/test/integration/test-ubuntu-bug-1974196 b/test/integration/test-ubuntu-bug-1974196 index 7c38723..08dccff 100755 --- a/test/integration/test-ubuntu-bug-1974196 +++ b/test/integration/test-ubuntu-bug-1974196 @@ -22,6 +22,19 @@ noprogress() { testsuccessequal "Reading package lists... Building dependency tree... +The following additional packages will be installed: + depends pkg1 +The following packages will be upgraded: + depends pkg0 pkg1 +3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst depends [1] (2 unstable [all]) [] +Inst pkg0 [1] (2 unstable [all]) [] +Inst pkg1 [1] (2 unstable [all]) +Conf depends (2 unstable [all]) +Conf pkg0 (2 unstable [all]) +Conf pkg1 (2 unstable [all])" aptget install pkg0 -s +testsuccessequal "Reading package lists... +Building dependency tree... Upgrading: depends:arm64 < 1 | 2 @ii umH Ib > due to depends:arm64 Depends on pkg0:arm64 < 1 -> 2 @ii pumU > (= 1) MarkInstall pkg0:arm64 < 1 -> 2 @ii pumU > FU=1 MarkInstall depends:arm64 < 1 -> 2 @ii umU Ib > FU=0 @@ -40,7 +53,7 @@ Inst pkg0 [1] (2 unstable [all]) [] Inst pkg1 [1] (2 unstable [all]) Conf depends (2 unstable [all]) Conf pkg0 (2 unstable [all]) -Conf pkg1 (2 unstable [all])" aptget install pkg0 -o debug::pkgdepcache::marker=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::AutoInstall=1 -s +Conf pkg1 (2 unstable [all])" aptget install pkg0 -o debug::pkgdepcache::marker=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::AutoInstall=1 -s --solver internal testsuccessequal "Percentage: 0 Message: Start up solver… diff --git a/test/integration/test-unpack-different-version-unpacked b/test/integration/test-unpack-different-version-unpacked index e7da64c..810e2e9 100755 --- a/test/integration/test-unpack-different-version-unpacked +++ b/test/integration/test-unpack-different-version-unpacked @@ -14,14 +14,24 @@ cleanstatus() { rm rootdir/var/cache/apt/*.bin } -#FIXME: the reported version is wrong, it should be 1, not 2 insertinstalledpackage 'libqtcore4' 'i386,amd64' '1' 'Multi-Arch: same' '' 'install ok unpacked' +#FIXME(internal): the reported version is wrong, it should be 1, not 2 testsuccessequal 'Reading package lists... Building dependency tree... 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. 2 not fully installed or removed. Conf libqtcore4 (2 unstable [amd64]) -Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f +Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f --solver internal + +# FIXED(3.0): the reported version is correct now +testsuccessequal 'Reading package lists... +Building dependency tree... +Solving dependencies... +0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. +2 not fully installed or removed. +Conf libqtcore4 (1 [amd64]) +Conf libqtcore4:i386 (1 [i386])' aptget install -s -f --solver 3.0 + cleanstatus insertinstalledpackage 'libqtcore4' 'amd64' '2' 'Multi-Arch: same' '' 'install ok unpacked' diff --git a/test/libapt/parsedepends_test.cc b/test/libapt/parsedepends_test.cc index 9771c5d..296750b 100644 --- a/test/libapt/parsedepends_test.cc +++ b/test/libapt/parsedepends_test.cc @@ -311,3 +311,55 @@ TEST(ParseDependsTest, SpaceHate) EXPECT_EQ("1", Version); EXPECT_EQ(pkgCache::Dep::Equals, Op); } + +static void ArchLimitSpaceTesting(char const * const Depends) +{ + SCOPED_TRACE(Depends); + _config->Set("APT::Architecture", "amd64"); + const char* const End = Depends + strlen(Depends); + const char* Start = Depends; + std::string Package; + std::string Version; + unsigned int Op = 29; + + Start = debListParser::ParseDepends(Start, End, Package, Version, Op, true, false, true, "amd64"); + EXPECT_NE(nullptr, Start); + EXPECT_EQ("foobar", Package); + EXPECT_EQ("", Version); + EXPECT_EQ(pkgCache::Dep::NoOp, Op); + + Start = debListParser::ParseDepends(Start, End, Package, Version, Op, true, false, true, "amd64"); + EXPECT_NE(nullptr, Start); + EXPECT_EQ("", Package); + EXPECT_EQ("", Version); + EXPECT_EQ(pkgCache::Dep::NoOp, Op); + + Start = debListParser::ParseDepends(Start, End, Package, Version, Op, true, false, true, "amd64"); + EXPECT_EQ(End, Start); + EXPECT_EQ("baz", Package); + EXPECT_EQ("", Version); + EXPECT_EQ(pkgCache::Dep::NoOp, Op); +} +TEST(ParseDependsTest, ArchLimitSpaceNormal) +{ + ArchLimitSpaceTesting("foobar [i386 armhf armel amd64], blah [!arm64 !x32 !amd64], baz"); +} +TEST(ParseDependsTest, ArchLimitSpaceLove) +{ + ArchLimitSpaceTesting("foobar [ i386 armhf armel amd64 ] , blah [ !arm64 !x32 !amd64 ] , baz"); +} +TEST(ParseDependsTest, ArchLimitSpaceNoLove) +{ + ArchLimitSpaceTesting("foobar[i386 armhf armel amd64],blah[!arm64 !x32 !amd64],baz"); +} +TEST(ParseDependsTest, ArchLimitBadSyntax) +{ + std::string Package; + std::string Version; + unsigned int Op = 29; + for (auto const * const Depends : { "foobar [! amd64]", "foobar []", "foobar [ ]" }) + { + SCOPED_TRACE(Depends); + EXPECT_EQ(nullptr, debListParser::ParseDepends(Depends, Depends + strlen(Depends), Package, Version, Op, true, false, true, "amd64")); + } +} |