[Intel-gfx] [PATCH igt] igt/kms_hdmi_inject: Require /proc/asound before asserting
Chris Wilson
chris at chris-wilson.co.uk
Wed Aug 23 14:44:35 UTC 2017
The subtest "inject-audio" tries to load an EDID and confirm that it is
being passed through to the audio driver (as an ELD). This cannot work
if the audio driver is not present, so skip instead.
References: https://bugs.freedesktop.org/show_bug.cgi?id=102370
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
tests/kms_hdmi_inject.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tests/kms_hdmi_inject.c b/tests/kms_hdmi_inject.c
index cb916ace..31d7d69f 100644
--- a/tests/kms_hdmi_inject.c
+++ b/tests/kms_hdmi_inject.c
@@ -23,6 +23,7 @@
*/
#include <dirent.h>
+#include <sys/stat.h>
#include "igt.h"
#define HDISPLAY_4K 3840
@@ -246,6 +247,12 @@ hdmi_inject_audio(int drm_fd, drmModeConnector *connector)
free(edid);
}
+static bool has_proc_asound(void)
+{
+ struct stat st;
+ return stat("/proc/asound", &st) == 0;
+}
+
igt_main
{
int drm_fd;
@@ -263,8 +270,10 @@ igt_main
igt_subtest("inject-4k")
hdmi_inject_4k(drm_fd, connector);
- igt_subtest("inject-audio")
+ igt_subtest("inject-audio") {
+ igt_require(has_proc_asound());
hdmi_inject_audio(drm_fd, connector);
+ }
igt_fixture {
drmModeFreeConnector(connector);
--
2.14.1
More information about the Intel-gfx
mailing list