1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

tests: check mirror_images_on fixed

Fix mirror_images_on() to actually report something useful (thought
it might be tuned later).

So for now the function got through all '_mimages_' and compares
where the order of them is matching given list of devices.
This commit is contained in:
Zdenek Kabelac 2017-07-07 21:17:03 +02:00
parent 91d6a62fc5
commit fdbb680531

View File

@ -90,12 +90,18 @@ lv_tree_on() {
lv_on_diff_ devs[@] "$@"
}
# Test if all mimage_X LV legs are sitting on given ordered list of PVs
# When LV is composed of imagetmp, such leg is decomposed so only
# real _mimage LVs are always checked
mirror_images_on() {
local vg=$1
local lv=$2
shift 2
for i in $(lvdevices "$lv"); do
lv_on "$vg" "$lv" "$1"
local mimages=()
readarray -t mimages <<< "$(get lv_field_lv_ "$vg" lv_name -a | grep "${lv}_mimage_" )"
for i in "${mimages[@]}"; do
lv_on "$vg" "$i" "$1"
shift
done
}