[Piglit] [PATCH] egl_ext_device_drm: don't fail the test if open("/dev/dri/cardX") errors

Mathias Fröhlich Mathias.Froehlich at gmx.net
Sun Oct 21 06:45:39 UTC 2018

Good morning,

On Wednesday, 3 October 2018 14:21:56 CEST Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
> As pointed out by Mathias opening the card node can fail in some cases.
> In boils down to a) the node is owned by root:video b) by default, the
> user is not part of the video group c) logind dynamically allows any
> user to open the node, once a user has logged-in.
> Thus if we use a remote machine accessible only over ssh, the test will
> fail. A fairly common setup that one could use for their CI.
> Demote the failure to a warning.
> Cc: Mathias Fröhlich <mathias.froehlich at web.de>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  tests/egl/spec/egl_ext_device_drm/egl_ext_device_drm.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> diff --git a/tests/egl/spec/egl_ext_device_drm/egl_ext_device_drm.c b/tests/egl/spec/egl_ext_device_drm/egl_ext_device_drm.c
> index 537c8b60f..2236783c8 100644
> --- a/tests/egl/spec/egl_ext_device_drm/egl_ext_device_drm.c
> +++ b/tests/egl/spec/egl_ext_device_drm/egl_ext_device_drm.c
> @@ -162,7 +162,9 @@ main(void)
>  		if (fd < 0) {
>  			printf("Failed to open drm device file %s: %s\n",
>  				devstring, strerror(errno));
> -			piglit_report_result(PIGLIT_FAIL);
> +			printf("Make sure you have permissions to open %s\n");
> +			result = PIGLIT_WARN;
> +			continue;

Sorry for being picky, but you are missing the eglTerminate on dpy1 with that continue.

With that eglTerminate:
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich at web.de>

The discussion about the WARN/SKIP. I don't insist on one or the other, but my feeling tells
me also that this is more like a skip here. For the basic functionality of the extension
it is the standard mode of operation that you are NOT logged into the console where
you would have access to the master node. So, there is nothing to warn about that.
Ok, it's bad that the master node is returned instead of the one used
which would have actually worked. But that is a spec/design problem that should not be
'warned' about in a any piglit test IMO.

plenty thanks and best


>  		}
>  #define EGL_DRM_MASTER_FD_EXT                   0x333C

More information about the Piglit mailing list