summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2024-04-26 11:01:17 +0000
committerJulian Andres Klode <jak@debian.org>2024-04-26 11:01:17 +0000
commit05a1ee0cf4d5948ec2a084629bb9712af7d9c475 (patch)
tree91bab74096260d12d8f4a2300bcd84f3bdb17b99 /test/integration
parentedfbc3869361f709d70794a794199ac2076ea9f1 (diff)
parent7a1063e81b855ac7ff9ee54f115843c3af6dd1bf (diff)
Merge branch 'fix/mixed' into 'main'
Split out of mostly independent fixes: cmake execute errors, removed rev-deps, protected garbage & co See merge request apt-team/apt!345
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/framework1
-rwxr-xr-xtest/integration/test-apt-get-autoremove26
-rwxr-xr-xtest/integration/test-bug-604222-new-and-autoremove34
-rwxr-xr-xtest/integration/test-bug-611729-mark-as-manual8
-rwxr-xr-xtest/integration/test-bug-613420-new-garbage-dependency8
-rwxr-xr-xtest/integration/test-disappearing-packages13
-rwxr-xr-xtest/integration/test-external-dependency-solver-protocol6
-rwxr-xr-xtest/integration/test-kernel-helper-autoremove10
-rwxr-xr-xtest/integration/test-not-upgrading-removed-depends50
-rwxr-xr-xtest/integration/test-suggests-promoted-to-recommends65
10 files changed, 161 insertions, 60 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 147de9808..de280cb8d 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -324,6 +324,7 @@ setupenvironment() {
unset DEB_CHECK_COMMAND DEB_SIGN_KEYID DEB_BUILD_OPTIONS DEB_BUILD_PROFILES
unset DH_VERBOSE DH_QUIET DH_COMPAT DH_NO_ACT DH_OPTIONS DH_EXTRA_ADDONS
unset GREP_OPTIONS POSIXLY_CORRECT
+ unset SUDO_USER SUDO_UID SUDO_GID SUDO_COMMAND
unset http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy
export GCOV_ERROR_FILE=/dev/null
diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove
index 66257f442..9454df5c8 100755
--- a/test/integration/test-apt-get-autoremove
+++ b/test/integration/test-apt-get-autoremove
@@ -27,10 +27,6 @@ testdpkginstalled 'po-debconf' 'unrelated'
echo 'unrelated purge' | dpkg --set-selections
testdpkgstatus 'pi' '1' 'unrelated'
-AUTOREMOVE='apt autoremove'
-if [ -n "$SUDO_USER" ]; then
- AUTOREMOVE="sudo $AUTOREMOVE"
-fi
echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
testsuccessequal 'Reading package lists...
Building dependency tree...
@@ -39,20 +35,28 @@ The following packages will be REMOVED:
po-debconf
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Remv po-debconf [1.0.16]' aptget autoremove -s
-testequal "Reading package lists...
+for sudouser in '_apt' ''; do
+ if [ -n "$sudouser" ]; then
+ export SUDO_USER="$sudouser"
+ AUTOREMOVE='sudo apt autoremove'
+ else
+ unset SUDO_USER
+ AUTOREMOVE='apt autoremove'
+ fi
+ testequal "Reading package lists...
Building dependency tree...
Reading state information...
The following package was automatically installed and is no longer required:
po-debconf
Use '$AUTOREMOVE' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s
-testequal "Reading package lists...
+ testequal "Reading package lists...
Building dependency tree...
Reading state information...
1 package was automatically installed and is no longer required.
Use '$AUTOREMOVE' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small
-testequal "Reading package lists...
+ testequal "Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
@@ -60,6 +64,8 @@ The following package was automatically installed and is no longer required:
po-debconf
Use '$AUTOREMOVE' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget upgrade -s
+done
+
testsuccessequal 'Reading package lists...
Building dependency tree...
Reading state information...
@@ -111,7 +117,7 @@ Reading state information...
Calculating upgrade...
The following package was automatically installed and is no longer required:
po-debconf
-Use '$AUTOREMOVE' to remove it.
+Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget upgrade -s
rm -f rootdir/etc/apt/apt.conf.d/autoremoval
@@ -163,13 +169,13 @@ Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
debhelper po-debconf
-Use '$AUTOREMOVE' to remove them.
+Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s
testequal "Reading package lists...
Building dependency tree...
Reading state information...
2 packages were automatically installed and are no longer required.
-Use '$AUTOREMOVE' to remove them.
+Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small
testsuccess aptmark hold debhelper
diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove
index 47da810c6..78a288214 100755
--- a/test/integration/test-bug-604222-new-and-autoremove
+++ b/test/integration/test-bug-604222-new-and-autoremove
@@ -17,26 +17,34 @@ insertpackage 'stable' 'libkf5kipi-bin' 'i386' '4:16.08.0-1'
insertpackage 'stable' 'libkf5kipi-data' 'i386' '4:16.08.0-1' 'Breaks: libkipi-data'
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 'photoapp2' 'all' '1'
+insertpackage 'stable' 'photoapp2' 'all' '2' 'Conflicts: photoapp1
+Recommends: libgphoto2-l10n (= 2)'
+
setupaptarchive
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+Calculating upgrade...
+The following packages have been kept back:
+ photoapp2
+0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.' apt upgrade -s
+
insertinstalledpackage 'libvtk5.4' 'i386' '5.4.2-7'
testsuccess aptmark markauto 'libvtk5.4'
testmarkedauto 'libvtk5.4'
-AUTOREMOVE='apt autoremove'
-if [ -n "$SUDO_USER" ]; then
- AUTOREMOVE="sudo $AUTOREMOVE"
-fi
-
testsuccessequal "Reading package lists...
Building dependency tree...
Reading state information...
The following package was automatically installed and is no longer required:
libvtk5.4
-Use '$AUTOREMOVE' to remove it.
+Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
libavcodec52
-0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
+0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Inst libavcodec52 (4:0.5.2-6 stable [i386])
Conf libavcodec52 (4:0.5.2-6 stable [i386])" aptget install libavcodec52 -s
@@ -44,10 +52,10 @@ testsuccessequal "Reading package lists...
Building dependency tree...
Reading state information...
1 package was automatically installed and is no longer required.
-Use '$AUTOREMOVE' to remove it.
+Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
libavcodec52
-0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
+0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Inst libavcodec52 (4:0.5.2-6 stable [i386])
Conf libavcodec52 (4:0.5.2-6 stable [i386])" aptget install libavcodec52 -s -o APT::Get::HideAutoRemove=small
@@ -56,12 +64,12 @@ Building dependency tree...
Reading state information...
The following package was automatically installed and is no longer required:
libvtk5.4
-Use '$AUTOREMOVE' to remove it.
+Use 'apt autoremove' to remove it.
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 1 not upgraded.
+0 upgraded, 3 newly installed, 0 to remove and 2 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." aptget install dummy-archive --trivial-only
@@ -69,12 +77,12 @@ testequal "Reading package lists...
Building dependency tree...
Reading state information...
1 package was automatically installed and is no longer required.
-Use '$AUTOREMOVE' to remove it.
+Use 'apt autoremove' to remove it.
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 1 not upgraded.
+0 upgraded, 3 newly installed, 0 to remove and 2 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." aptget install dummy-archive --trivial-only -o APT::Get::HideAutoRemove=small
diff --git a/test/integration/test-bug-611729-mark-as-manual b/test/integration/test-bug-611729-mark-as-manual
index 63f8245a7..bd9af32b6 100755
--- a/test/integration/test-bug-611729-mark-as-manual
+++ b/test/integration/test-bug-611729-mark-as-manual
@@ -56,14 +56,8 @@ testdpkginstalled b c
testmarkedauto 'b'
sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d'
-if [ -n "$SUDO_USER" ] && [ "$(id -u "$SUDO_USER")" -gt 0 ]; then
- testfileequal 'rootdir/var/log/apt/history.log' "
-Requested-By: $SUDO_USER ($(id -u "$SUDO_USER"))
-Reinstall: b:i386 (1.0)"
-else
- testfileequal 'rootdir/var/log/apt/history.log' '
+testfileequal 'rootdir/var/log/apt/history.log' '
Reinstall: b:i386 (1.0)'
-fi
testsuccessequal 'Reading package lists...
Building dependency tree...
diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency
index 46c3d94c9..75a653c7e 100755
--- a/test/integration/test-bug-613420-new-garbage-dependency
+++ b/test/integration/test-bug-613420-new-garbage-dependency
@@ -16,17 +16,13 @@ setupaptarchive
touch rootdir/var/lib/apt/extended_states
testsuccess aptmark markauto openoffice.org-officebean
testmarkedauto openoffice.org-officebean
-AUTOREMOVE='apt autoremove'
-if [ -n "$SUDO_USER" ]; then
- AUTOREMOVE="sudo $AUTOREMOVE"
-fi
testfailureequal "Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
libreoffice-officebean openoffice.org-officebean
-Use '$AUTOREMOVE' to remove them.
+Use 'apt autoremove' to remove them.
The following additional packages will be installed:
libreoffice-core libreoffice-officebean openoffice.org-officebean
The following packages will be REMOVED:
@@ -43,7 +39,7 @@ testequal "Reading package lists...
Building dependency tree...
Reading state information...
2 packages were automatically installed and are no longer required.
-Use '$AUTOREMOVE' to remove them.
+Use 'apt autoremove' to remove them.
The following additional packages will be installed:
libreoffice-core libreoffice-officebean openoffice.org-officebean
The following packages will be REMOVED:
diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages
index f3fed04f3..f93e10e74 100755
--- a/test/integration/test-disappearing-packages
+++ b/test/integration/test-disappearing-packages
@@ -60,23 +60,12 @@ all files have been overwritten by other packages:
Note: This is done automatically and on purpose by dpkg.' tail -n 4 disappear.output
sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' -e "s#:$(getarchitecture 'native') #:native #"
-if [ -n "$SUDO_USER" ] && [ "$(id -u "$SUDO_USER")" -gt 0 ]; then
- testfileequal 'rootdir/var/log/apt/history.log' "
-Requested-By: $SUDO_USER ($(id -u "$SUDO_USER"))
-Install: old-pkg:native (1)
-
-Requested-By: $SUDO_USER ($(id -u "$SUDO_USER"))
-Install: new-pkg:native (2, automatic)
-Upgrade: old-pkg:native (1, 2)
-Disappeared: old-pkg (1)"
-else
- testfileequal 'rootdir/var/log/apt/history.log' '
+testfileequal 'rootdir/var/log/apt/history.log' '
Install: old-pkg:native (1)
Install: new-pkg:native (2, automatic)
Upgrade: old-pkg:native (1, 2)
Disappeared: old-pkg (1)'
-fi
testmarkedauto # new-pkg should have get the manual flag from old-pkg
diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol
index 485a77068..ca6a5ae8b 100755
--- a/test/integration/test-external-dependency-solver-protocol
+++ b/test/integration/test-external-dependency-solver-protocol
@@ -113,17 +113,13 @@ Remv somestuff [1]
Remv cool [1]
Remv stuff [1]' aptget autoremove --solver apt somestuff -s
-AUTOREMOVE='apt autoremove'
-if [ -n "$SUDO_USER" ]; then
- AUTOREMOVE="sudo $AUTOREMOVE"
-fi
testsuccessequal "Reading package lists...
Building dependency tree...
Reading state information...
Execute external solver...
The following package was automatically installed and is no longer required:
stuff
-Use '$AUTOREMOVE' to remove it.
+Use 'apt autoremove' to remove it.
The following packages will be REMOVED:
cool* somestuff*
0 upgraded, 0 newly installed, 2 to remove and 1 not upgraded.
diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove
index 208bd1425..20a09685a 100755
--- a/test/integration/test-kernel-helper-autoremove
+++ b/test/integration/test-kernel-helper-autoremove
@@ -45,10 +45,6 @@ testprotected() {
testfailure --nomsg grep -e '^\^linux-image-amd64\$$' -e '^\^linux-image-686-pae\$$' -e ':i386' protected.list
}
-AUTOREMOVE='apt autoremove'
-if [ -n "$SUDO_USER" ]; then
- AUTOREMOVE="sudo $AUTOREMOVE"
-fi
testsuccessequal "Reading package lists...
Building dependency tree...
Reading state information...
@@ -60,7 +56,7 @@ The following packages were automatically installed and are no longer required:
${CURRENTKERNEL}+variant (5-1)
${CURRENTKERNEL}-686-pae:i386 (5-1)
${CURRENTKERNEL}-dbg (5-1)
-Use '$AUTOREMOVE' to remove them.
+Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -sV -o APT::Protect-Kernels=0
testsuccessequal "Reading package lists...
Building dependency tree...
@@ -74,13 +70,13 @@ The following packages were automatically installed and are no longer required:
${CURRENTKERNEL}-686-pae:i386 (5-1)
${CURRENTKERNEL}-dbg (5-1)
${CURRENTKERNEL}-rt (5-1)
-Use '$AUTOREMOVE' to remove them.
+Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -sV --ignore-hold -o APT::Protect-Kernels=0
testequal "Reading package lists...
Building dependency tree...
Reading state information...
7 packages were automatically installed and are no longer required.
-Use '$AUTOREMOVE' to remove them.
+Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small -o APT::Protect-Kernels=0
testequal "Reading package lists...
Building dependency tree...
diff --git a/test/integration/test-not-upgrading-removed-depends b/test/integration/test-not-upgrading-removed-depends
new file mode 100755
index 000000000..54b20422c
--- /dev/null
+++ b/test/integration/test-not-upgrading-removed-depends
@@ -0,0 +1,50 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'amd64'
+
+insertpackage 'unstable' 'untouchable-for-solving' 'all' '1' 'Conflicts: main'
+insertpackage 'installed' 'bad' 'all' '1' 'Depends: main (= 1)'
+insertpackage 'unstable' 'bad' 'all' '2' 'Depends: main (= 2), untouchable-for-solving'
+
+insertpackage 'installed' 'main' 'all' '1'
+insertpackage 'unstable' 'main' 'all' '2' 'Breaks: bad'
+
+insertpackage 'unstable' 'else' 'all' '1'
+insertpackage 'unstable' 'meta' 'all' '1' 'Depends: main (= 2) | else'
+
+setupaptarchive
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ bad
+The following packages will be upgraded:
+ main
+1 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
+Remv bad [1]
+Inst main [1] (2 unstable [all])
+Conf main (2 unstable [all])' apt install -s main
+testsuccess apt install -s main -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1
+testfailure grep 'untouchable-for-solving' rootdir/tmp/testsuccess.output
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+The following additional packages will be installed:
+ main
+The following packages will be REMOVED:
+ bad
+The following NEW packages will be installed:
+ meta
+The following packages will be upgraded:
+ main
+1 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Remv bad [1]
+Inst main [1] (2 unstable [all])
+Inst meta (1 unstable [all])
+Conf main (2 unstable [all])
+Conf meta (1 unstable [all])' apt install -s meta
+testsuccess apt install -s meta -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1
+testfailure grep 'untouchable-for-solving' rootdir/tmp/testsuccess.output
diff --git a/test/integration/test-suggests-promoted-to-recommends b/test/integration/test-suggests-promoted-to-recommends
new file mode 100755
index 000000000..57497f7d9
--- /dev/null
+++ b/test/integration/test-suggests-promoted-to-recommends
@@ -0,0 +1,65 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'oldrec' 'all' '1'
+insertinstalledpackage 'oldsug' 'all' '1'
+insertinstalledpackage 'instreg' 'all' '1'
+insertinstalledpackage 'instsug' 'all' '1'
+
+insertpackage 'unstable' 'unsatrec' 'all' '2'
+insertpackage 'unstable' 'unsatsug' 'all' '2'
+insertpackage 'unstable' 'newrec' 'all' '2'
+insertpackage 'unstable' 'newsug' 'all' '2'
+insertpackage 'unstable' 'promote' 'all' '2'
+
+insertinstalledpackage 'foo' 'all' '1' 'Recommends: oldrec, instrec, unsatrec
+Suggests: oldsug, instsug, unsatsug, promote'
+insertpackage 'unstable' 'foo' 'all' '2' 'Recommends: instrec, unsatrec, promote, newrec
+Suggests: instsug, unsatsug, newsug'
+
+setupaptarchive
+
+testsuccess aptmark auto oldrec instrec oldsug instsug
+
+testsuccessequal "Reading package lists...
+Building dependency tree...
+Reading state information...
+Calculating upgrade...
+The following packages were automatically installed and are no longer required:
+ oldrec oldsug
+Use 'apt autoremove' to remove them.
+The following NEW packages will be installed:
+ newrec promote
+The following packages will be upgraded:
+ foo
+1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst foo [1] (2 unstable [all])
+Inst newrec (2 unstable [all])
+Inst promote (2 unstable [all])
+Conf foo (2 unstable [all])
+Conf newrec (2 unstable [all])
+Conf promote (2 unstable [all])" apt full-upgrade -s
+
+testsuccessequal "Reading package lists...
+Building dependency tree...
+Reading state information...
+Calculating upgrade...
+The following packages were automatically installed and are no longer required:
+ oldrec oldsug
+Use 'apt autoremove' to remove them.
+The following NEW packages will be installed:
+ newrec newsug
+The following packages will be upgraded:
+ foo
+1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst foo [1] (2 unstable [all])
+Inst newrec (2 unstable [all])
+Inst newsug (2 unstable [all])
+Conf foo (2 unstable [all])
+Conf newrec (2 unstable [all])
+Conf newsug (2 unstable [all])" apt full-upgrade -s --install-suggests