Skip to contentSkip to conversation

LVM2/test t-lvcreate-usage.sh t-pvremove-usage ...

PATCH [email protected] 1 participant 1 message Jul 14, 2009

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: wysochanski at sourceware.org 2009-07-14 19:35:35

Modified files:
test : t-lvcreate-usage.sh t-pvremove-usage.sh
t-vgcreate-usage.sh

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

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvcreate-usage.sh.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-pvremove-usage.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgcreate-usage.sh.diff?cvsroot=lvm2&r1=1.8&r2=1.9

test/t-lvcreate-usage.sh +2 -0
@@ -21,6 +21,8 @@
 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;
test/t-pvremove-usage.sh +2 -3
@@ -16,9 +16,6 @@
 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 @@
     # 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
test/t-vgcreate-usage.sh +3 -0
@@ -21,6 +21,9 @@
 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