[LTP] [PATCH v4 3/3] lsmod01: Add kernel module

Petr Vorel pvorel@suse.cz
Thu Mar 5 14:08:48 CET 2020


Hi Joerg,

patchset merged, with tiny style changes.
Sorry for the delay with reviewing it.

...
> +module_inserted=0
We prefer in the shell library empty over 0.

> +
> +setup()
> +{
> +	if [ -z "$(cat /proc/modules)"  ]; then
> +		tst_res TINFO "Loading dummy kernel module"
> +		tst_require_module "ltp_lsmod01.ko"
> +		tst_require_root
> +		tst_require_cmds insmod
> +		insmod "$TST_MODPATH"
> +		if [ $? -ne 0 ]; then
> +			tst_res TBROK "insmod failed"
> +			return
> +		fi
> +
> +		module_inserted=1
> +	fi
> +}
> +
> +cleanup()
> +{
> +	if [ $module_inserted -ne 0 ]; then
> +		tst_res TINFO "Unloading dummy kernel module"
> +		rmmod ltp_lsmod01
> +		if [ $? -ne 0 ]; then
> +			tst_res TWARN "rmmod failed"
> +		fi
> +		module_inserted=0
This is not needed, thus omitted.

Kind regards,
Petr


More information about the ltp mailing list