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

tests: updates

Add some vgremove calls.
Remove uneeded test for some unused commands.
Add tests for missing commands.
This commit is contained in:
Zdenek Kabelac 2014-02-26 23:25:30 +01:00
parent d00fc1de78
commit 47b15b805e
70 changed files with 136 additions and 20 deletions

View File

@ -21,3 +21,5 @@ lvchange $vg/foo -My --major=255 --minor=123
lvchange $vg/foo -a y
dmsetup info $vg-foo | tee info
egrep "^Major, minor: *[0-9]+, 123" info
vgremove -ff $vg

View File

@ -27,3 +27,5 @@ aux disable_dev "$dev1"
not vgchange -a y $vg
vgchange -a y --partial $vg
check active $vg span
vgremove -ff $vg

View File

@ -84,3 +84,5 @@ check active $vg linear2
check active $vg linear12
check active $vg mirror12
check active $vg mirror123
vgremove -ff $vg

View File

@ -28,4 +28,4 @@ vgchange -a n --partial $vg
vgchange -aey --partial $vg
# check vgremove
vgremove -f $vg
vgremove -ff $vg

View File

@ -30,3 +30,5 @@ get lv_field $vg/$lv1 lv_attr | grep -- "-wi------k"
lvchange -ay -K $vg
check active $vg $lv1
vgremove -ff $vg

View File

@ -122,3 +122,5 @@ lvcreate -l1 -an -Zn $vg3
vgdisplay -s -A | grep $vg1
vgdisplay -s -A | grep $vg2
vgdisplay -s -A | not grep $vg3
vgremove -ff $vg1 $vg2 $vg3

View File

@ -17,10 +17,12 @@ aux prepare_vg 1 100
# set to "skip" to avoid testing given fs and test warning result
# i.e. check_reiserfs=skip
check_ext2=
check_ext3=
check_xfs=
check_reiserfs=
which mkfs.ext2 || check_ext2=${check_ext2:-mkfs.ext2}
which mkfs.ext3 || check_ext3=${check_ext3:-mkfs.ext3}
which fsck.ext3 || check_ext3=${check_ext3:-fsck.ext3}
which mkfs.xfs || check_xfs=${check_xfs:-mkfs.xfs}

View File

@ -73,3 +73,5 @@ vgextend $vg "$dev2"
aux restore_dev "$dev2"
vgscan $cache
should check compare_fields vgs $vg vg_mda_count pvs "$dev2" vg_mda_count
vgremove -ff $vg

View File

@ -72,3 +72,5 @@ not diff out out2
aux disable_dev $dev1
pvs -o +pv_uuid | grep BADBEE-BAAD-BAAD-BAAD-BAAD-BAAD-BADBEE
vgremove -ff $vg

View File

@ -39,3 +39,5 @@ flock_pid=`jobs -p`
not vgremove --config 'global { wait_for_locks = 0 }' $vg
test -f $TESTDIR/var/lock/lvm/P_orphans # still running
kill $flock_pid
vgremove -ff $vg

View File

@ -38,3 +38,5 @@ aux enable_dev "$dev1"
# Check removed $lv2 does not reappear
not check lv_exists $vg $lv2
vgremove -ff $vg

View File

@ -31,4 +31,5 @@ lvchange -an $vg/$lv1
check mirror $vg $lv1 "$dev3"
lvchange --resync $vg/$lv1
check mirror $vg $lv1 "$dev3"
lvremove -ff $vg
vgremove -ff $vg

View File

@ -26,4 +26,5 @@ lvchange -ay $vg/$lv1 --partial
lvchange -an $vg/$lv1
aux enable_dev "$dev1"
lvremove -ff $vg
vgremove -ff $vg

View File

@ -67,4 +67,5 @@ not lvchange --resync -ay $vg/$lv1
not lvchange --resync --addtag foo $vg/$lv1
aux enable_dev "$dev1"
lvremove -ff $vg
vgremove -ff $vg

View File

@ -357,3 +357,5 @@ for i in "-" "snapshot" "thinpool_data" "thinpool_meta"; do
run_checks $vg $lv1 $i
lvremove -ff $vg
done
vgremove -ff $vg

View File

@ -10,4 +10,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. ./shell/lvconvert-mirror-basic.sh
test_many 0
vgremove -ff $vg

View File

@ -10,4 +10,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. ./shell/lvconvert-mirror-basic.sh
test_many 1
vgremove -ff $vg

View File

@ -10,4 +10,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. ./shell/lvconvert-mirror-basic.sh
test_many 2
vgremove -ff $vg

View File

@ -10,4 +10,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
. ./shell/lvconvert-mirror-basic.sh
test_many 3
vgremove -ff $vg

View File

