[LTP] [PATCH] sched: add sched sysctl sanity test

Richard Palethorpe rpalethorpe@suse.de
Tue Oct 3 10:18:01 CEST 2023


Hello,

Cyril Hrubis <chrubis@suse.cz> writes:

> Hi!
>> > +static void rt_runtime_us_einval(void)
>> > +{
>> > +	TST_EXP_FAIL(write(runtime_fd, "-2", 2), EINVAL,
>> > +	             "echo -2 > "RT_RUNTIME_US);
>> > +}
>> 
>> I would happily add my tags to the test except that as a general
>> principal, I don't want to deal with tests that fail if an unexpected
>> error number is returned.
>> 
>> Unless something can be done (e.g. with meta-data), so that TST_EXP_FAIL
>> and similar can be reduced to a TCONF when the wrong errno is returned.
>> 
>> For instance, this would allow running the tests with a seccomp BPF
>> profile, LSM, CGroup or /proc bind mount that blocks the write.
>> 
>> Or you could just seperate the tests I guess. Then the reset can be
>> checked while skipping the errno checks.
>
> Hmm, so I guess that with LSM we are able to open these files R/W but we
> can stil get EPERM from the write() right?

Sorry, I thought there was an LSM hook in read, but AFAICT there is
not. It's possible that another hook get's called
(e.g. security_inode_getattr), but it's not immediately clear to me.

This still leaves seccomp bpf, FUSE, kernel module, etc. whatever is
mounted at /proc doesn't have to be the original file system. Container
runtimes do something with /proc to filter it. This situation seems to
get more complicated each year.

> I'm reluctant to add wildcard
> TCONF on any errno, but I guess that we can add a TST_EXP_FAIL macro
> version that would have one errno for PASS and one errno for TCONF.

I'm leaning increasingly towards partitioning the test, so that bits can
be filtered out somehow. Then people can focus on the bits they really
care about.

-- 
Thank you,
Richard.


More information about the ltp mailing list