1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

tests: improve mirror_images_redundant

Use only passed VG for lvs and avoid 1 extra uneeded use of lvs.
This commit is contained in:
Zdenek Kabelac 2018-04-20 10:15:14 +02:00
parent ac18005de9
commit d51429254f

View File

@ -41,7 +41,6 @@ lvdevices() {
mirror_images_redundant() { mirror_images_redundant() {
local vg=$1 local vg=$1
local lv="$vg/$2" local lv="$vg/$2"
lvs -a "$vg" -o+devices
for i in $(lvdevices "$lv"); do for i in $(lvdevices "$lv"); do
echo "# $i:" echo "# $i:"
lvdevices "$vg/$i" | sort | uniq lvdevices "$vg/$i" | sort | uniq
@ -158,7 +157,7 @@ mirror_nonredundant() {
attr=$(get lv_field "$lv" attr) attr=$(get lv_field "$lv" attr)
(echo "$attr" | grep "^......m...$" >/dev/null) || { (echo "$attr" | grep "^......m...$" >/dev/null) || {
if (echo "$attr" | grep "^o.........$" >/dev/null) && if (echo "$attr" | grep "^o.........$" >/dev/null) &&
lvs -a | grep -F "[${2}_mimage" >/dev/null; then lvs -a $1 | grep -F "[${2}_mimage" >/dev/null; then
echo "TEST WARNING: $lv is a snapshot origin and looks like a mirror," echo "TEST WARNING: $lv is a snapshot origin and looks like a mirror,"
echo "assuming it is actually a mirror" echo "assuming it is actually a mirror"
else else