summaryrefslogtreecommitdiff
path: root/test/integration/test-bug-604401-files-are-directories
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-08-10 10:01:06 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-08-12 18:01:37 +0200
commit0440d936d70b1e331d49bbc32735f1b749632604 (patch)
tree9a422e857c5fc895e1992eca2077f7c105cbe0ac /test/integration/test-bug-604401-files-are-directories
parent29a59c460403820d0f039398194e321b7e0921fc (diff)
add chronic-like testsuccess/testfailure helpers
For many commands the output isn't stable (like then dpkg is called) but the exitcode is, so this helper enhances the common && msgpass || msgfail by generating automatically a msgtest and showing the output of the command in case of failure instead of discarding it unconditionally, the later being chronic-like behaviour Git-Dch: Ignore
Diffstat (limited to 'test/integration/test-bug-604401-files-are-directories')
-rwxr-xr-xtest/integration/test-bug-604401-files-are-directories10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/integration/test-bug-604401-files-are-directories b/test/integration/test-bug-604401-files-are-directories
index aae717a19..e6913edcf 100755
--- a/test/integration/test-bug-604401-files-are-directories
+++ b/test/integration/test-bug-604401-files-are-directories
@@ -11,7 +11,7 @@ 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"
@@ -22,7 +22,7 @@ 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,7 +30,7 @@ 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"
@@ -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"
@@ -62,5 +62,5 @@ 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