Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Riana Tauro <riana.tauro@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	<igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t v2 2/2] tests/intel/xe_configfs: Test engines_allowed
Date: Fri, 6 Jun 2025 16:46:46 +0530	[thread overview]
Message-ID: <cc9db6af-4bca-40a8-b19f-3e972acf5f6a@intel.com> (raw)
In-Reply-To: <20250602-engines-allowed-v2-2-52bffe717766@intel.com>

Hi Lucas

On 6/2/2025 9:54 PM, Lucas De Marchi wrote:
> Add tests for the parsing of engines_allowed configfs. This doesn't try
> to bind the driver and ensure only those engines are available. That's
> because the engine uapi instance doesn't necessarily match what is used
> for configfs configuration. Maybe we will need an engine map in debugfs
> for covering that.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>   tests/intel/xe_configfs.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 56 insertions(+)
> 
> diff --git a/tests/intel/xe_configfs.c b/tests/intel/xe_configfs.c
> index 074cd04d9..e4fffd0b9 100644
> --- a/tests/intel/xe_configfs.c
> +++ b/tests/intel/xe_configfs.c
> @@ -10,6 +10,7 @@
>   #include "igt_fs.h"
>   #include "igt_kmod.h"
>   #include "igt_sysfs.h"
> +#include "xe/xe_query.h"
>   
>   /**
>    * TEST: Check configfs userspace API
> @@ -54,6 +55,49 @@ static void test_survivability_mode(int configfs_device_fd)
>   	close(fd);
>   }
>   
> +/**
> + * SUBTEST: engines-allowed-invalid
> + * Description: Validate engines_allowed attribute for invalid values
> + */
> +static void test_engines_allowed_invalid(int configfs_device_fd)
> +{
> +	static const char *values[] = {
> +		"xcs0",
> +		"abcsdcs0",
> +		"rcs0,abcsdcs0",
> +		"rcs9",
> +		"rcs10",
> +		"rcs0asdf",
> +	};
> +
> +	for (size_t i = 0; i < ARRAY_SIZE(values); i++) {
> +		const char *v = values[i];
> +
> +		igt_debug("Writing '%s' to engines_allowed\n", v);
> +		igt_assert(!igt_sysfs_set(configfs_device_fd, "engines_allowed", v));
> +	}
> +}
> +
> +/**
> + * SUBTEST: engines-allowed
> + * Description: Validate engines_allowed attribute
> + */
> +static void test_engines_allowed(int configfs_device_fd)
> +{
> +	static const char *values[] = {
> +		"rcs0", "rcs*", "rcs0,bcs0", "bcs0,rcs0",
> +		"bcs0\nrcs0", "bcs0\nrcs0\n",
> +		"rcs000",
> +	};
> +
> +	for (size_t i = 0; i < ARRAY_SIZE(values); i++) {
> +		const char *v = values[i];
> +
> +		igt_debug("Writing '%s' to engines_allowed\n", v);
> +		igt_assert(igt_sysfs_set(configfs_device_fd, "engines_allowed", v));
> +	}
> +}
> +
>   static int create_device_configfs_group(int configfs_fd, int fd)
>   {
>   	int configfs_device_fd;
> @@ -88,6 +132,18 @@ igt_main
>   		test_survivability_mode(configfs_device_fd);
>   	}
>   
> +	igt_describe("Validate engines_allowed with invalid options");
> +	igt_subtest("engines-allowed-invalid") {
> +		igt_install_exit_handler(restore);

Exit handler can be common in the fixture if it's needed by all tests

Otherwise, Looks good to me
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
> +		test_engines_allowed_invalid(configfs_device_fd);
> +	}
> +
> +	igt_describe("Validate engines_allowed");
> +	igt_subtest("engines-allowed") {
> +		igt_install_exit_handler(restore);
> +		test_engines_allowed(configfs_device_fd);
> +	}
> +
>   	igt_fixture {
>   		igt_fs_remove_dir(configfs_fd, bus_addr);
>   		close(configfs_device_fd);
> 


  reply	other threads:[~2025-06-06 11:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-02 16:24 [PATCH i-g-t v2 0/2] xe: Add test for engines_allowed in configfs Lucas De Marchi
2025-06-02 16:24 ` [PATCH i-g-t v2 1/2] tests/intel/xe_configfs: Use openat to simplify check Lucas De Marchi
2025-06-03  6:15   ` Riana Tauro
2025-06-03  6:37     ` Lucas De Marchi
2025-06-02 16:24 ` [PATCH i-g-t v2 2/2] tests/intel/xe_configfs: Test engines_allowed Lucas De Marchi
2025-06-06 11:16   ` Riana Tauro [this message]
2025-06-09 22:42   ` Umesh Nerlige Ramappa
2025-06-12 21:27     ` Lucas De Marchi
2025-06-02 21:19 ` ✓ i915.CI.BAT: success for xe: Add test for engines_allowed in configfs Patchwork
2025-06-02 21:21 ` ✓ Xe.CI.BAT: " Patchwork
2025-06-03  1:01 ` ✓ i915.CI.Full: " Patchwork
2025-06-03 20:17 ` ✗ Xe.CI.Full: failure " Patchwork

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=cc9db6af-4bca-40a8-b19f-3e972acf5f6a@intel.com \
    --to=riana.tauro@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.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