[LTP] [PATCH v1] tst_sys_conf.c: Report TCONF if read path trigger error such as EOPNOTSUPP

Cyril Hrubis chrubis@suse.cz
Wed Sep 3 10:43:40 CEST 2025


Hi!
> We encounter EOPNOTSUPP error when read path in old sle power test env, the reason is
> hugepages are disabled. Detail error information such as:
> TEST cpuset02:
> tst_sys_conf.c:103: TBROK: Failed to read anything from '/proc/sys/vm/nr_hugepages': EOPNOTSUPP (95)
> 
> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
>  lib/tst_sys_conf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/tst_sys_conf.c b/lib/tst_sys_conf.c
> index 80cd83569..30b0b67a8 100644
> --- a/lib/tst_sys_conf.c
> +++ b/lib/tst_sys_conf.c
> @@ -99,7 +99,8 @@ int tst_sys_conf_save(const struct tst_path_val *conf)
>  		if (conf->flags & TST_SR_IGNORE_ERR)
>  			return 1;
>  
> -		tst_brk(TBROK | TERRNO, "Failed to read anything from '%s'",
> +		ttype = conf->flags ? TBROK : TCONF;

This is wrong for two reasons:

We have to make sure to use the correct flag here. I suppose that we can
treat the EOPNOTSUPP the same as the file to be missing. So we would
change the outcome based on the TST_SR_*_MISSING flags.

All errnos but EOPNOTSUPP should be treated as a TBROK as they were
before.

> +		tst_brk(ttype | TERRNO, "Failed to read anything from '%s'",
>  			conf->path);
>  	}
>  
> -- 
> 2.51.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list