From 6c112f9860c1730237029f4e23d40bf658d73704 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 9 Mar 2025 13:55:23 +0100 Subject: Print --solver 3.0 explanation if both internal and it failed This can provide useful additional context. To avoid updating the whole test suite for it, introduce a new option `quiet::NoSolver3Explanation` and set it by default. All the other tests that assert output will already have matching tests for --solver 3.0 with the correct messages asserted, it makes no sense to duplicate them. --- test/integration/framework | 2 ++ test/integration/test-solver3-evaluation | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index d2570b6b2..3f0290569 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -589,6 +589,8 @@ EOF echo 'DPkg::Path "";' >> aptconfig.conf echo 'Dir::Bin::ischroot "/bin/false";' >> aptconfig.conf + echo 'quiet::NoSolver3Explanation "true";' > rootdir/etc/apt/apt.conf.d/disable-solver3-context + # most tests just need one signed Release file, not both export APT_DONT_SIGN='Release.gpg' diff --git a/test/integration/test-solver3-evaluation b/test/integration/test-solver3-evaluation index d3521e9c6..af12698b5 100755 --- a/test/integration/test-solver3-evaluation +++ b/test/integration/test-solver3-evaluation @@ -16,6 +16,7 @@ insertpackage 'unstable' 'c' 'all' '3' setupaptarchive +rm rootdir/etc/apt/apt.conf.d/disable-solver3-context mkdir rootdir/var/log/apt testsuccess aptget install y x --solver internal -s -o Dir::Apport=var/crash @@ -217,4 +218,22 @@ APT-Pin: 100 APT-Candidate: yes " cat rootdir/var/log/apt/edsp.log - +testfailureequal "Reading package lists... +Building dependency tree... +Package 'c' is not installed, so not removed +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: + a : Depends: c but it is not going to be installed +E: Unable to correct problems, you have held broken packages. +E: The following information from --solver 3.0 may provide additional context: + Unable to satisfy dependencies. Reached two conflicting decisions: + 1. a:amd64=3 is selected for install + 2. a:amd64 Depends c + but none of the choices are installable: + - c:amd64 is not selected for install" apt install -s a c- --solver internal -- cgit v1.2.3-70-g09d2