summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:18:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:18:38 +0000
commitb81238fa02b2348f3fbb90e4d5e54a3ad8d78ac4 (patch)
treebf5624f8edc149dca9d78bfa8bcbf2d493c8b128 /test/integration
parentAdding upstream version 2.9.2. (diff)
downloadapt-b81238fa02b2348f3fbb90e4d5e54a3ad8d78ac4.tar.xz
apt-b81238fa02b2348f3fbb90e4d5e54a3ad8d78ac4.zip
Adding upstream version 2.9.3.upstream/2.9.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/framework10
-rwxr-xr-xtest/integration/test-allow-scores-for-all-dependency-types3
-rwxr-xr-xtest/integration/test-apt-cache-showsrc6
-rwxr-xr-xtest/integration/test-apt-get-autoremove26
-rwxr-xr-xtest/integration/test-apt-get-source-only114
-rwxr-xr-xtest/integration/test-bug-1069874-working-with-not-normalized-packages57
-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
14 files changed, 348 insertions, 62 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 147de98..9cb4081 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
@@ -881,8 +882,12 @@ buildsimplenativepackage() {
cp -ar "$FILE_TREE" "${BUILDDIR}/debian/tmp"
fi
- (cd "${BUILDDIR}"; dpkg-gencontrol -DArchitecture=$arch)
- (cd "${BUILDDIR}/debian/tmp"; md5sum $(find usr/ -type f) > DEBIAN/md5sums)
+ if [ ! -e "${BUILDDIR}/debian/tmp/DEBIAN/control" ]; then
+ (cd "${BUILDDIR}"; dpkg-gencontrol -DArchitecture=$arch)
+ fi
+ if [ ! -e "${BUILDDIR}/debian/tmp/DEBIAN/md5sums" ]; then
+ (cd "${BUILDDIR}/debian/tmp"; md5sum $(find usr/ -type f) > DEBIAN/md5sums)
+ fi
local LOG="${BUILDDIR}/../${NAME}_${VERSION}_${arch}.dpkg-deb.log"
# ensure the right permissions as dpkg-deb insists
chmod 755 "${BUILDDIR}/debian/tmp/DEBIAN"
@@ -1548,6 +1553,7 @@ downloadfile() {
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}' \
>"$2"
diff --git a/test/integration/test-allow-scores-for-all-dependency-types b/test/integration/test-allow-scores-for-all-dependency-types
index 999efc0..0a527da 100755
--- a/test/integration/test-allow-scores-for-all-dependency-types
+++ b/test/integration/test-allow-scores-for-all-dependency-types
@@ -41,6 +41,7 @@ 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...
Building dependency tree...
Calculating upgrade...
@@ -75,6 +76,7 @@ Conf libdb5.3-dev (5.3.28-3 versioned [amd64])' aptget dist-upgrade -st versione
rm -f rootdir/var/lib/dpkg/status
insertinstalledpackage 'foo' 'amd64' '1'
insertinstalledpackage 'bar' 'amd64' '1'
+testsuccess aptmark auto ~i
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
@@ -134,6 +136,7 @@ rm -f rootdir/var/lib/dpkg/status
insertinstalledpackage 'gdm3' 'amd64' '1' 'Depends: libaudit0, libaudit0'
insertinstalledpackage 'login' 'amd64' '1' 'Essential: yes'
insertinstalledpackage 'libaudit0' 'amd64' '1'
+testsuccess aptmark auto ~i
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
diff --git a/test/integration/test-apt-cache-showsrc b/test/integration/test-apt-cache-showsrc
index d3f61d9..0f0e21d 100755
--- a/test/integration/test-apt-cache-showsrc
+++ b/test/integration/test-apt-cache-showsrc
@@ -29,3 +29,9 @@ testsuccess grep "Package: unrelated" output.txt
aptcache showsrc --only-source foo > output.txt
testsuccess grep "Package: foo" output.txt
testfailure grep "Package: unrelated" output.txt
+
+# by default apt-cache showsrc will look into "binary" and "source" names
+# and show all matches
+aptcache showsrc src:foo > output.txt
+testsuccess grep "Package: foo" output.txt
+testfailure grep "Package: unrelated" output.txt
diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove
index 66257f4..9454df5 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-apt-get-source-only b/test/integration/test-apt-get-source-only
new file mode 100755
index 0000000..93d8284
--- /dev/null
+++ b/test/integration/test-apt-get-source-only
@@ -0,0 +1,114 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+setupenvironment
+configarchitecture "amd64"
+
+
+# not-foo builds foo, but foo builds not-foo
+insertpackage 'stable' 'foo' 'amd64' '1.0' 'Source: not-foo'
+insertsource 'stable' 'not-foo' 'amd64' '1.0' 'Build-Depends: not-foo-bd' 'foo'
+
+insertpackage 'stable' 'not-foo' 'amd64' '1.0' 'Source: foo'
+insertsource 'stable' 'foo' 'amd64' '1.0' 'Build-Depends: foo-bd' 'not-foo'
+
+insertinstalledpackage 'build-essential' 'amd64' '1.0'
+
+setupaptarchive
+
+APTARCHIVE=$(readlink -f ./aptarchive)
+
+HEADER='Reading package lists...'
+DOWNLOADFOO="Need to get 0 B/25 B of source archives.
+'file:${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 11 SHA256:ed7c25c832596339bee13e4e7c45cf49f869b60d2bf57252f18191d75866c2a7
+'file:${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 14 SHA256:f3da8c6ebc62c8ef2dae439a498dddcdacc1a07f45ff67ad12f44b6e2353c239"
+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"
+
+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: Unable to correct problems, you have held broken packages."
+
+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: Unable to correct problems, you have held broken packages."
+
+testsuccessequal "$HEADER
+Picking 'not-foo' as source package instead of 'foo'
+$DOWNLOADNOTFOO" aptget source -q --print-uris foo
+
+testsuccessequal "$HEADER
+Picking 'not-foo' as source package instead of 'foo'
+$DOWNLOADNOTFOO" aptget source -q --print-uris foo:amd64
+
+testsuccessequal "$HEADER
+$DOWNLOADNOTFOO" aptget source -q --print-uris --only-source not-foo
+
+testsuccessequal "$HEADER
+$DOWNLOADNOTFOO" aptget source -q --print-uris src:not-foo
+
+testsuccessequal "$HEADER
+Picking 'foo' as source package instead of 'not-foo'
+$DOWNLOADFOO" aptget source -q --print-uris not-foo
+
+testsuccessequal "$HEADER
+Picking 'foo' as source package instead of 'not-foo'
+$DOWNLOADFOO" aptget source -q --print-uris not-foo:amd64
+
+testsuccessequal "$HEADER
+$DOWNLOADFOO" aptget source -q --print-uris --only-source foo
+
+testsuccessequal "$HEADER
+$DOWNLOADFOO" aptget source -q --print-uris src:foo
+
+# Same dance with build-dep
+testequal "$HEADER
+Picking 'not-foo' as source package instead of 'foo'
+$BUILDDEPNOTFOO" aptget build-dep -q -s foo
+
+testequal "$HEADER
+Picking 'not-foo' as source package instead of 'foo'
+$BUILDDEPNOTFOO" aptget build-dep -q -s foo:amd64
+
+testequal "$HEADER
+$BUILDDEPNOTFOO" aptget build-dep -q -s --only-source not-foo
+
+testequal "$HEADER
+$BUILDDEPNOTFOO" aptget build-dep -q -s src:not-foo
+
+testequal "$HEADER
+Picking 'foo' as source package instead of 'not-foo'
+$BUILDDEPFOO" aptget build-dep -q -s not-foo
+
+testequal "$HEADER
+Picking 'foo' as source package instead of 'not-foo'
+$BUILDDEPFOO" aptget build-dep -q -s not-foo:amd64
+
+testequal "$HEADER
+$BUILDDEPFOO" aptget build-dep -q -s --only-source foo
+
+testequal "$HEADER
+$BUILDDEPFOO" aptget build-dep -q -s src:foo
+
+
+
diff --git a/test/integration/test-bug-1069874-working-with-not-normalized-packages b/test/integration/test-bug-1069874-working-with-not-normalized-packages
new file mode 100755
index 0000000..d45acee
--- /dev/null
+++ b/test/integration/test-bug-1069874-working-with-not-normalized-packages
@@ -0,0 +1,57 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'amd64'
+
+WORKDIR="${TMPWORKINGDIRECTORY}/badcontrol"
+mkdir -p "${WORKDIR}/DEBIAN"
+cat > "${WORKDIR}/DEBIAN/control" << EOF
+Package: perccli
+Version: 007.2616.0000.0000
+Section: perccli
+Priority: optional
+Architecture: all
+Depends:
+Pre-Depends:
+Recommends:
+Suggests:
+Installed-Size: 7000
+Maintainer: Jane Doe <foo@example.org>
+Conflicts:
+Replaces:
+Provides:
+Description: Not a real package
+EOF
+buildsimplenativepackage 'perccli' 'all' '007.2616.0000.0000' 'stable' '' '' '' '' "${WORKDIR}/DEBIAN"
+cp -a "${WORKDIR}/DEBIAN/control" aptarchive/Packages
+rm -rf "$WORKDIR"
+
+setupaptarchive --no-update
+echo "deb [trusted=yes] file:${TMPWORKINGDIRECTORY}/aptarchive ./" > rootdir/etc/apt/sources.list.d/00badcontrol.list
+testsuccess apt update
+
+# uses the flat Packages file which includes the line ending spaces
+testsuccess aptcache show perccli
+cp -a rootdir/tmp/testsuccess.output perccli.show
+testsuccessequal '4' grep -c '^\(\(Pre-\|\)Depends\|Provides\|Replaces\): \+$' perccli.show
+
+testdpkgnotinstalled perccli
+testsuccess apt install perccli
+testdpkginstalled perccli
+
+testsuccess apt policy perccli
+cp -a rootdir/tmp/testsuccess.output perccli.policy
+testsuccessequal '3' grep -c '7\.2616\.' perccli.policy
+
+# apt-ftparchive outputs empty fields, but not the space ending
+testsuccess rm rootdir/var/lib/apt/lists/*_._Packages
+testsuccess aptcache show perccli/now
+cp -a rootdir/tmp/testsuccess.output perccli.show
+testsuccessequal '4' grep -c '^\(\(Pre-\|\)Depends\|Provides\|Replaces\):$' perccli.show
+
+testsuccess apt policy perccli
+cp -a rootdir/tmp/testsuccess.output perccli.policy
+testsuccessequal '3' grep -c '7\.2616\.' perccli.policy
diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove
index 47da810..78a2882 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 63f8245..bd9af32 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 46c3d94..75a653c 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 f3fed04..f93e10e 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 485a770..ca6a5ae 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 208bd14..20a0968 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 0000000..54b2042
--- /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 0000000..57497f7
--- /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