X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/cec8c646c79e40d928464b08a6f2e3ea62bb1611..e40a4a3e381a8cb6c8b924e9ce545512769bddff:/test/integration/test-bug-604401-files-are-directories diff --git a/test/integration/test-bug-604401-files-are-directories b/test/integration/test-bug-604401-files-are-directories index aae717a19..4261d544d 100755 --- a/test/integration/test-bug-604401-files-are-directories +++ b/test/integration/test-bug-604401-files-are-directories @@ -1,8 +1,8 @@ #!/bin/sh set -e -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" setupenvironment configarchitecture "i386" setupaptarchive @@ -11,18 +11,18 @@ test ! -e rootdir/etc/apt/apt.conf || mv rootdir/etc/apt/apt.conf rootdir/etc/ap msgtest "Directory instead of a file as apt.conf ignored" mkdir -p rootdir/etc/apt/apt.conf -aptconfig dump > /dev/null && msgpass || msgfail +testsuccess --nomsg aptconfig dump rmdir rootdir/etc/apt/apt.conf msgtest "Good link instead of a file as apt.conf ignored" echo 'Test::APT::Link "good";' > rootdir/etc/apt/good-link.conf ln -s rootdir/etc/apt/good-link.conf rootdir/etc/apt/apt.conf -test -n "$(aptconfig shell TestLink 'Test::APT::Link')" && msgfail || msgpass +testempty aptconfig shell TestLink 'Test::APT::Link' rm rootdir/etc/apt/apt.conf msgtest "Broken link instead of a file as apt.conf ignored" ln -s /tmp/doesnt-exist rootdir/etc/apt/apt.conf -aptconfig dump > /dev/null && msgpass || msgfail +testsuccess --nomsg aptconfig dump rm rootdir/etc/apt/apt.conf @@ -30,18 +30,18 @@ test ! -e rootdir/etc/apt/sources.list || mv rootdir/etc/apt/sources.list rootdi msgtest "Directory instead of a file as sources.list ignored" mkdir -p rootdir/etc/apt/sources.list -aptget update --print-uris 2> /dev/null && msgpass || msgfail +testsuccess --nomsg aptget update --print-uris rmdir rootdir/etc/apt/sources.list msgtest "Good link instead of a file as sources.list ignored" echo 'deb file:///tmp/debian sid main' > rootdir/etc/apt/good-link.list ln -s rootdir/etc/apt/good-link.list rootdir/etc/apt/sources.list -test -n "$(aptget update --print-uris)" && msgfail || msgpass +testempty aptget update --print-uris rm rootdir/etc/apt/sources.list msgtest "Broken link instead of a file as sources.list ignored" ln -s /tmp/doesnt-exist rootdir/etc/apt/sources.list -test -n "$(aptget update --print-uris)" && msgfail || msgpass +testempty aptget update --print-uris rm rootdir/etc/apt/sources.list @@ -49,7 +49,7 @@ test ! -e rootdir/etc/apt/preferences || mv rootdir/etc/apt/preferences rootdir/ msgtest "Directory instead of a file as preferences ignored" mkdir -p rootdir/etc/apt/preferences -aptcache policy > /dev/null 2> /dev/null && msgpass || msgfail +testsuccess --nomsg aptcache policy rmdir rootdir/etc/apt/preferences msgtest "Good link instead of a file as preferences ignored" @@ -57,10 +57,11 @@ echo 'Package: apt Pin: release a=now Pin-Value: 1000' > rootdir/etc/apt/good-link.pref ln -s rootdir/etc/apt/good-link.pref rootdir/etc/apt/preferences -test -n "$(aptcache policy | grep 1000)" && msgfail || msgpass +testsuccess aptcache policy +testfailure grep '1000 ' rootdir/tmp/testsucess.output rm rootdir/etc/apt/preferences msgtest "Broken link instead of a file as preferences ignored" ln -s /tmp/doesnt-exist rootdir/etc/apt/preferences -aptcache policy > /dev/null 2> /dev/null && msgpass || msgfail +testsuccess --nomsg aptcache policy rm rootdir/etc/apt/preferences