summaryrefslogtreecommitdiff
path: root/tests/common
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2016-05-10 10:13:23 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2016-05-10 10:13:23 +0100
commit58e631d01823afd60e52f3a09887f270a91889a0 (patch)
tree6afbca5492c1ad1040608e01fe0c9d909482adeb /tests/common
parentcec572daccafa1e912cbed363df6f84687778c6f (diff)
New upstream release 4.5.2.
* Thanks for NMU of package rename. * New upstream release 4.5.2. * Upload using dgit. * Source-only upload. * btrfs-convert should not be included in the initramfs, but should be compiled. Using btrfs-convert is not a trivial operation, and especially not from a minimal shell. Also it is known to fail, and for a sophisticated user it is trivial to include it in the initramfs. Thus won't fix Closes: #801192 * No sponsorship required Closes: #823474 * Add Provides btrfs-tools-udeb to the -progs-udeb package.
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/common b/tests/common
index 61780486..91682eff 100644
--- a/tests/common
+++ b/tests/common
@@ -61,6 +61,32 @@ run_mayfail()
fi
}
+# first argument is error message to print if it fails, otherwise
+# same as run_check but expects the command to fail, output is logged
+run_mustfail()
+{
+ local msg
+
+ msg="$1"
+ shift
+
+ echo "############### $@" >> $RESULTS 2>&1
+ if [ "$TEST_LOG" = 'tty' ]; then echo "CMD(mustfail): $@" > /dev/tty; fi
+ if [ "$1" = 'root_helper' ]; then
+ "$@" >> $RESULTS 2>&1
+ else
+ $INSTRUMENT "$@" >> $RESULTS 2>&1
+ fi
+ if [ $? != 0 ]; then
+ echo "failed (expected): $@" >> $RESULTS
+ return 0
+ else
+ echo "succeeded (unexpected!): $@" >> $RESULTS
+ _fail "unexpected success: $msg"
+ return 1
+ fi
+}
+
check_prereq()
{
if ! [ -f $TOP/$1 ]; then