@ -305,3 +305,5 @@ lvchange -an $vg/$lv1
lvconvert --mirrorlog disk $vg/$lv1 "$dev3:0-1"
check mirror $vg $lv1 "$dev3"
lvremove -ff $vg
vgremove -ff $vg

View File

@ -239,3 +239,5 @@ for i in 4 5 6; do
lvremove -ff $vg
done
vgremove -ff $vg

View File

@ -55,4 +55,4 @@ for i in 0 1; do
aux wait_for_sync $vg $lv1
done
lvremove -ff $vg
vgremove -ff $vg

View File

@ -89,3 +89,5 @@ repair 'activation { mirror_log_fault_policy = "remove" }'
check mirror $vg mirror core
not check lv_exists $vg mirror_mlog
cleanup "$dev3" "$dev4"
vgremove -ff $vg

View File

@ -25,3 +25,5 @@ vgreduce --removemissing $vg
aux enable_dev "$dev2" "$dev4"
lvs -a -o +devices $vg
check mirror $vg 4way "$dev5"
vgremove -ff $vg

View File

@ -114,3 +114,5 @@ should vgremove -ff $vg
# Let's do a final forced cleanup
pvremove --yes -ff "$dev3"
pvremove --yes -ff "$dev4"
vgremove -ff $vg

View File

@ -26,3 +26,5 @@ test -e LOCAL_CLVMD && exit 0
# FIXME mirrored unsupported in cluster
not lvconvert -m 1 --mirrorlog mirrored $vg/mirror "$dev3" "$dev4" 2>&1 | tee errs
grep "two steps" errs
vgremove -ff $vg

View File

@ -127,7 +127,6 @@ lvremove -ff $vg
# Attempt to create smaller cache than origin should fail
lvcreate -l 1 -n $lv1 $vg
not lvcreate --type cache -l 2 $vg/$lv1
lvremove -ff $vg
# Option testing
@ -135,3 +134,5 @@ lvremove -ff $vg
# --cachepolicy
# --poolmetadatasize
# --poolmetadataspare
vgremove -ff $vg

View File

@ -71,4 +71,4 @@ lvremove -ff $vg1
# bz837927 END
lvremove -ff $vg
vgremove -ff $vg

View File

@ -38,6 +38,6 @@ vgcreate $vg1 "$DM_DEV_DIR"/$vg/$lv[12345]
lvcreate --type raid10 -m 1 -i 2 -L 200T -n $lv1 $vg1 --nosync
check lv_field $vg1/$lv1 size "200.00t"
lvremove -ff $vg1
vgremove -ff $vg1
lvremove -ff $vg
vgremove -ff $vg

View File

@ -41,3 +41,5 @@ check lv_field $vg1/$lv1 size "737.28t"
lvremove -ff $vg1/$lv1
lvremove -ff $vg/$lv
vgremove -ff $vg

View File

@ -34,3 +34,5 @@ lvremove -ff $vg
# creating 2-way mirror with disklog from 2 PVs fails
not lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2"
vgremove -ff $vg

View File

@ -17,3 +17,5 @@ dmsetup remove -f "$dev1" || true
finish_udev_transaction
not lvcreate -n "foo" $vg -l 1
vgremove -ff $vg

View File

@ -42,3 +42,5 @@ cleanup_lvs
# Create mirror on one dev with mirrored log using --alloc anywhere, should fail
not lvcreate --type mirror -m 1 -l4 -n $lv1 --mirrorlog mirrored $vg --alloc anywhere "$dev1"
cleanup_lvs
vgremove -ff $vg

View File

@ -187,4 +187,5 @@ lvcreate --type raid5 -l2 -n raid5 $vg
lv_devices $vg raid5 6
lvcreate --type raid6 -l3 -n raid6 $vg
lv_devices $vg raid6 6
lvremove -ff $vg
vgremove -ff $vg

View File

@ -80,3 +80,4 @@ lvremove -ff $vg
#
# FIXME: Add tests that specify particular PVs to use for creation
#
vgremove -ff $vg

View File

@ -27,6 +27,7 @@ check_lv_field_modules_()
# Main
#
aux have_thin 1 0 0 || skip
which mkfs.ext4 || skip
aux prepare_pvs 2 64
@ -34,8 +35,8 @@ vgcreate $vg -s 64K $(cat DEVICES)
lvcreate -L10M -V10M -T $vg/pool --name $lv1
mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
# create thin snapshot of thin LV
lvcreate -K -s $vg/$lv1 --name snap
# create read-only thin snapshot of thin LV
lvcreate -K -s $vg/$lv1 -pr --name snap
# check snapshot filesystem was properly frozen before snapping
fsck -n "$DM_DEV_DIR/$vg/snap"
lvcreate -K -s $vg/$lv1 --name $lv2

