1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tests: check for idle only for raid type

This commit is contained in:
Zdenek Kabelac 2015-05-27 11:59:10 +02:00
parent 6e4c04b1be
commit 778b66a719

View File

@ -202,6 +202,10 @@ in_sync() {
# 6th argument is the sync ratio for RAID
idx=6
type=${a[3]}
if [ ${a[$(($idx + 1))]} != "idle" ]; then
echo "$lvm_name ($type$snap) is not in-sync"
return 1
fi
elif [ ${a[2]} = "mirror" ]; then
# 4th Arg tells us how far to the sync ratio
idx=$((${a[3]} + 4))
@ -212,7 +216,7 @@ in_sync() {
b=( $(echo ${a[$idx]} | sed s:/:' ':) )
if [ ${a[$(($idx + 1))]} != "idle" -o ${b[0]} -eq 0 -o ${b[0]} != ${b[1]} ]; then
if [ ${b[0]} -eq 0 -o ${b[0]} != ${b[1]} ]; then
echo "$lvm_name ($type$snap) is not in-sync"
return 1
fi
@ -222,7 +226,6 @@ in_sync() {
fi
echo "$lvm_name ($type$snap) is in-sync"
return 0
}
active() {