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

tests: update raid_leg_status check

Do not wait for progres (non zero processed amount of blocks),
when the raid status already reported 'resync' or 'recover'.
This commit is contained in:
Zdenek Kabelac 2024-03-24 22:42:48 +01:00
parent e8b7b53db1
commit 658c446f13

View File

@ -439,9 +439,11 @@ raid_leg_status() {
# 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" ] || {
st=( $(dmsetup status --noflush "$1-$2") ) || die "Unable to get status of $vg/$lv1"
case "${st[7]}" in
"resync"|"recover") [ "${st[5]}" = "$3" ] && return 0 ;;
esac
[ "${st[6]%%/*}" = "0" ] || {
test "${st[5]}" = "$3" || break
return 0
}