summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2020-05-04 09:28:11 +0000
committerJulian Andres Klode <jak@debian.org>2020-05-04 09:28:11 +0000
commit6e6a9331e6d27d371844ec98775619328526f33d (patch)
tree6201c01507e3db1e897918f3b8a03701bbca708f /test
parent9064a832bf2f02e2fd26c62ee867dd779797235a (diff)
parentae23e53f99ea0b7920744a7303fdee64796b7cce (diff)
Merge branch 'feature/markinstall' into 'master'
Refactor MarkInstall fixing various or-group handling issues See merge request apt-team/apt!117
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-allow-scores-for-all-dependency-types34
-rwxr-xr-xtest/integration/test-apt-never-markauto-sections11
-rwxr-xr-xtest/integration/test-bug-604222-new-and-autoremove3
-rwxr-xr-xtest/integration/test-bug-618848-always-respect-user-requests2
-rwxr-xr-xtest/integration/test-bug-735967-lib32-to-i386-unavailable4
-rwxr-xr-xtest/integration/test-explore-or-groups-in-markinstall84
-rwxr-xr-xtest/integration/test-multiarch-allowed11
7 files changed, 103 insertions, 46 deletions
diff --git a/test/integration/test-allow-scores-for-all-dependency-types b/test/integration/test-allow-scores-for-all-dependency-types
index 9b300b7a7..b8a9ed3ea 100755
--- a/test/integration/test-allow-scores-for-all-dependency-types
+++ b/test/integration/test-allow-scores-for-all-dependency-types
@@ -116,42 +116,18 @@ Conf baz (2 unversioned [amd64])' aptget install baz -st unversioned
testsuccessequal 'Reading package lists...
Building dependency tree...
The following additional packages will be installed:
- foo
-The following packages will be REMOVED:
bar
-The following NEW packages will be installed:
- baz
-The following packages will be upgraded:
- foo
-1 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
-Remv bar [1]
-Inst foo [1] (2 versioned [amd64])
-Inst baz (2 versioned [amd64])
-Conf foo (2 versioned [amd64])
-Conf baz (2 versioned [amd64])' aptget install baz -st versioned
-
-testsuccessequal 'Reading package lists...
-Building dependency tree...
-The following NEW packages will be installed:
- baz
-0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
-Inst baz (2 unversioned [amd64])
-Conf baz (2 unversioned [amd64])' aptget install baz -st unversioned
-testsuccessequal 'Reading package lists...
-Building dependency tree...
-The following additional packages will be installed:
- foo
The following packages will be REMOVED:
- bar
+ foo
The following NEW packages will be installed:
baz
The following packages will be upgraded:
- foo
+ bar
1 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
-Remv bar [1]
-Inst foo [1] (2 versioned [amd64])
+Remv foo [1]
+Inst bar [1] (2 versioned [amd64])
Inst baz (2 versioned [amd64])
-Conf foo (2 versioned [amd64])
+Conf bar (2 versioned [amd64])
Conf baz (2 versioned [amd64])' aptget install baz -st versioned
# recreating the exact situation is hard, so we pull tricks to get the score
diff --git a/test/integration/test-apt-never-markauto-sections b/test/integration/test-apt-never-markauto-sections
index aa145d217..6ad89c506 100755
--- a/test/integration/test-apt-never-markauto-sections
+++ b/test/integration/test-apt-never-markauto-sections
@@ -27,7 +27,7 @@ testsuccess aptcache show nosection
testfailure grep 'Section' rootdir/tmp/testsuccess.output
testequal 'dpkg' aptmark showmanual
-testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1
+testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1
testmarkedmanual 'dpkg' 'mydesktop'
testmarkedauto 'mydesktop-core' 'foreignpkg:i386' 'texteditor' 'browser' 'nosection'
@@ -75,12 +75,7 @@ testsuccess aptmark auto nosection
testmarkedauto 'browser' 'nosection'
testmarkedmanual 'dpkg' 'foreignpkg:i386'
-# nosection should be auto, not manual, but is marked as such by the resolver
-# removing mydesktop-core temporally… the resolver should be figuring out here
-# that there is no point of removing mydesktop-core as its an unavoidable
-# dependency of the user-requested mydesktop
-
testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1
-testmarkedmanual 'dpkg' 'foreignpkg:i386' 'mydesktop' 'nosection'
-testmarkedauto 'browser' 'mydesktop-core' 'texteditor'
+testmarkedmanual 'dpkg' 'foreignpkg:i386' 'mydesktop'
+testmarkedauto 'browser' 'mydesktop-core' 'texteditor' 'nosection'
diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove
index b8faf4fe6..6009ca0d2 100755
--- a/test/integration/test-bug-604222-new-and-autoremove
+++ b/test/integration/test-bug-604222-new-and-autoremove
@@ -88,12 +88,13 @@ rm -f rootdir/var/lib/apt/extended_states
CONFLICTING='Reading package lists...
Building dependency tree...
MarkInstall dummy-archive:i386 < none -> 0.invalid.0 @un puN Ib > FU=1
- MarkInstall libavcodec52:i386 < none -> 4:0.5.2-6 @un uN > FU=0
MarkInstall libvtk5-dev:i386 < none -> 5.4.2-8 @un uN Ib > FU=0
MarkInstall libvtk5.4:i386 < none -> 5.4.2-8 @un uN > FU=0
MarkKeep libvtk5-dev:i386 < none -> 5.4.2-8 @un uN > FU=0
MarkKeep libvtk5-dev:i386 < none -> 5.4.2-8 @un uN > FU=0
+ Ignore MarkGarbage of libavcodec52:i386 < none -> 4:0.5.2-6 @un puN > as its mode (Install) is protected
MarkDelete libvtk5.4:i386 < none -> 5.4.2-8 @un ugN > FU=0
+ Ignore MarkGarbage of libavcodec52:i386 < none -> 4:0.5.2-6 @un puN > as its mode (Install) is protected
The following additional packages will be installed:
libavcodec52 libopenal-dev
The following NEW packages will be installed:
diff --git a/test/integration/test-bug-618848-always-respect-user-requests b/test/integration/test-bug-618848-always-respect-user-requests
index fa190a93d..230683a99 100755
--- a/test/integration/test-bug-618848-always-respect-user-requests
+++ b/test/integration/test-bug-618848-always-respect-user-requests
@@ -18,8 +18,6 @@ Building dependency tree...
MarkDelete libdb4.8:i386 < 1.0 @ii pmK > FU=1
MarkDelete exim4-daemon-light:i386 < 1.0 @ii mK Ib > FU=0
MarkInstall exim4-daemon-heavy:i386 < none -> 1.0 @un uN Ib > FU=0
- Ignore MarkInstall of libdb4.8:i386 < 1.0 @ii pmR > as its mode (Delete) is protected
- MarkDelete exim4-daemon-heavy:i386 < none -> 1.0 @un uN Ib > FU=0
MarkDelete exim4:i386 < 1.0 @ii mK Ib > FU=0
The following packages will be REMOVED:
exim4 exim4-daemon-light libdb4.8
diff --git a/test/integration/test-bug-735967-lib32-to-i386-unavailable b/test/integration/test-bug-735967-lib32-to-i386-unavailable
index 3b705d5f9..9dbd17bfd 100755
--- a/test/integration/test-bug-735967-lib32-to-i386-unavailable
+++ b/test/integration/test-bug-735967-lib32-to-i386-unavailable
@@ -52,8 +52,8 @@ or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
- foo : Depends: libfoo but it is not going to be installed
-E: Unable to correct problems, you have held broken packages.' aptget install foo -s
+ libfoo : Depends: libfoo-bin but it is not installable
+E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' aptget install foo -s
# activate multiarch
configarchitecture 'amd64' 'i386'
diff --git a/test/integration/test-explore-or-groups-in-markinstall b/test/integration/test-explore-or-groups-in-markinstall
new file mode 100755
index 000000000..5669e47b3
--- /dev/null
+++ b/test/integration/test-explore-or-groups-in-markinstall
@@ -0,0 +1,84 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'amd64'
+
+insertpackage 'unstable' 'okay' 'all' '1'
+insertpackage 'unstable' 'upgrade' 'all' '2'
+insertpackage 'unstable' 'unneeded' 'all' '1'
+insertpackage 'unstable' 'later' 'all' '1'
+
+insertpackage 'unstable' 'bad-level0' 'all' '1' 'Depends: unneeded, unknown'
+insertpackage 'unstable' 'bad-level1' 'all' '1' 'Depends: bad-level0'
+insertpackage 'unstable' 'bad-upgrade-level0' 'all' '2' 'Depends: unneeded, unknown'
+insertpackage 'unstable' 'bad-upgrade-level1' 'all' '2' 'Depends: bad-upgrade-level0 (>= 2)'
+insertpackage 'unstable' 'bad-conflict-level0' 'all' '1' 'Depends: unneeded
+Conflicts: bad-conflict-level2'
+insertpackage 'unstable' 'bad-conflict-level1' 'all' '1' 'Depends: bad-conflict-level0'
+insertpackage 'unstable' 'bad-conflict-level2' 'all' '1' 'Depends: bad-conflict-level1'
+
+insertinstalledpackage 'upgrade' 'all' '1'
+insertinstalledpackage 'bad-upgrade' 'all' '1'
+insertinstalledpackage 'bad-upgrade-level0' 'all' '1'
+insertinstalledpackage 'bad-upgrade-level1' 'all' '1'
+
+insertfoos() {
+ insertpackage 'unstable' "foo-${1}-level0" 'all' '1' "${2}: unknown | unknown | okay | later"
+ insertpackage 'unstable' "foo-${1}-level1" 'all' '1' "${2}: bad-level0 | bad-level0 | okay | later"
+ insertpackage 'unstable' "foo-${1}-level2" 'all' '1' "${2}: bad-level1 | bad-level1 | okay | later"
+
+ insertpackage 'unstable' "foo-${1}-upgrade-level0" 'all' '1' "${2}: bad-upgrade (>= 2) | okay | upgrade (>= 2) | later"
+ insertpackage 'unstable' "foo-${1}-upgrade-level1" 'all' '1' "${2}: bad-upgrade-level0 (>= 2) | bad-upgrade-level0 (>= 2) | bad-level0 | okay | upgrade (>= 2) | later"
+ insertpackage 'unstable' "foo-${1}-upgrade-level2" 'all' '1' "${2}: bad-upgrade-level1 (>= 2) | bad-upgrade-level1 (>= 2) | bad-level1 | okay | upgrade (>= 2) | later"
+
+ insertpackage 'unstable' "foo-${1}-conflict" 'all' '1' "${2}: unknown | bad-conflict-level2 | okay | later"
+}
+insertfoos 'd' 'Depends'
+insertfoos 'r' 'Recommends'
+
+setupaptarchive
+
+testsuccessheadequal() {
+ msggroup 'testsuccessheadequal'
+ local HEADLINES="$1"
+ local CMP="$2"
+ shift 2
+ testsuccesswithglobalerror 'testsuccess' 'EW' "$@"
+ cp "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccessheadequal.output"
+ testsuccessequal "$CMP" head -n "$HEADLINES" "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccessheadequal.output"
+ msggroup
+}
+checkfoos() {
+ msgmsg 'Install checks with foos dependency type' "$2"
+ for level in 0 1 2; do
+ testsuccessheadequal 7 "Reading package lists...
+Building dependency tree...
+The following additional packages will be installed:
+ okay
+The following NEW packages will be installed:
+ foo-${1}-level${level} okay
+0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded." apt install foo-${1}-level${level} -s
+ testsuccessheadequal 9 "Reading package lists...
+Building dependency tree...
+The following additional packages will be installed:
+ upgrade
+The following NEW packages will be installed:
+ foo-${1}-upgrade-level${level}
+The following packages will be upgraded:
+ upgrade
+1 upgraded, 1 newly installed, 0 to remove and $((2-${level})) not upgraded." apt install foo-${1}-upgrade-level${level} -s
+ done
+
+ testsuccessheadequal 7 "Reading package lists...
+Building dependency tree...
+The following additional packages will be installed:
+ okay
+The following NEW packages will be installed:
+ foo-${1}-conflict okay
+0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded." apt install foo-${1}-conflict -s
+}
+checkfoos 'd' 'Depends'
+checkfoos 'r' 'Recommends'
diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed
index 98555bc73..b74853993 100755
--- a/test/integration/test-multiarch-allowed
+++ b/test/integration/test-multiarch-allowed
@@ -64,12 +64,15 @@ Conf foo:i386 (1 unstable [i386])
Conf needsfoo:i386 (1 unstable [i386])' aptget install needsfoo:i386 -s
testfailureequal "$BADPREFIX
The following packages have unmet dependencies:
- needsfoo:i386 : Depends: foo:i386 but it is not going to be installed
-E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s
+ foo : Conflicts: foo:i386 but 1 is to be installed
+ foo:i386 : Conflicts: foo but 1 is to be installed
+E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages." aptget install needsfoo:i386 foo:amd64 -s
testfailureequal "$BADPREFIX
The following packages have unmet dependencies:
- needsfoo : Depends: foo but it is not going to be installed
-E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s
+ foo : Conflicts: foo:i386 but 1 is to be installed
+ foo:i386 : Conflicts: foo but 1 is to be installed
+E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages." aptget install needsfoo foo:i386 -s
+exit
solveableinsinglearch1() {
testsuccessequal "Reading package lists...