1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

tests: fix aux have test

Previous commit has made have_cache & have_thin producing
false return value.

Fix it and at the some time provide much better reconfiguring
warning message.

If the test machine is missing needed and configured binaries
it will produce TEST WARNING result.
This commit is contained in:
Zdenek Kabelac 2015-04-15 11:51:00 +02:00
parent 1a7dd13e70
commit 930f0aae84

View File

@ -893,17 +893,21 @@ have_thin() {
test "$THIN" = shared -o "$THIN" = internal || return 1
target_at_least dm-thin-pool "$@" || return 1
declare -a CONF
# disable thin_check if not present in system
test -x "$LVM_TEST_THIN_CHECK_CMD" || LVM_TEST_THIN_CHECK_CMD=""
test -x "$LVM_TEST_THIN_DUMP_CMD" || LVM_TEST_THIN_DUMP_CMD=""
test -x "$LVM_TEST_THIN_REPAIR_CMD" || LVM_TEST_THIN_REPAIR_CMD=""
test -z "$LVM_TEST_THIN_CHECK_CMD" -o \
-z "$LVM_TEST_THIN_DUMP_CMD" -o \
-z "$LVM_TEST_THIN_REPAIR_CMD" && {
lvmconf "global/thin_check_executable = \"$LVM_TEST_THIN_CHECK_CMD\"" \
"global/thin_dump_executable = \"$LVM_TEST_THIN_DUMP_CMD\"" \
"global/thin_repair_executable = \"$LVM_TEST_THIN_REPAIR_CMD\""
}
if test -n "$LVM_TEST_THIN_CHECK_CMD" -a ! -x "$LVM_TEST_THIN_CHECK_CMD" ; then
CONF[0]="global/thin_check_executable = \"\""
fi
if test -n "$LVM_TEST_THIN_DUMP_CMD" -a ! -x "$LVM_TEST_THIN_DUMP_CMD" ; then
CONF[1]="global/thin_dump_executable = \"\""
fi
if test -n "$LVM_TEST_THIN_REPAIR_CMD" -a ! -x "$LVM_TEST_THIN_REPAIR_CMD" ; then
CONF[2]="global/thin_repair_executable = \"\""
fi
if test ${#CONF[@]} -ne 0 ; then
echo "TEST WARNING: Reconfiguring ${CONF[@]}"
lvmconf "${CONF[@]}"
fi
}
have_raid() {
@ -915,17 +919,21 @@ have_cache() {
test "$CACHE" = shared -o "$CACHE" = internal || return 1
target_at_least dm-cache "$@"
declare -a CONF
# disable cache_check if not present in system
test -x "$LVM_TEST_CACHE_CHECK_CMD" || LVM_TEST_CACHE_CHECK_CMD=""
test -x "$LVM_TEST_CACHE_DUMP_CMD" || LVM_TEST_CACHE_DUMP_CMD=""
test -x "$LVM_TEST_CACHE_REPAIR_CMD" || LVM_TEST_CACHE_REPAIR_CMD=""
test -z "$LVM_TEST_CACHE_CHECK_CMD" -o \
-z "$LVM_TEST_CACHE_DUMP_CMD" -o \
-z "$LVM_TEST_CACHE_REPAIR_CMD" && {
lvmconf "global/cache_check_executable = \"$LVM_TEST_CACHE_CHECK_CMD\"" \
"global/cache_dump_executable = \"$LVM_TEST_CACHE_DUMP_CMD\"" \
"global/cache_repair_executable = \"$LVM_TEST_CACHE_REPAIR_CMD\""
}
if test -n "$LVM_TEST_CACHE_CHECK_CMD" -a ! -x "$LVM_TEST_CACHE_CHECK_CMD" ; then
CONF[0]="global/cache_check_executable = \"\""
fi
if test -n "$LVM_TEST_CACHE_DUMP_CMD" -a ! -x "$LVM_TEST_CACHE_DUMP_CMD" ; then
CONF[1]="global/cache_dump_executable = \"\""
fi
if test -n "$LVM_TEST_CACHE_REPAIR_CMD" -a ! -x "$LVM_TEST_CACHE_REPAIR_CMD" ; then
CONF[2]="global/cache_repair_executable = \"\""
fi
if test ${#CONF[@]} -ne 0 ; then
echo "TEST WARNING: Reconfiguring ${CONF[@]}"
lvmconf "${CONF[@]}"
fi
}
have_tool_at_least() {