[LTP] [PATCH v3 2/3] Add minimum kernel requirement for FS setup

Cyril Hrubis chrubis@suse.cz
Tue Oct 8 13:50:30 CEST 2024


Hi!
> >> diff --git a/testcases/lib/tst_run_shell.c b/testcases/lib/tst_run_shell.c
> >> index ee029b666..6b714c51c 100644
> >> --- a/testcases/lib/tst_run_shell.c
> >> +++ b/testcases/lib/tst_run_shell.c
> >> @@ -156,6 +156,7 @@ enum fs_ids {
> >>   	MKFS_VER,
> >>   	MNT_FLAGS,
> >>   	TYPE,
> >> +	FS_MIN_KVER,
> >>   };
> >>   
> >>   static ujson_obj_attr fs_attrs[] = {
> >> @@ -164,6 +165,7 @@ static ujson_obj_attr fs_attrs[] = {
> >>   	UJSON_OBJ_ATTR_IDX(MKFS_VER, "mkfs_ver", UJSON_STR),
> >>   	UJSON_OBJ_ATTR_IDX(MNT_FLAGS, "mnt_flags", UJSON_ARR),
> >>   	UJSON_OBJ_ATTR_IDX(TYPE, "type", UJSON_STR),
> >> +	UJSON_OBJ_ATTR_IDX(FS_MIN_KVER, "min_kver", UJSON_STR),
> > This is stil not sorted properly, the min_kver should go before the
> > mkfs_ver.
> >
> This is not clear to me. The objects are sorted mirroring the tst_fs 
> struct. Can you explain it better please?

This is a lookup table that has to be sorted by the string ID we are
looking up. Well technically the fs_ids enum has to be sorted so that
the string ids are sorted and the order of this array does not matter,
but it's easier to keep them both sorted alphabetically by the ID.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list