diff options
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/framework | 5 | ||||
-rwxr-xr-x | test/integration/test-apt-get-clean | 24 |
2 files changed, 27 insertions, 2 deletions
diff --git a/test/integration/framework b/test/integration/framework index 2cc6be3dd..691eb793b 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1510,7 +1510,10 @@ msgfailoutput() { if expr match "$1" "$FILEFLAGS" >/dev/null; then echo "#### stat(2) of file: $2 ####" stat "$2" || true - if test -e "$2"; then + if test -d "$2"; then + echo "#### The directory contains: $2 ####" + ls >&2 "$2" || true + elif test -e "$2"; then echo "#### Complete file: $2 ####" cat >&2 "$2" || true fi diff --git a/test/integration/test-apt-get-clean b/test/integration/test-apt-get-clean index 00f9d4e60..78cb95d74 100755 --- a/test/integration/test-apt-get-clean +++ b/test/integration/test-apt-get-clean @@ -36,4 +36,26 @@ 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 - +directorygone() { + rm -rf "$1" + testsuccess apt autoclean + testfailure test -d "$1" + testsuccess apt clean + # clean creates an empty partial directory via GetLock + if [ "$(basename "$1")" = 'partial' ]; then + testsuccess test -d "$1" + else + testfailure test -d "$1" + fi +} +msgmsg 'Partial directory missing' +directorygone 'rootdir/var/cache/apt/archives/partial' +directorygone 'rootdir/var/lib/apt/lists/partial' + +msgmsg 'Archives directory missing' +directorygone 'rootdir/var/cache/apt/archives' +directorygone 'rootdir/var/lib/apt/lists' + +msgmsg 'apt directory missing' +directorygone 'rootdir/var/cache/apt' +directorygone 'rootdir/var/lib/apt' |