local rchunk=$2
local rdevs=$3
- local maj=$(mdadm --version 2>&1) || skip "mdadm tool is missing!"
+ local maj
local mddev
+ maj=$(mdadm --version 2>&1) || skip "mdadm tool is missing!"
cleanup_md_dev
test -f MD_DEV || return 0
local IFS=$IFS_NL
- local dev=$(< MD_DEV)
-
+ local dev
+ dev=$(< MD_DEV)
udev_wait
mdadm --stop "$dev" || true
test "$DM_DEV_DIR" != "/dev" && rm -f "$DM_DEV_DIR/$(basename "$dev")"
rm -f debug.log strace.log
init_udev_transaction
for dev in "$@"; do
- local name=$(echo "$dev" | sed -e 's,.*/,,')
+ local name
+ name=$(echo "$dev" | sed -e 's,.*/,,')
dmsetup create -u "TEST-$name" "$name" "$name.table" 2>/dev/null || \
dmsetup load "$name" "$name.table"
# using device name (since device path does not exists yes with udev)
rm -f debug.log strace.log
init_udev_transaction
for dev in "$@"; do
- local name=$(echo "$dev" | sed -e 's,.*/,,')
+ local name
+ name=$(echo "$dev" | sed -e 's,.*/,,')
dmsetup load "$name" "$name.devtable"
dmsetup resume "$name"
done
esac
fi
- local version=$(dmsetup targets 2>/dev/null | grep "${1##dm-} " 2>/dev/null)
+ local version
+ version=$(dmsetup targets 2>/dev/null | grep "${1##dm-} " 2>/dev/null)
version=${version##* v}
version_at_least "$version" "${@:2}" || {
# e.g. driver_at_least 4 33
#
driver_at_least() {
- local version=$(dmsetup version | tail -1 2>/dev/null)
+ local version
+ version=$(dmsetup version | tail -1 2>/dev/null)
version=${version##*:}
version_at_least "$version" "$@" || {
echo "Found driver version $version, but requested" "$@" "." >&2
}
have_tool_at_least() {
- local version=$($1 -V 2>/dev/null)
+ local version
+ version=$("$1" -V 2>/dev/null)
version=${version%%-*}
shift
}
check_lvmpolld_init_rq_count() {
- local ret=$(awk -v vvalue="$2" -v vkey="${3:-lvname}" "$(awk_parse_init_count_in_lvmpolld_dump)" lvmpolld_dump.txt)
+ local ret
+ ret=$(awk -v vvalue="$2" -v vkey="${3:-lvname}" "$(awk_parse_init_count_in_lvmpolld_dump)" lvmpolld_dump.txt)
test "$ret" -eq "$1" || {
echo "check_lvmpolld_init_rq_count failed. Expected $1, got $ret"
return 1