summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-04-27 17:45:10 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2015-04-28 11:23:16 +0200
commit1bb5b498f01db75822a861046ca934f50447eb05 (patch)
tree7e63281e40ef25f0429dba18753022a57ac0012a
parenta378e5a6dd3e8a2d8ccb69bb9f0acdd1e279b1dc (diff)
downloadlvm2-1bb5b498f01db75822a861046ca934f50447eb05.tar.gz
tests: more descriptive aux
Tell what's reason of aux fail here.
-rw-r--r--test/lib/aux.sh23
1 files changed, 17 insertions, 6 deletions
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 95c2f7371..1af43d03e 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -951,14 +951,19 @@ target_at_least() {
local version=$(dmsetup targets 2>/dev/null | grep "${1##dm-} " 2>/dev/null)
version=${version##* v}
- shift
- version_at_least "$version" "$@"
+ version_at_least "$version" "${@:2}" || {
+ echo "Found $1 version $version, but requested ${*:2}." >&2
+ return 1
+ }
}
have_thin() {
- test "$THIN" = shared -o "$THIN" = internal || return 1
- target_at_least dm-thin-pool "$@" || return 1
+ test "$THIN" = shared -o "$THIN" = internal || {
+ echo "Thin is not built-in." >&2
+ return 1;
+ }
+ target_at_least dm-thin-pool "$@"
declare -a CONF
# disable thin_check if not present in system
@@ -978,12 +983,18 @@ have_thin() {
}
have_raid() {
- test "$RAID" = shared -o "$RAID" = internal || return 1
+ test "$RAID" = shared -o "$RAID" = internal || {
+ echo "Raid is not built-in." >&2
+ return 1;
+ }
target_at_least dm-raid "$@"
}
have_cache() {
- test "$CACHE" = shared -o "$CACHE" = internal || return 1
+ test "$CACHE" = shared -o "$CACHE" = internal || {
+ echo "Cache is not built-in." >&2
+ return 1;
+ }
target_at_least dm-cache "$@"
declare -a CONF