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

tests: more complex check for resize of reiserfs

Detection of how the command is supposed to behave actually depends on
the configure.h compilation and whether binary is compiled with
HAVE_BLKID_SUBLKS_FSINFO.

This makes it somewhat complicated in a way how to recognize which
behavior is expected.

Currently we can eventually recognize by checking error output
of some 'random' lvresize command and see if the --fs checksize is
actually recognized and rejected.  If this changes - test needs
to be updated.
This commit is contained in:
Zdenek Kabelac 2023-10-04 23:54:07 +02:00
parent b80404f2c6
commit ede63b5029

View File

@ -77,8 +77,8 @@ echo "$i"
# Adding couple udev wait ops as some older systemd
# might get confused and was 'randomly/racy' umounting
# devices just mounted.
#
# See for explanation:
#
# See for explanation:
# https://github.com/systemd/systemd/commit/628c89cc68ab96fce2de7ebba5933725d147aecc
# https://github.com/systemd/systemd/pull/2017
aux udev_wait
@ -125,11 +125,19 @@ not lvresize -L+10M -r $vg_lv_ren
umount "$mount_dir"
# ATM fsadm is required instead of '-r' option with reiserfs
USE_NOT=
# TODO: this is somewhat suprising for users
# Detect if the 'lvresize' was compiled with HAVE_BLKID_SUBLKS_FSINFO
# In such case --fs checksize is a supported parameter
# otherwise command automatically fallbacks to fsadm and resize reiserfs
not lvresize --fs checksize -L+1 $vg/XXX 2>err
if not grep "Unknown --fs value" err ; then
case "$i" in
# ATM fsadm is required instead of '-r' option with reiserfs
*reiserfs) USE_NOT="not" ;;
*) USE_NOT="" ;;
esac
fi
$USE_NOT lvresize -y -L+10M -r $vg_lv
aux udev_wait