mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-11 09:18:25 +03:00
Make the mirror log checks in t-lvconvert-repair-policy a bit more strict
(i.e. accurate).
This commit is contained in:
parent
81095cc6ea
commit
ba7d6c9dd0
@ -209,6 +209,14 @@ inactive() {
|
||||
}
|
||||
}
|
||||
|
||||
lv_exists() {
|
||||
lv="$1/$2"
|
||||
lvl "$lv" >& /dev/null || {
|
||||
echo "$lv expected to exist but does not"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
pv_field()
|
||||
{
|
||||
actual=$(trim $(pvs --noheadings $4 -o $2 $1))
|
||||
|
@ -45,7 +45,7 @@ cleanup $dev1
|
||||
aux disable_dev $dev1
|
||||
repair 'activation { mirror_image_fault_policy = "replace" mirror_log_fault_policy = "remove" }'
|
||||
check mirror $vg mirror
|
||||
lvs | grep mirror_mlog
|
||||
check active $vg mirror_mlog
|
||||
cleanup $dev1
|
||||
|
||||
# Fail a leg of a mirror.
|
||||
@ -53,7 +53,7 @@ cleanup $dev1
|
||||
aux disable_dev $dev1
|
||||
repair 'activation { mirror_image_fault_policy = "replace" }'
|
||||
check mirror $vg mirror
|
||||
lvs | grep mirror_mlog
|
||||
check active $vg mirror_mlog
|
||||
cleanup $dev1
|
||||
|
||||
# Fail a leg of a mirror (use old name for policy specification)
|
||||
@ -61,7 +61,7 @@ cleanup $dev1
|
||||
aux disable_dev $dev1
|
||||
repair 'activation { mirror_image_fault_policy = "replace" }'
|
||||
check mirror $vg mirror
|
||||
lvs | grep mirror_mlog
|
||||
check active $vg mirror_mlog
|
||||
cleanup $dev1
|
||||
|
||||
# Fail a leg of a mirror w/ no available spare
|
||||
@ -70,7 +70,7 @@ cleanup $dev1
|
||||
aux disable_dev $dev2 $dev4
|
||||
repair 'activation { mirror_image_fault_policy = "replace" }'
|
||||
check mirror $vg mirror
|
||||
lvs | not grep mirror_mlog
|
||||
not check lv_exists $vg mirror_mlog
|
||||
cleanup $dev2 $dev4
|
||||
|
||||
# Fail the log device of a mirror w/ no available spare
|
||||
@ -78,7 +78,7 @@ cleanup $dev2 $dev4
|
||||
aux disable_dev $dev3 $dev4
|
||||
repair 'activation { mirror_image_fault_policy = "replace" }' $vg/mirror
|
||||
check mirror $vg mirror
|
||||
lvs | not grep mirror_mlog
|
||||
not check lv_exists $vg mirror_mlog
|
||||
cleanup $dev3 $dev4
|
||||
|
||||
# Fail the log device with a remove policy
|
||||
@ -87,5 +87,5 @@ lvchange -a y $vg/mirror
|
||||
aux disable_dev $dev3 $dev4
|
||||
repair 'activation { mirror_log_fault_policy = "remove" }'
|
||||
check mirror $vg mirror core
|
||||
lvs | not grep mirror_mlog
|
||||
not check lv_exists $vg mirror_mlog
|
||||
cleanup $dev3 $dev4
|
||||
|
Loading…
Reference in New Issue
Block a user