1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-12 13:18:31 +03:00

Add a few negative tests which should fail cleanly if pv, vg, lvs don't exist.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
Dave Wysochanski 2009-07-14 19:35:35 +00:00
parent cd93b0470b
commit ea18f8e19b
3 changed files with 7 additions and 3 deletions

View File

@ -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;

View File

@ -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

View File

@ -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