1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-25 10:04:17 +03:00

Explicitly check after lvremove -ff vg that it did its job. By jstava.

This commit is contained in:
Petr Rockai 2008-11-10 12:32:00 +00:00
parent 15a7a4c38b
commit 543bf2ffbd
5 changed files with 39 additions and 1 deletions

View File

@ -121,6 +121,10 @@ aux prepare_vg 5 80
prepare_lvs_() prepare_lvs_()
{ {
lvremove -ff $vg; lvremove -ff $vg;
if dmsetup table|grep $vg; then
echo "ERROR: lvremove did leave some some mappings in DM behind!"
return 1
fi
: :
} }
@ -128,6 +132,10 @@ check_and_cleanup_lvs_()
{ {
lvs -a -o+devices $vg lvs -a -o+devices $vg
lvremove -ff $vg lvremove -ff $vg
if dmsetup table|grep $vg; then
echo "ERROR: lvremove did leave some some mappings in DM behind!"
return 1
fi
} }
#COMM "check environment setup/cleanup" #COMM "check environment setup/cleanup"

View File

@ -111,12 +111,21 @@ aux prepare_vg 5
prepare_lvs_() prepare_lvs_()
{ {
lvremove -ff $vg lvremove -ff $vg
if dmsetup table|grep $vg; then
echo "ERROR: lvremove did leave some some mappings in DM behind!"
return 1
fi
:
} }
check_and_cleanup_lvs_() check_and_cleanup_lvs_()
{ {
lvs -a -o+devices $vg lvs -a -o+devices $vg
lvremove -ff $vg lvremove -ff $vg
if dmsetup table|grep $vg; then
echo "ERROR: lvremove did leave some some mappings in DM behind!"
return 1
fi
} }
prepare_lvs_ prepare_lvs_

View File

@ -57,13 +57,21 @@ aux prepare_vg 5 80
# Common environment setup/cleanup for each sub testcases # Common environment setup/cleanup for each sub testcases
prepare_lvs_() { prepare_lvs_() {
lvremove -ff $vg; lvremove -ff $vg
if dmsetup table|grep $vg; then
echo "ERROR: lvremove did leave some some mappings in DM behind!"
return 1
fi
: :
} }
check_and_cleanup_lvs_() { check_and_cleanup_lvs_() {
lvs -a -o+devices $vg lvs -a -o+devices $vg
lvremove -ff $vg lvremove -ff $vg
if dmsetup table|grep $vg; then
echo "ERROR: lvremove did leave some some mappings in DM behind!"
return 1
fi
} }
prepare_lvs_ prepare_lvs_

View File

@ -94,6 +94,10 @@ prepare_vg 5
prepare_lvs_() prepare_lvs_()
{ {
lvremove -ff $vg; lvremove -ff $vg;
if dmsetup table|grep $vg; then
echo "ERROR: lvremove did leave some some mappings in DM behind!"
return 1
fi
: :
} }
@ -101,6 +105,10 @@ check_and_cleanup_lvs_()
{ {
lvs -a -o+devices $vg lvs -a -o+devices $vg
lvremove -ff $vg lvremove -ff $vg
if dmsetup table|grep $vg; then
echo "ERROR: lvremove did leave some some mappings in DM behind!"
return 1
fi
} }
recover_vg_() recover_vg_()

View File

@ -84,6 +84,11 @@ check_and_cleanup_lvs_() {
check_dev_sum_ $(lvdev_ $vg $lv3) check_dev_sum_ $(lvdev_ $vg $lv3)
lvs -a -o name $vg > out && ! grep ^pvmove out lvs -a -o name $vg > out && ! grep ^pvmove out
lvremove -ff $vg lvremove -ff $vg
if ! dmsetup table|not grep $vg; then
echo "ERROR: lvremove did leave some some mappings in DM behind!" &&
return 1
fi
:
} }
#COMM "check environment setup/cleanup" #COMM "check environment setup/cleanup"