[LTP] function tst_parse_cmdline exist?

Li Wang liwang@redhat.com
Tue Mar 5 04:15:18 CET 2024


On Mon, Mar 4, 2024 at 11:24 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > Do we have a funcion similar to tst_parse_cmdline() in LTP lib?
>
> Not yet.
>
> > I asking this because recently people reached to me about the
> > init_module01 failing on the system with ' module.sig_enforce=1'
> > kernel parameter. That makes me think there are quite many
> > various kernel parameter changes in some behavior when added in,
> > so if not, I can help to create one to do such a thing.
>
> I suppose that there is no other way to figure out that the signatures
> are enforced via commandline, right?
>

Right (at least based on my knowledge), we have to parse '/proc/cmdline'
and detect the key parameters for determining where the test goes next.

(i.e. init_module01: PASS without that parameter 'module.sig_enforce=1',
FAIL as expected with having it)



>
> > In a word, the main purpose is just to parse '/proc/cmdline' contents
> > and export the necessary value to test case.
> >
> > Or, any suggestions on the topic?
>
> We already parse cmdline in the stack_clash.c test, so I suppose we may
> as well add a function to the test library.
>

Thanks for the info, I guess we need a more generic function for wide use
in the lib, I prefer to name it tst_parse_kcmdline() simply but maybe extend
something if necessary.


-- 
Regards,
Li Wang


More information about the ltp mailing list