[igt-dev] [PATCH i-g-t] tests/core_unauth_vs_render: new test for the relaxed DRM_AUTH handling

Emil Velikov emil.l.velikov at gmail.com
Thu Feb 7 12:00:14 UTC 2019


Hi Petri,

Thanks for the feedback.

On Thu, 7 Feb 2019 at 08:59, Petri Latvala <petri.latvala at intel.com> wrote:

> > +     igt_info("Openning card node from a non-priv. user.\n");
> > +     igt_info("On failure, double-check the node permissions\n");
> > +     /* FIXME: relate to the master given and fix all of IGT */
> > +     slave = drm_open_driver(DRIVER_ANY);
> > +


> > +     bool imp = has_prime_import(slave);
> > +     bool rend = has_render_node(slave);
> > +     igt_info("import %d rend %d\n", imp, rend);
This debug will be dropped with next version.

> > +     if (has_prime_import(slave) && has_render_node(slave))
> > +             igt_assert(errno != EACCES);
> > +
> > +     else
> > +             igt_assert(errno == EACCES);
And this should be:

if (has_prime_import(slave)
   igt_skip(...)

if (has_render_node(slave))
    igt_assert(errno != EACCES);
else
    igt_assert(errno == EACCES);

The only problem is that igt_skip() does not work with igt_fork. Any
suggestions?

Fwiw, this problem inspired the igt_info() around drm_open_master(),
since the latter ends up calling igt_skip().

Somewhat orthogonal, it seems more intuitive and cleaner to have the
high-level decision of igt_skip/pass/assert in the test itself.
Although that's a topic for another time.

> > +igt_main
> > +{
> > +     int master;
> > +
> > +     igt_fixture
> > +             master = drm_open_driver(DRIVER_ANY);
> > +
> > +     igt_assert(check_auth(master) == true);
>
>
> You can't use igt_assert outside of igt_fixture/igt_subtest*.
>
Thanks will fix. Guess that explains why the CI failed here.
I wonder why this igt_assert() works just just fine on my local machine.

Thanks
Emil


More information about the igt-dev mailing list