From 8d968cc2d1e11da81f3bab878c1a413a97ca27ed Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 23 Dec 2015 17:48:16 +0100 Subject: ensure we got a lock in clean operation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We try to acquired the locks, but we didn't stop if we failed to get it… Closes: 808561 --- test/integration/test-apt-get-clean | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/integration/test-apt-get-clean') 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 -- cgit v1.2.3