[LTP] [PATCH v5 06/10] shell: Add $TST_SKIP_FILESYSTEMS + tests

Petr Vorel pvorel@suse.cz
Mon Sep 12 22:43:10 CEST 2022


...
> > +++ b/testcases/lib/tst_test.sh
> > @@ -626,6 +626,7 @@ tst_run()
> >  	local _tst_max
> >  	local _tst_name
> >  	local _tst_pattern='[='\''"} \t\/:`$\;].*'
> > +	local ret

> >  	if [ -n "$TST_TEST_PATH" ]; then
> >  		for _tst_i in $(grep '^[^#]*\bTST_' "$TST_TEST_PATH" | sed "s/.*TST_//; s/$_tst_pattern//"); do
> > @@ -644,6 +645,7 @@ tst_run()
> >  			CHECKPOINT_WAIT|CHECKPOINT_WAKE);;
> >  			CHECKPOINT_WAKE2|CHECKPOINT_WAKE_AND_WAIT);;
> >  			DEV_EXTRA_OPTS|DEV_FS_OPTS|FORMAT_DEVICE|MOUNT_DEVICE);;
> > +			SKIP_FILESYSTEMS);;
> >  			*) tst_res TWARN "Reserved variable TST_$_tst_i used!";;
> >  			esac
> >  		done
> > @@ -675,6 +677,10 @@ tst_run()
> >  			tst_brk TCONF "test requires kernel $TST_MIN_KVER+"
> >  	fi

> > +	tst_supported_fs -s "$TST_SKIP_FILESYSTEMS" $TST_FS_TYPE
> > +	ret=$?
> > +	[ $ret -ne 0 ] && return $ret

> So we actually depend here on the tst_supported_fs return value. So at
> least we have to do return TCONF in the helper binary even if ve move
> the messages into the library.

Yes. This is the equivalent of code in do_test_setup() (i.e. handling skipped
filesystems when testing single filesystem - *not* doing all filesystems loop).

Again, have C API function for looping filesystems and for single
filesystem would help avoiding duplicity, but not sure how to keep things simple
and readable. I'll try to think about it, but hints are welcome :).

Kind regards,
Petr

> >  	_tst_setup_timer

> >  	[ "$TST_MOUNT_DEVICE" = 1 ] && TST_FORMAT_DEVICE=1
> > -- 
> > 2.37.3


More information about the ltp mailing list