1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-30 17:18:21 +03:00

tests: also test swap devices in lvresize-fs.sh

This commit is contained in:
Peter Rajnoha 2024-09-19 13:33:01 +02:00
parent 5096335277
commit bd5ca83c43
No known key found for this signature in database
GPG Key ID: E776664036DF84AB

View File

@ -17,6 +17,7 @@ SKIP_WITH_LVMPOLLD=1
which mkfs.ext4 || skip
which resize2fs || skip
which mkswap || skip
aux prepare_vg 2 100
@ -649,5 +650,32 @@ df --output=size "$mount_dir" |tee df7
not diff df6 df7
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