summaryrefslogtreecommitdiffstats
path: root/test/integration/test-apt-get-autoremove
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/test-apt-get-autoremove')
-rwxr-xr-xtest/integration/test-apt-get-autoremove26
1 files changed, 16 insertions, 10 deletions
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