mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
tests: improve check raid_leg_status
Enhance function to wait until raid status gets consisten (shifts from 0/xxxxx to something else) If it would took too long fail the check.
This commit is contained in:
parent
0783c661b9
commit
c1f5ca6751
@ -436,10 +436,19 @@ sysfs() {
|
||||
raid_leg_status() {
|
||||
local st
|
||||
local val
|
||||
st=$(dmsetup status "$1-$2")
|
||||
val=$(echo "$st" | cut -d ' ' -f 6)
|
||||
test "$val" = "$3" || \
|
||||
die "$1-$2 status $val != $3 ($st)"
|
||||
|
||||
# Ignore inconsisten raid status 0/xxxxx idle
|
||||
for i in {100..0} ; do
|
||||
st=( $(dmsetup status $1-$2) ) || die "Unable to get status of $vg/$lv1"
|
||||
b=( $(echo "${st[6]}" | sed s:/:' ':) )
|
||||
[ "${b[0]}" = "0" ] || {
|
||||
test "${st[5]}" = "$3" || break
|
||||
return 0
|
||||
}
|
||||
sleep .1
|
||||
done
|
||||
|
||||
die "$1-$2 status ${st[5]} != $3 ($st)"
|
||||
}
|
||||
|
||||
grep_dmsetup() {
|
||||
|
Loading…
Reference in New Issue
Block a user