[LTP] Do we have some simple way to get the current cgroup.procs path?

Li Wang liwang@redhat.com
Thu Jul 14 12:24:41 CEST 2022


Hi Xu,

On Thu, Jul 14, 2022 at 2:02 PM xuyang2018.jy@fujitsu.com <
xuyang2018.jy@fujitsu.com> wrote:

> Hi Richard, LI
>
> I am writting a simple regression test[1]that refer to kernel selftest
> cgroup test_core[2]. I may name it as memcontrol05.c.
>
> It tests cgroup migration permission check should be performed based on
> the credentials at the time of open instead of write.
>
> I have used ltp cgroup framework, but ltp cgroup only use
> SAFE_CGROUP_PRINTF to write value.
>
> How can get the cgroup root_dir ltp_dir path? So I can open this fd
> and change/save effective uid between open and write?
>

Not sure if I fully understand your requirements.
Can we achieve this test by creating a two-layer subdirectory?

Does only the root/ltp_dir mandatory for completing your test?
If yes, I think tst_cg_print_config() maybe fits your purpose,
but that would need additional function help extracting that.

Take a reference to see how Luke gets the root path (in shell):
https://lists.linux.it/pipermail/ltp/2022-April/028772.html


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220714/25f8049b/attachment.htm>


More information about the ltp mailing list