View File

@ -25,11 +25,11 @@ check_lv_field_modules_()
done
}
#
# Main
#
aux have_thin 1 0 0 || skip
which mkfs.ext4 || skip
aux prepare_pvs 2 64

View File

@ -34,3 +34,5 @@ lvs
lvs -a $vg2 -o+devices 2>&1 | tee out
not grep reappeared out
vgremove -ff $vg1 $vg2

View File

@ -36,3 +36,5 @@ lvmetad_dump() {
lvmetad_dump ./lvmetad.socket | tee lvmetad.txt
grep $vg1 lvmetad.txt
vgremove -ff $vg1

View File

@ -17,3 +17,5 @@ aux prepare_lvmetad
vgs -vv 2> errs
cat errs
grep 'use_lvmetad' errs
vgremove -ff $vg

View File

@ -23,3 +23,4 @@ lvchange -ay $vg1 --config 'global { use_lvmetad = 0 }' 2>&1 | not grep "Failed
aux lvmconf "global/use_lvmetad = 0"
lvchange -ay $vg1 --config 'global { use_lvmetad = 1 }' 2>&1 | grep "Failed to connect"
vgremove -ff $vg1

View File

@ -21,3 +21,5 @@ vgs | grep $vg1
pvscan --cache
vgs | grep $vg1
vgremove -ff $vg1

View File

@ -47,3 +47,5 @@ pvscan --cache $dev1 -aay
aux lvmconf 'global/use_lvmetad = 0'
check active $vg1 foo
aux lvmconf 'global/use_lvmetad = 1'
vgremove -ff $vg1

View File

@ -21,3 +21,5 @@ kill $(cat LOCAL_LVMETAD)
aux prepare_lvmetad
vgs | grep $vg1
vgremove -ff $vg1

View File

@ -25,3 +25,5 @@ lvchange -ay $vg1 --sysinit 2>&1 | not grep "Failed to connect"
aux prepare_lvmetad
lvchange -ay $vg1 2>&1 | not grep "Failed to connect"
lvchange -ay $vg1 --sysinit 2>&1 | not grep "Failed to connect"
vgremove -ff $vg

View File

@ -41,3 +41,5 @@ for deactivate in true false; do
lvremove -ff $vg
done
vgremove -ff $vg

View File

@ -13,7 +13,6 @@ test_description="ensure pvmove works with all common segment types"
. lib/test
which mkfs.ext2 || skip
which md5sum || skip
aux prepare_pvs 5 20
@ -96,3 +95,5 @@ check lv_tree_on $vg ${lv1}_foo "$dev5"
check dev_md5sum $vg snap
lvremove -ff $vg
fi
vgremove -ff $vg

View File

@ -14,7 +14,6 @@ test_description="ensure that pvmove works with basic options"
. lib/test
which mkfs.ext2 || skip
which md5sum || skip
# ---------------------------------------------------------------------

View File

@ -20,7 +20,6 @@ test_description="ensure pvmove works with the cache segment types"
# stacking complications to consider.
test -e LOCAL_CLVMD && skip
which mkfs.ext2 || skip
which md5sum || skip
aux target_at_least dm-cache 1 3 0 || skip

View File

@ -14,7 +14,6 @@ test_description="ensure pvmove works with raid segment types"
. lib/test
test -e LOCAL_CLVMD && skip
which mkfs.ext2 || skip
which md5sum || skip
aux target_at_least dm-raid 1 3 5 || skip
@ -76,4 +75,5 @@ pvmove -n $lv1 "$dev5" "$dev4"
check lv_tree_on $vg $lv1 "$dev2" "$dev3" "$dev4"
check lv_tree_on $vg ${lv1}_foo "$dev5"
check dev_md5sum $vg $lv1
lvremove -ff $vg
vgremove -ff $vg

View File

@ -71,3 +71,5 @@ pvmove --abort
aux delay_dev "$dev3"
lvs -a -o+devices $vg
vgremove -ff $vg

View File

@ -13,7 +13,6 @@ test_description="ensure pvmove works with thin segment types"
. lib/test
test -e LOCAL_CLVMD && skip
which mkfs.ext2 || skip
which md5sum || skip
aux target_at_least dm-thin-pool 1 8 0 || skip
@ -65,3 +64,5 @@ check lv_tree_on $vg $lv1 "$dev2" "$dev4"
check lv_tree_on $vg ${lv1}_foo "$dev5"
check dev_md5sum $vg $lv1
lvremove -ff $vg
vgremove -ff $vg

View File

@ -66,3 +66,5 @@ for mdacp in 0 1 2; do
pvcreate --metadatacopies $mdacp "$dev1"
vgextend $vg "$dev1"
done
vgremove -ff $vg

View File

@ -46,4 +46,5 @@ lvchange -r 512 $vg/$lv
lvchange -ay $vg/$lv
check lv_field $vg/$lv lv_read_ahead 256.00k
check lv_field $vg/$lv lv_kernel_read_ahead 256.00k
lvremove -ff $vg
vgremove -ff $vg

View File

@ -26,3 +26,5 @@ lvcreate -s $vg/origin -n snap_with_lvm1_meta -l4
# Remove volume snapper/snap_with_lvm1_meta
lvremove -f $vg/snap_with_lvm1_meta
vgremove -ff $vg

View File

@ -71,3 +71,5 @@ lvchange --deltag firstlvtag2 $vg1/$lv1
lvchange --deltag firstlvtag2 $vg1/$lv1
check lv_field $vg1/$lv1 tags "firstlvtag1,firstlvtag3"
check lv_field $vg1/$lv2 tags "secondlvtag1,secondlvtag2,secondlvtag3"
vgremove -ff $vg1

View File

@ -32,3 +32,5 @@ vgcfgbackup -f bak2 $vg
egrep -v 'description|seqno|creation_time|Generated' < bak0.orig > a
egrep -v 'description|seqno|creation_time|Generated' < bak2 > b
diff -u a b
vgremove -ff $vg

View File

@ -42,3 +42,5 @@ aux enable_dev "$dev1"
check_
test -e LOCAL_LVMETAD && lvremove $vg/boo # FIXME trigger a write :-(
check_ not
vgremove -ff $vg

View File

@ -102,3 +102,4 @@ not grep $lv3 err
grep $lv2 err
not grep $lv4 err
vgremove -ff $vg1 $vg2

View File

@ -50,3 +50,5 @@ vgcfgrestore -f data_new $vg
# Activate and deactivate all of them
vgchange -ay $vg
vgchange -an $vg
vgremove -ff $vg

View File

@ -28,3 +28,5 @@ not lvcreate -n three -l 1 $vg
vgchange --monitor y $vg
vgchange -an $vg 2>&1 | tee vgchange.out
not grep "event server" vgchange.out
vgremove -ff $vg

View File

@ -50,3 +50,5 @@ not vgchange --vgmetadatacopies 2 $vg
# Ensure that allowed args don't cause disallowed args to get through
#
not vgchange -p 10 --addtag foo $vg
vgremove -ff $vg

View File

@ -50,3 +50,8 @@ vgchange --sysinit -an $vg2
test ! -b "$DM_DEV_DIR/$vg2/$lv2"
vgchange --ignorelockingfailure -ay $vg2
# TODO maybe also support --ignorelockingfailure ??
vgremove --config 'global{locking_type=0}' -ff $vg2
umount "$mount_dir" || true
vgremove -ff $vg1

View File

@ -42,3 +42,4 @@ not vgchange -l 1 $vg 2>err
grep "MaxLogicalVolume is less than the current number $lv_count of LVs for" err
aux check vg_field $vg max_lv 128
vgremove -ff $vg

View File

@ -29,3 +29,5 @@ fi
dd if=/dev/urandom bs=512 seek=2 count=32 of=$dev2
vgck $vg 2>&1 | tee vgck.out
grep Incorrect vgck.out
vgremove -ff $vg

View File

@ -27,3 +27,5 @@ not lvcreate -aey --type mirror -m 1 -l 1 -n mirror $vg # write operations fail
vgextend --restore $vg "$dev1" # restore the missing device
vgck $vg
lvcreate -an -Zn --type mirror -m 1 -l 1 -n mirror $vg
vgremove -ff $vg

View File

@ -43,3 +43,5 @@ aux notify_lvmetad "$dev1"
# Verify we can activate / deactivate the LV from both VGs
lvchange -ay $vg1/$lv1 $vg2/$lv1
vgchange -an $vg1 $vg2
vgremove -ff $vg1 $vg2

View File

@ -33,3 +33,5 @@ vgreduce -v --removemissing --force $vg # "$dev2" "$dev4"
lvs -a -o +devices $vg | not grep unknown
lvs -a -o +devices $vg
check mirror $vg 4way "$dev5"
vgremove -ff $vg

View File

@ -87,3 +87,5 @@ aux enable_dev "$dev1"
pvs -P $(cat DEVICES) # for record
lvs -P $vg1 # for record
vgs -P $vg1 # for record
vgremove -ff $vg1

View File

@ -25,3 +25,5 @@ vgchange -a n $vg $vg1
# this should fail but not segfault, RHBZ 481793.
not vgsplit $vg $vg1 "$dev3"
vgremove -ff $vg $vg1