summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-get-clean
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/test-apt-get-clean')
-rwxr-xr-xtest/integration/test-apt-get-clean10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/integration/test-apt-get-clean b/test/integration/test-apt-get-clean
index 9d15cd826..6bf20c8d7 100755
--- a/test/integration/test-apt-get-clean
+++ b/test/integration/test-apt-get-clean
@@ -36,6 +36,16 @@ testfailure test -e rootdir/var/cache/apt/archives/foo_2_all.deb
testfailure test -e rootdir/var/cache/apt/archives/foo_3_all.deb
testfailure test -e rootdir/var/cache/apt/archives/foo_4_all.deb
+if [ "$(id -u)" != '0' ]; then
+ msgmsg 'No clean if lock can not be acquired'
+ touch rootdir/var/cache/apt/archives/foo_4_all.deb
+ touch rootdir/var/cache/apt/archives/lock
+ chmod 444 rootdir/var/cache/apt/archives/lock
+ testfailure apt clean
+ testsuccess test -e rootdir/var/cache/apt/archives/foo_4_all.deb
+ chmod 644 rootdir/var/cache/apt/archives/lock
+fi
+
directorygone() {
rm -rf "$1"
testsuccess apt autoclean