diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-09-27 20:09:44 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-09-27 20:09:44 +0200 |
commit | 20e6965ad6388b964b59b89c31ff8b81cbcb8f8c (patch) | |
tree | b23b62ab13ba8ba74c86532dbf0dd575c8d48279 /test/integration/test-apt-get-clean | |
parent | 43acd01979039b248cb7f033b82e36d778d0ebec (diff) |
cleanup partial directory of lists in apt-get clean
Not really the intended usecase for apt-get clean, but users expect it
to help them in recovery and it can't really hurt as this directory
should be empty if everything was fine and proper anyway.
Closes: #762889
Diffstat (limited to 'test/integration/test-apt-get-clean')
-rwxr-xr-x | test/integration/test-apt-get-clean | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/integration/test-apt-get-clean b/test/integration/test-apt-get-clean new file mode 100755 index 000000000..646ea31be --- /dev/null +++ b/test/integration/test-apt-get-clean @@ -0,0 +1,34 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' + +insertpackage 'testing' 'foo' 'all' '1' +insertpackage 'unstable' 'foo' 'all' '2' +insertinstalledpackage 'foo' 'all' '3' + +setupaptarchive + +# nothing to do always works +testsuccess aptget clean + +# generate some dirt and clean it up +touch rootdir/var/lib/apt/lists/partial/http.debian.net_debian_dists_sid_main_i18n_Translation-en +touch rootdir/var/cache/apt/archives/foo_1_all.deb +touch rootdir/var/cache/apt/archives/foo_2_all.deb +touch rootdir/var/cache/apt/archives/foo_3_all.deb +touch rootdir/var/cache/apt/archives/foo_4_all.deb + +testsuccess aptget clean + +testsuccess test ! -e rootdir/var/lib/apt/lists/partial/http.debian.net_debian_dists_sid_main_i18n_Translation-en +testsuccess test ! -e rootdir/var/cache/apt/archives/foo_1_all.deb +testsuccess test ! -e rootdir/var/cache/apt/archives/foo_2_all.deb +testsuccess test ! -e rootdir/var/cache/apt/archives/foo_3_all.deb +testsuccess test ! -e rootdir/var/cache/apt/archives/foo_4_all.deb + + |