mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
tests: also test swap devices in lvresize-fs.sh
This commit is contained in:
parent
5096335277
commit
bd5ca83c43
@ -17,6 +17,7 @@ SKIP_WITH_LVMPOLLD=1
|
|||||||
|
|
||||||
which mkfs.ext4 || skip
|
which mkfs.ext4 || skip
|
||||||
which resize2fs || skip
|
which resize2fs || skip
|
||||||
|
which mkswap || skip
|
||||||
|
|
||||||
aux prepare_vg 2 100
|
aux prepare_vg 2 100
|
||||||
|
|
||||||
@ -649,5 +650,32 @@ df --output=size "$mount_dir" |tee df7
|
|||||||
not diff df6 df7
|
not diff df6 df7
|
||||||
umount "$mount_dir"
|
umount "$mount_dir"
|
||||||
|
|
||||||
|
lvremove -f $vg
|
||||||
|
|
||||||
|
######################################
|
||||||
|
#
|
||||||
|
# lvreduce, lvextend with swap device
|
||||||
|
#
|
||||||
|
######################################
|
||||||
|
|
||||||
|
lvcreate -n $lv -L 16M $vg
|
||||||
|
mkswap /dev/$vg/$lv
|
||||||
|
|
||||||
|
# lvreduce not allowed if LV size < swap size
|
||||||
|
not lvreduce --fs checksize -L8m $vg/$lv
|
||||||
|
check lv_field $vg/$lv lv_size "16.00m"
|
||||||
|
|
||||||
|
# lvreduce not allowed if LV size < swap size,
|
||||||
|
# even with --fs resize, this is not supported
|
||||||
|
not lvreduce --fs resize $vg/$lv
|
||||||
|
check lv_field $vg/$lv lv_size "16.00m"
|
||||||
|
|
||||||
|
# lvextend allowed if LV size > swap size
|
||||||
|
lvextend -L32m $vg/$lv
|
||||||
|
check lv_field $vg/$lv lv_size "32.00m"
|
||||||
|
|
||||||
|
# lvreduce allowed if LV size == swap size
|
||||||
|
lvreduce -L16m $vg/$lv
|
||||||
|
check lv_field $vg/$lv lv_size "16.00m"
|
||||||
|
|
||||||
vgremove -ff $vg
|
vgremove -ff $vg
|
||||||
|
Loading…
Reference in New Issue
Block a user