1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tests: test should clean devices it has created

To be able to detect lvm2 command is not leaking some
'unexpected' device - remove all devices before
test exits by its own command so test teardown
now can check what was 'left' unexpectedly.
This commit is contained in:
Zdenek Kabelac 2016-12-11 10:18:44 +01:00
parent 198f335139
commit bcf59a1b18
17 changed files with 31 additions and 4 deletions

View File

@ -21,3 +21,5 @@ lvcreate -n test -l 5 $vg
aux apitest lvtest $vg aux apitest lvtest $vg
check lv_field $vg/test lv_name test check lv_field $vg/test lv_name test
vgremove -ff $vg

View File

@ -32,3 +32,5 @@ check lv_field $vg/$lv1 seg_size_pe "8" # 8 * 256
# FIXME should we print info we are ignoring stripping? # FIXME should we print info we are ignoring stripping?
lvextend -L+1 -I64 -i2 $vg/$lv1 lvextend -L+1 -I64 -i2 $vg/$lv1
vgremove -ff $vg

View File

@ -149,6 +149,5 @@ fail lvconvert --yes --type snapshot $vg/$lv1 $vg/$lv2
fail lvconvert --yes --type snapshot $vg/$lv2 $vg/$lv1 fail lvconvert --yes --type snapshot $vg/$lv2 $vg/$lv1
fail lvconvert --yes --type thin-pool $vg/$lv1 fail lvconvert --yes --type thin-pool $vg/$lv1
lvremove -f $vg
vgremove -ff $vg vgremove -ff $vg
vgremove -ff $vg1

View File

@ -24,9 +24,10 @@ lvconvert --mirrorlog core $vg/mirror
not lvconvert -m 1 --mirrorlog disk $vg/mirror "$dev3" 2>&1 | tee errs not lvconvert -m 1 --mirrorlog disk $vg/mirror "$dev3" 2>&1 | tee errs
grep "two steps" errs grep "two steps" errs
test -e LOCAL_CLVMD && exit 0 if test ! -e LOCAL_CLVMD ; then
# FIXME mirrored unsupported in cluster # FIXME mirrored unsupported in cluster
not lvconvert -m 1 --mirrorlog mirrored $vg/mirror "$dev3" "$dev4" 2>&1 | tee errs not lvconvert -m 1 --mirrorlog mirrored $vg/mirror "$dev3" "$dev4" 2>&1 | tee errs
grep "two steps" errs grep "two steps" errs
fi
vgremove -ff $vg vgremove -ff $vg

View File

@ -32,3 +32,5 @@ grep "smaller" lvcreate.out
not lvcreate -s -l 4 -n snapB $vg/one 2>&1 | tee lvcreate.out not lvcreate -s -l 4 -n snapB $vg/one 2>&1 | tee lvcreate.out
not grep "suspend origin one" lvcreate.out not grep "suspend origin one" lvcreate.out
grep "smaller" lvcreate.out grep "smaller" lvcreate.out
vgremove -ff $vg

View File

@ -108,3 +108,5 @@ lvremove -f $vg/$lv
lvcreate -i2 -I 64k -l10 -n $lv $vg lvcreate -i2 -I 64k -l10 -n $lv $vg
lvreduce -f -l1 $vg/$lv lvreduce -f -l1 $vg/$lv
check lv_field $vg/$lv lv_size "8.00m" check lv_field $vg/$lv lv_size "8.00m"
vgremove -ff $vg

View File

@ -50,3 +50,5 @@ check lv_field $vg/$lv1 lv_size "5.00" --units m --nosuffix
# Try to resize again back up to the size of external origin # Try to resize again back up to the size of external origin
lvresize -L+5 -f $vg/$lv1 lvresize -L+5 -f $vg/$lv1
check lv_field $vg/$lv1 lv_size "10.00" --units m --nosuffix check lv_field $vg/$lv1 lv_size "10.00" --units m --nosuffix
vgremove -ff $vg

View File

