From 561f773bb47f11d495701e15d234c85cf746e285 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 19 Sep 2016 13:46:42 +0200 Subject: [PATCH] tests: add check grep_dmsetup Add simple helper/wrapper check function to check result of dmsetup call i.e.: check grep_dmsetup table vg-lv "grep_expected" check grep_dmsetup status vg-lv -v "grep_unexpected" --- test/lib/check.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/lib/check.sh b/test/lib/check.sh index 9dd86359a..916d2df39 100644 --- a/test/lib/check.sh +++ b/test/lib/check.sh @@ -400,6 +400,11 @@ raid_leg_status() { die "$1-$2 status $val != $3 ($st)" } +grep_dmsetup() { + dmsetup $1 $2 | tee out + grep "${@:3}" out || die "Expected output from dmsetup $1 not found!" +} + #set -x unset LVM_VALGRIND "$@"