[LTP] [PATCH 1/1] lib: Skip tst_{disable, enable}_oom_protection() for non-root

Petr Vorel pvorel@suse.cz
Wed Dec 22 11:24:25 CET 2021


Hi Cyril, all,

> Hi!
> > > >>> This is not working as expected in Github CI. I'm still looking at the
> > > >>> problem.

> > > https://github.com/wangli5665/ltp/runs/4602025797?check_suite_focus=true
> > > >> I tested local but it works well. I guess ci fails because of linux user
> > > >> namespace. Maybe we should require CAP_SYS_RESOURCE cap instead of using
> > > >> geteuid.
> > > > Good catch, verifying.
> > > You can refer to my ltp fork
> > > https://github.com/xuyang0410/ltp/commits/oom_kill_ci_fixes


> > +1

> > I was thinking of adding the permission but that's
> > might not be a good way for the namespace. Like your
> > method which only does check and return is better.

> Wouldn't it be actually easier just to catch the error from the actual
> write? The whole problem here is that we use SAFE_PRINTF() on something
> that may actualy fail and the failure shouldn't be fatal at all.

We use just FILE_PRINTF(), but we check the result and TWARN, which causes the
failure in CI.

I've sent v2, which checks CAP_SYS_ADMIN and CAP_SYS_RESOURCE,
but feel free just to bring simpler solution.

Kind regards,
Petr


More information about the ltp mailing list