From: Helen Koike <helen.koike@collabora.com>
To: Rob Clark <robdclark@gmail.com>, igt-dev@lists.freedesktop.org
Cc: Rob Clark <robdclark@chromium.org>, Emma Anholt <emma@anholt.net>
Subject: Re: [igt-dev] [PATCH v3 3/3] core_getversion: Test for desired device
Date: Wed, 27 Sep 2023 19:24:35 -0300 [thread overview]
Message-ID: <b4fcc0fd-9129-c13b-3801-253ecb3677b4@collabora.com> (raw)
In-Reply-To: <20230926184748.199187-3-robdclark@gmail.com>
On 26/09/2023 15:47, Rob Clark wrote:
> 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_REQUIRED_DRIVER environment variable.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> Acked-by: Helen Koike <helen.koike@collabora.com>
> ---
> tests/core_getversion.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/tests/core_getversion.c b/tests/core_getversion.c
> index 32cb976e4923..b298a6890ef9 100644
> --- a/tests/core_getversion.c
> +++ b/tests/core_getversion.c
> @@ -48,14 +48,25 @@ igt_simple_main
> {
> int fd;
> drmVersionPtr v;
> + const char *name = getenv("IGT_REQUIRED_DRIVER");
Btw, In drm/ci we are using IGT_FORCE_DRIVER
https://cgit.freedesktop.org/drm/drm/tree/drivers/gpu/drm/ci/igt_runner.sh#n6
You could use the same name here so we don't need to patch drm/ci (but
patching there is not a issue as well, so feel free to ignore this
comment and just chose the best name).
Regards,
Helen
> + int chipset = DRIVER_ANY;
>
> - fd = drm_open_driver(DRIVER_ANY);
> + if (name)
> + chipset = drm_find_chipset(name);
> +
> + fd = __drm_open_driver(chipset);
> + 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);
next prev parent reply other threads:[~2023-09-27 22:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 18:47 [igt-dev] [PATCH 1/3] lib/drmtest: Use module table for chipset_to_str() Rob Clark
2023-09-26 18:47 ` [igt-dev] [PATCH 2/3] lib/drmtest: Add drm_find_chipset() Rob Clark
2023-09-27 14:20 ` Zbigniew Kempczyński
2023-09-27 17:41 ` Rob Clark
2023-09-27 16:21 ` Kamil Konieczny
2023-09-26 18:47 ` [igt-dev] [PATCH v3 3/3] core_getversion: Test for desired device Rob Clark
2023-09-27 14:26 ` Zbigniew Kempczyński
2023-09-27 17:42 ` Rob Clark
2023-09-27 16:42 ` Kamil Konieczny
2023-09-27 17:46 ` Rob Clark
2023-09-27 22:24 ` Helen Koike [this message]
2023-09-27 22:30 ` Rob Clark
2023-09-28 7:41 ` Kamil Konieczny
2023-09-26 19:39 ` [igt-dev] ✗ CI.xeBAT: failure for series starting with [1/3] lib/drmtest: Use module table for chipset_to_str() Patchwork
2023-09-26 19:46 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-09-27 7:43 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-09-27 14:01 ` [igt-dev] [PATCH 1/3] " Zbigniew Kempczyński
2023-09-27 16:09 ` Kamil Konieczny
2023-09-27 17:32 ` Rob Clark
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=b4fcc0fd-9129-c13b-3801-253ecb3677b4@collabora.com \
--to=helen.koike@collabora.com \
--cc=emma@anholt.net \
--cc=igt-dev@lists.freedesktop.org \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
/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