summaryrefslogtreecommitdiff
path: root/test/integration/test-bug-604401-files-are-directories
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-05-13 16:59:09 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-05-16 16:17:54 +0200
commitfd78974020e23679e9e810cf01dc5c8f3012bb8a (patch)
treeb855e65f5812ff359872295f4f1fe5e62e52e7c8 /test/integration/test-bug-604401-files-are-directories
parent71203dbf00cbb259fb59e8daf0543a45394b6623 (diff)
show globalerrors before asking for confirmation
Errors cause a kind of automatic no already, but warnings and notices are only displayed at the end of the apt execution even through they could effect the choice of saying yes/no to questions: E.g. if a configuration (file) was ignored you wanted to have an effect or if an external solver you used generated warnings suggesting that the solution might be valid, but bogus non-the-less and similar things. Note that this only moves those messages up to the question if the answer is interactive – not if e.g. -y is used or no question is asked at all so this has an effect only on interactive usage of apt(-get), not script who might be parsing apt output.
Diffstat (limited to 'test/integration/test-bug-604401-files-are-directories')
-rwxr-xr-xtest/integration/test-bug-604401-files-are-directories9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/integration/test-bug-604401-files-are-directories b/test/integration/test-bug-604401-files-are-directories
index 129a429c3..4261d544d 100755
--- a/test/integration/test-bug-604401-files-are-directories
+++ b/test/integration/test-bug-604401-files-are-directories
@@ -17,7 +17,7 @@ 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"
@@ -36,12 +36,12 @@ 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
@@ -57,7 +57,8 @@ 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"