From: Rob Clark <robdclark@gmail.com>
To: igt-dev@lists.freedesktop.org
Cc: Rob Clark <robdclark@chromium.org>, Emma Anholt <emma@anholt.net>,
Helen Koike <helen.koike@collabora.com>
Subject: [igt-dev] [PATCH v5] core_getversion: Test for desired device
Date: Wed, 4 Oct 2023 10:21:19 -0700 [thread overview]
Message-ID: <20231004172119.289318-1-robdclark@gmail.com> (raw)
From: Rob Clark <robdclark@chromium.org>
We discovered in drm/ci that if the drm device fails to probe, all the
tests come back as "Skip" and the job is considered successful. Fix
the getversion test to fail if there is no drm device or if the drm
device does not match the expected device as specified by the optional
IGT_FORCE_DRIVER environment variable.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Tested-by: Helen Koike <helen.koike@collabora.com>
---
tests/core_getversion.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tests/core_getversion.c b/tests/core_getversion.c
index 32cb976e4923..8c8e0c9a3e5e 100644
--- a/tests/core_getversion.c
+++ b/tests/core_getversion.c
@@ -48,14 +48,21 @@ igt_simple_main
{
int fd;
drmVersionPtr v;
+ const char *name = getenv("IGT_FORCE_DRIVER");
- fd = drm_open_driver(DRIVER_ANY);
+ fd = __drm_open_driver(DRIVER_ANY);
+ igt_assert_fd(fd);
v = drmGetVersion(fd);
igt_assert_neq(strlen(v->name), 0);
igt_assert_neq(strlen(v->date), 0);
igt_assert_neq(strlen(v->desc), 0);
if (is_i915_device(fd))
igt_assert_lte(1, v->version_major);
+ if (name) {
+ igt_assert_f(!strcmp(name, v->name),
+ "Expected driver \"%s\" but got \"%s\"\n",
+ name, v->name);
+ }
drmFree(v);
drm_close_driver(fd);
--
2.41.0
next reply other threads:[~2023-10-04 17:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-04 17:21 Rob Clark [this message]
2023-10-04 20:36 ` [igt-dev] ✓ Fi.CI.BAT: success for core_getversion: Test for desired device (rev4) Patchwork
2023-10-04 22:23 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-10-05 6:18 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-10-05 8:09 ` [igt-dev] [PATCH v5] core_getversion: Test for desired device Kamil Konieczny
2023-10-08 22:21 ` Helen Koike
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231004172119.289318-1-robdclark@gmail.com \
--to=robdclark@gmail.com \
--cc=emma@anholt.net \
--cc=helen.koike@collabora.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=robdclark@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox