From 8b6501e6e950ba2ef22571c5b4ca57eae2565fc6 Mon Sep 17 00:00:00 2001 From: Dave Wysochanski Date: Tue, 14 Jul 2009 19:35:35 +0000 Subject: [PATCH] Add a few negative tests which should fail cleanly if pv, vg, lvs don't exist. Signed-off-by: Dave Wysochanski --- test/t-lvcreate-usage.sh | 2 ++ test/t-pvremove-usage.sh | 5 ++--- test/t-vgcreate-usage.sh | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/t-lvcreate-usage.sh b/test/t-lvcreate-usage.sh index d947023ce..741351dc5 100755 --- a/test/t-lvcreate-usage.sh +++ b/test/t-lvcreate-usage.sh @@ -21,6 +21,8 @@ vgcreate -cn $vg $devs lvcreate -n $lv -l 4 $vg not lvcreate -n $lv -l 4 $vg lvremove -ff $vg/$lv +# try to remove it again - should fail (but not segfault) +not lvremove -ff $vg/$lv # "lvcreate rejects a negative stripe_size" not lvcreate -L 64M -n $lv -i2 --stripesize -4 $vg 2>err; diff --git a/test/t-pvremove-usage.sh b/test/t-pvremove-usage.sh index 412dccd48..1a5eee96d 100755 --- a/test/t-pvremove-usage.sh +++ b/test/t-pvremove-usage.sh @@ -16,9 +16,6 @@ pvcreate $dev1 pvcreate --metadatacopies 0 $dev2 pvcreate --metadatacopies 2 $dev3 -# check pvremove fails when bogus pv given -not pvremove $dev2 bogus - # failing, but still removing everything what can be removed # is somewhat odd as default, what do we have -f for? pvs | not grep $dev2 @@ -32,6 +29,8 @@ for mdacp in 0 1 2; do # check pvremove truly wipes the label (pvscan wont find) (---metadatacopies $mdacp) pvcreate --metadatacopies $mdacp $dev3 pvremove $dev3 + # try to remove agail - should fail cleanly + not pvremove $dev3 pvscan | not grep $dev3 # bz179473 refuse to wipe non-PV device without -f diff --git a/test/t-vgcreate-usage.sh b/test/t-vgcreate-usage.sh index f1b49eb49..1a3f83428 100755 --- a/test/t-vgcreate-usage.sh +++ b/test/t-vgcreate-usage.sh @@ -21,6 +21,9 @@ pvcreate --metadatacopies 0 $dev3 vgcreate $vg --physicalextentsize 8.00M $dev1 $dev2 check_vg_field_ $vg vg_extent_size 8.00M vgremove $vg +# try vgck and to remove it again - should fail (but not segfault) +not vgremove $vg +not vgck $vg #COMM 'vgcreate accepts smaller (128) maxlogicalvolumes for VG' vgcreate $vg --maxlogicalvolumes 128 $dev1 $dev2 -- 2.43.5