mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
tests: update mirror test
Log results of uniq. Remove few unneeded lvs calls.
This commit is contained in:
parent
53bad89a7b
commit
92ee16f7c0
@ -44,7 +44,7 @@ mimages_are_on_ ()
|
|||||||
local i
|
local i
|
||||||
|
|
||||||
echo "Check if mirror images of $lv are on PVs" "${list_pvs[@]}"
|
echo "Check if mirror images of $lv are on PVs" "${list_pvs[@]}"
|
||||||
printf "%s\n" "${list_pvs[@]}" | sort | uniq > out1
|
printf "%s\n" "${list_pvs[@]}" | sort | uniq | tee out1
|
||||||
|
|
||||||
get lv_field_lv_ "$vg" lv_name -a | grep "${lv}_mimage_" | tee lvs_log
|
get lv_field_lv_ "$vg" lv_name -a | grep "${lv}_mimage_" | tee lvs_log
|
||||||
test -s lvs_log || return 1
|
test -s lvs_log || return 1
|
||||||
@ -53,14 +53,9 @@ mimages_are_on_ ()
|
|||||||
mimages+=( "$i" )
|
mimages+=( "$i" )
|
||||||
done < lvs_log
|
done < lvs_log
|
||||||
|
|
||||||
for i in "${mimages[@]}"; do
|
|
||||||
echo "Checking $vg/$i"
|
|
||||||
lvs -a -o+devices "$vg/$i"
|
|
||||||
done
|
|
||||||
|
|
||||||
for i in "${mimages[@]}"; do
|
for i in "${mimages[@]}"; do
|
||||||
get lv_devices "$vg/$i"
|
get lv_devices "$vg/$i"
|
||||||
done | sort | uniq > out2
|
done | sort | uniq | tee out2
|
||||||
|
|
||||||
diff --ignore-blank-lines out1 out2
|
diff --ignore-blank-lines out1 out2
|
||||||
}
|
}
|
||||||
@ -116,7 +111,7 @@ prepare_lvs_()
|
|||||||
|
|
||||||
check_and_cleanup_lvs_()
|
check_and_cleanup_lvs_()
|
||||||
{
|
{
|
||||||
lvs -a -o+devices $vg
|
lvs -a -o+lv_uuid,devices $vg
|
||||||
prepare_lvs_
|
prepare_lvs_
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user