@ -88,3 +88,5 @@ lvremove -f $vg
lvcreate -n foo -l 1 $vg lvcreate -n foo -l 1 $vg
lvs -a -S 'cache_policy=undefined' | grep foo lvs -a -S 'cache_policy=undefined' | grep foo
vgremove -ff $vg

View File

@ -45,3 +45,5 @@ vgcreate $vg "$created"
# 'no parse errors and VG really exists' # 'no parse errors and VG really exists'
vgs $vg 2>err vgs $vg 2>err
not grep "Parse error" err not grep "Parse error" err
dmsetup remove "${PREFIX}${pv_ugly}"

View File

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

View File

@ -32,3 +32,5 @@ not lvcreate -aey --type mirror -m 1 -l 1 -n mirror $vg # write operations fail
aux enable_dev "$dev1" aux enable_dev "$dev1"
lvcreate -aey --type mirror -m 1 -l 1 -n mirror $vg # no MDA => automatically restored lvcreate -aey --type mirror -m 1 -l 1 -n mirror $vg # no MDA => automatically restored
vgck $vg vgck $vg
vgremove -ff $vg

View File

@ -74,3 +74,5 @@ check vg_field $vg profile "thin-performance"
check lv_field $vg/pool_performance_inherited profile "" check lv_field $vg/pool_performance_inherited profile ""
$SHOULD check lv_field $vg/pool_performance_inherited chunk_size 1.00m $SHOULD check lv_field $vg/pool_performance_inherited chunk_size 1.00m
check lv_field $vg/pool_performance_inherited zero "" check lv_field $vg/pool_performance_inherited zero ""
vgremove -ff $vg

View File

@ -131,3 +131,5 @@ lvm dumpconfig --type profilable-command --file etc/profile/generated.profile
pvs --profile generated &> msg pvs --profile generated &> msg
not grep "$MSG_NOT_PROFILABLE" msg not grep "$MSG_NOT_PROFILABLE" msg
not grep "$MSG_IGNORING_INVALID_CMD_PROFILE" msg not grep "$MSG_IGNORING_INVALID_CMD_PROFILE" msg
vgremove -ff $vg1

View File

@ -32,3 +32,4 @@ grep "Logical volume bogus not found." err
# 'run the offending pvmove command' # 'run the offending pvmove command'
not pvmove -v -n$lv "$dev1":4294967296 "$dev2" not pvmove -v -n$lv "$dev1":4294967296 "$dev2"
vgremove -ff $vg

View File

@ -218,3 +218,5 @@ sel lv '(lv_name=vol1 || lv_name=vol2) && lv_size < 8m' vol2
sel lv '(lv_name=vol1 && lv_size=8m) && vg_tags=vg_tag2' vol1 sel lv '(lv_name=vol1 && lv_size=8m) && vg_tags=vg_tag2' vol1
# negation of clause grouped by ( ) # negation of clause grouped by ( )
sel lv '!(lv_name=vol1 || lv_name=vol2)' abc xyz orig snap sel lv '!(lv_name=vol1 || lv_name=vol2)' abc xyz orig snap
vgremove -ff $vg1 $vg2 $vg3

View File

@ -30,7 +30,7 @@ vgcreate -M1 -c n $vg $(cat DEVICES)
lvcreate -l1 -n $lv1 $vg "$dev1" lvcreate -l1 -n $lv1 $vg "$dev1"
pvremove -ff -y "$dev2" pvremove -ff -y "$dev2"
not lvcreate -l1 -n $lv1 $vg "$dev3" not lvcreate -l1 -n $lv1 $vg "$dev3"
lvchange -an $vg
vgcfgbackup -f "backup.$$" $vg vgcfgbackup -f "backup.$$" $vg
fi fi

View File

@ -35,3 +35,5 @@ check lv_field $vg/$lv1 lv_modules "zero"
check lv_field $vg/$lv1 segtype "zero" check lv_field $vg/$lv1 segtype "zero"
check lv_field $vg/$lv1 seg_count "1" check lv_field $vg/$lv1 seg_count "1"
check lv_field $vg/$lv1 seg_size_pe "8" # 8 * 256 check lv_field $vg/$lv1 seg_size_pe "8" # 8 * 256
vgremove -ff $vg