diff options
| author | Julian Andres Klode <jak@debian.org> | 2025-05-19 14:17:23 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-05-19 15:20:09 +0000 |
| commit | 7724d170751b3dc1717ba7a08881437cf7151996 (patch) | |
| tree | 9f76923fbd5b856904a414fa615116940d2afff6 /test/integration/test-apt-cli-why | |
| parent | 2ddc16b9f8edff1329f5ac3e46b0c0cf9bde661d (diff) | |
Introduce apt why, apt why-not
These are implemented somewhat differently from aptitudes
why and why-not commands: They produce the actual solver
trace for why a particular decision has been taken.
For the why-not case, we need to explicitly discover our
specified package, as if nothing else depends on it in
our graph, it would otherwise always be undiscovered and
conflicts not detected (see e.g. level-3 in the test).
Diffstat (limited to 'test/integration/test-apt-cli-why')
| -rwxr-xr-x | test/integration/test-apt-cli-why | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/test/integration/test-apt-cli-why b/test/integration/test-apt-cli-why new file mode 100755 index 000000000..8a4c94b30 --- /dev/null +++ b/test/integration/test-apt-cli-why @@ -0,0 +1,71 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'root' 'all' '1' 'Depends: level-1' +insertinstalledpackage 'level-1' 'all' '1' 'Depends: level-2' +insertinstalledpackage 'level-2' 'all' '1' 'Depends: level-2' +insertpackage 'unstable' 'other-level-2' 'all' '1' 'Conflicts: level-2 +Provides: level-2' +insertpackage 'unstable' 'almost-level-2' 'all' '1' 'Conflicts: level-2' +insertpackage 'unstable' 'level-3' 'all' '1' 'Conflicts: level-3' +setupaptarchive + +testsuccess aptmark auto level-1 level-2 + + +testsuccessequal "level-2:amd64=1 is selected for install because: +1. root:amd64 is selected for install +2. root:amd64 Depends level-1 +3. level-1:amd64 Depends level-2 + [selected level-1:amd64] +For context, additional choices that could not be installed: +* In level-1:amd64 Depends level-2: + - other-level-2:amd64=1 -> | other-level-2:amd64 + but none of the choices are installable: + - other-level-2:amd64 is not selected for install because: + 1-3. level-2:amd64=1 is selected for install as above + 4. other-level-2:amd64 Conflicts level-2 + For context, additional choices that could not be installed: + * In level-1:amd64 Depends level-2: + - other-level-2:amd64=1 is not selected for install as above" apt why level-2 + + +testsuccessequal "other-level-2:amd64 is not actually marked for install" apt why other-level-2 +testsuccessequal "other-level-2:amd64 is not selected for install because: +1. root:amd64 is selected for install +2. root:amd64 Depends level-1 +3. level-1:amd64 Depends level-2 + [selected level-2:amd64=1 for install] +4. other-level-2:amd64 Conflicts level-2 +For context, additional choices that could not be installed: +* In level-1:amd64 Depends level-2: + - other-level-2:amd64=1 -> | other-level-2:amd64 + but none of the choices are installable: + - other-level-2:amd64 is not selected for install as above" apt why-not other-level-2 + +testsuccessequal "almost-level-2:amd64 is not actually marked for install" apt why almost-level-2 +testsuccessequal "almost-level-2:amd64 is not selected for install because: +1. root:amd64 is selected for install +2. root:amd64 Depends level-1 +3. level-1:amd64 Depends level-2 + [selected level-2:amd64=1 for install] +4. almost-level-2:amd64 Conflicts level-2 + [selected level-2:amd64=1] +For context, additional choices that could not be installed: +* In level-1:amd64 Depends level-2: + - other-level-2:amd64=1 -> | other-level-2:amd64 + but none of the choices are installable: + - other-level-2:amd64 is not selected for install because: + 1-3. level-2:amd64=1 is selected for install as above + 4. other-level-2:amd64 Conflicts level-2 + For context, additional choices that could not be installed: + * In level-1:amd64 Depends level-2: + - other-level-2:amd64=1 is not selected for install as above" apt why-not almost-level-2 + + +testsuccessequal "level-3:amd64 is undecided" apt why level-3 |
