[LTP] [PATCH v5 07/10] tst_test.sh: Introduce TST_FS_TYPE_FUSE

Petr Vorel pvorel@suse.cz
Mon Sep 12 22:04:35 CEST 2022


> Hi!
> > @@ -307,6 +307,18 @@ tst_mount()
> >  	if [ $ret -ne 0 ]; then
> >  		tst_brk TBROK "Failed to mount device${mnt_err}: mount exit = $ret"
> >  	fi
> > +
> > +	mnt_real="$(grep -E "$TST_MNTPOINT ($TST_FS_TYPE|fuseblk)" /proc/mounts | awk 'NR==1{print $3}')"
> > +	case $mnt_real in
> > +		'') tst_brk TBROK 'Failed to found filesystem type in /proc/mounts';;
> > +		'fuseblk') TST_FS_TYPE_FUSE=1;;
> > +		*)
> > +			if [ "$mnt_real" != "$TST_FS_TYPE" ]; then
> > +				tst_brk TBROK "$mnt_real: unsupported type in /proc/mounts"
> > +			fi
> > +			TST_FS_TYPE_FUSE=
> > +		;;
> > +		esac
> >  }

> I just wonder if this is worth being added to the test library just for
> a single test. Or do you expect this to be usable in more than df01.sh?
Well, the inspiration was the C API, which also allows to skip fuse.
But sure, I can handle it just in df01.sh, just let me know the result.

> Also maybe it would be a better as a function so that the code does not
> run unconditionally on each tst_mount() call?
Do you mean e.g. tst_is_fuse() and df01.sh would call it?

Kind regards,
Petr


More information about the ltp mailing list