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:
parent
198f335139
commit
bcf59a1b18
@ -21,3 +21,5 @@ lvcreate -n test -l 5 $vg
|
||||
aux apitest lvtest $vg
|
||||
|
||||
check lv_field $vg/test lv_name test
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@ -32,3 +32,5 @@ check lv_field $vg/$lv1 seg_size_pe "8" # 8 * 256
|
||||
|
||||
# FIXME should we print info we are ignoring stripping?
|
||||
lvextend -L+1 -I64 -i2 $vg/$lv1
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@ -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 thin-pool $vg/$lv1
|
||||
|
||||
lvremove -f $vg
|
||||
|
||||
vgremove -ff $vg
|
||||
vgremove -ff $vg1
|
||||
|
@ -24,9 +24,10 @@ lvconvert --mirrorlog core $vg/mirror
|
||||
not lvconvert -m 1 --mirrorlog disk $vg/mirror "$dev3" 2>&1 | tee errs
|
||||
grep "two steps" errs
|
||||
|
||||
test -e LOCAL_CLVMD && exit 0
|
||||
if test ! -e LOCAL_CLVMD ; then
|
||||
# FIXME mirrored unsupported in cluster
|
||||
not lvconvert -m 1 --mirrorlog mirrored $vg/mirror "$dev3" "$dev4" 2>&1 | tee errs
|
||||
grep "two steps" errs
|
||||
fi
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@ -32,3 +32,5 @@ grep "smaller" lvcreate.out
|
||||
not lvcreate -s -l 4 -n snapB $vg/one 2>&1 | tee lvcreate.out
|
||||
not grep "suspend origin one" lvcreate.out
|
||||
grep "smaller" lvcreate.out
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@ -108,3 +108,5 @@ lvremove -f $vg/$lv
|
||||
lvcreate -i2 -I 64k -l10 -n $lv $vg
|
||||
lvreduce -f -l1 $vg/$lv
|
||||
check lv_field $vg/$lv lv_size "8.00m"
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@ -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
|
||||
lvresize -L+5 -f $vg/$lv1
|
||||
check lv_field $vg/$lv1 lv_size "10.00" --units m --nosuffix
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@ -88,3 +88,5 @@ lvremove -f $vg
|
||||
|
||||
lvcreate -n foo -l 1 $vg
|
||||
lvs -a -S 'cache_policy=undefined' | grep foo
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@ -45,3 +45,5 @@ vgcreate $vg "$created"
|
||||
# 'no parse errors and VG really exists'
|
||||
vgs $vg 2>err
|
||||
not grep "Parse error" err
|
||||
|
||||
dmsetup remove "${PREFIX}${pv_ugly}"
|
||||
|
@ -84,3 +84,5 @@ check active $vg linear2
|
||||
check active $vg linear12
|
||||
check active $vg mirror12
|
||||
check active $vg mirror123
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@ -32,3 +32,5 @@ not lvcreate -aey --type mirror -m 1 -l 1 -n mirror $vg # write operations fail
|
||||
aux enable_dev "$dev1"
|
||||
lvcreate -aey --type mirror -m 1 -l 1 -n mirror $vg # no MDA => automatically restored
|
||||
vgck $vg
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@ -74,3 +74,5 @@ check vg_field $vg profile "thin-performance"
|
||||
check lv_field $vg/pool_performance_inherited profile ""
|
||||
$SHOULD check lv_field $vg/pool_performance_inherited chunk_size 1.00m
|
||||
check lv_field $vg/pool_performance_inherited zero ""
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@ -131,3 +131,5 @@ lvm dumpconfig --type profilable-command --file etc/profile/generated.profile
|
||||
pvs --profile generated &> msg
|
||||
not grep "$MSG_NOT_PROFILABLE" msg
|
||||
not grep "$MSG_IGNORING_INVALID_CMD_PROFILE" msg
|
||||
|
||||
vgremove -ff $vg1
|
||||
|
@ -32,3 +32,4 @@ grep "Logical volume bogus not found." err
|
||||
# 'run the offending pvmove command'
|
||||
not pvmove -v -n$lv "$dev1":4294967296 "$dev2"
|
||||
|
||||
vgremove -ff $vg
|
||||
|
@ -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
|
||||
# negation of clause grouped by ( )
|
||||
sel lv '!(lv_name=vol1 || lv_name=vol2)' abc xyz orig snap
|
||||
|
||||
vgremove -ff $vg1 $vg2 $vg3
|
||||
|
@ -30,7 +30,7 @@ vgcreate -M1 -c n $vg $(cat DEVICES)
|
||||
lvcreate -l1 -n $lv1 $vg "$dev1"
|
||||
pvremove -ff -y "$dev2"
|
||||
not lvcreate -l1 -n $lv1 $vg "$dev3"
|
||||
lvchange -an $vg
|
||||
vgcfgbackup -f "backup.$$" $vg
|
||||
|
||||
fi
|
||||
|
||||
|
@ -35,3 +35,5 @@ check lv_field $vg/$lv1 lv_modules "zero"
|
||||
check lv_field $vg/$lv1 segtype "zero"
|
||||
check lv_field $vg/$lv1 seg_count "1"
|
||||
check lv_field $vg/$lv1 seg_size_pe "8" # 8 * 256
|
||||
|
||||
vgremove -ff $vg
|
||||
|
Loading…
Reference in New Issue
Block a user