From fdbb680531b08e03dba2dc3d2f22381bf55abbb0 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 7 Jul 2017 21:17:03 +0200 Subject: [PATCH] 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. --- test/lib/check.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/lib/check.sh b/test/lib/check.sh index 603f334a6..76015b83c 100644 --- a/test/lib/check.sh +++ b/test/lib/check.sh @@ -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 } -- 2.43.5