From ba7d6c9dd02dc93be5956a2ccb9135ce0955d314 Mon Sep 17 00:00:00 2001 From: Petr Rockai Date: Tue, 12 Apr 2011 12:39:24 +0000 Subject: [PATCH] Make the mirror log checks in t-lvconvert-repair-policy a bit more strict (i.e. accurate). --- test/lib/check.sh | 8 ++++++++ test/t-lvconvert-repair-policy.sh | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/test/lib/check.sh b/test/lib/check.sh index 672e4839a..116ecdc14 100644 --- a/test/lib/check.sh +++ b/test/lib/check.sh @@ -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)) diff --git a/test/t-lvconvert-repair-policy.sh b/test/t-lvconvert-repair-policy.sh index 8240f9e3f..debd8d1a9 100644 --- a/test/t-lvconvert-repair-policy.sh +++ b/test/t-lvconvert-repair-policy.sh @@ -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