[PATCH v5,resend i-g-t 4/6] tests: Add core_sysfs

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Jul 8 16:57:34 UTC 2025


Hi Peter,
On 2025-07-08 at 16:40:36 +0200, Peter Senna Tschudin wrote:
> core_sysfs is GPU-agnostic test designed to work with any GPU, not
> limited to i915 and Xe. The test scans the sysfs directory associated
> with the GPU, reads all files, and discards the content.
> 
> Cc: lucas.demarchi at intel.com
> Cc: rodrigo.vivi at intel.com
> Cc: kamil.konieczny at linux.intel.com
> Cc: katarzyna.piecielska at intel.com
> Cc: zbigniew.kempczynski at intel.com
> Cc: michal.wajdeczko at intel.com
> Cc: karthik.b.s at intel.com
> Signed-off-by: Peter Senna Tschudin <peter.senna at linux.intel.com>
> ---
> v5:
>  - use igt_dir_process_files_simple()
> v4:
>  - unchanged from v3
> v3:
>  - removed "sysfs" from the name of subtest (Thanks Michal Wajdeczko)
> v2:
>  - changed style of comparison to NULL
> 
>  tests/core_sysfs.c                       | 49 ++++++++++++++++++++++++
>  tests/intel-ci/fast-feedback.testlist    |  1 +
>  tests/intel-ci/xe-fast-feedback.testlist |  1 +
>  tests/meson.build                        |  1 +
>  4 files changed, 52 insertions(+)
>  create mode 100644 tests/core_sysfs.c
> 
> diff --git a/tests/core_sysfs.c b/tests/core_sysfs.c
> new file mode 100644
> index 000000000..5ac3ed901
> --- /dev/null
> +++ b/tests/core_sysfs.c
> @@ -0,0 +1,49 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2025 Intel Corporation
> + */
> +
> +#include "igt.h"
> +#include "igt_dir.h"
> +#include "igt_sysfs.h"
> +
> +/**
> + * TEST: sysfs test
> + * Description: Read entries from sysfs path.
> + * Category: Core
> + * Mega feature: General Core features
> + * Sub-category: uapi
> + * Functionality: sysfs
> + * Feature: core
> + * Test category: uapi
> + *
> + * SUBTEST: read-all-entries
> + * Description: Read all entries from sysfs path
> + *
> + */
> +
> +IGT_TEST_DESCRIPTION("Read entries from sysfs paths.");
> +
> +igt_main
> +{
> +	int fd = -1;
> +	int sysfs = -1;
> +
> +	igt_fixture {
> +		fd = drm_open_driver_master(DRIVER_ANY);

Why not just drm_open_driver()?

> +		sysfs = igt_sysfs_open(fd);
> +		igt_require(sysfs >= 0);
> +
> +		kmstest_set_vt_graphics_mode();

Why KMS-related stuff here?

Same questions for core_debugfs where there are also
those calls in fixture.

Regards,
Kamil

> +	}
> +
> +	igt_describe("Read all entries from sysfs path.");
> +	igt_subtest("read-all-entries") {
> +		igt_dir_process_files_simple(sysfs);
> +	}
> +
> +	igt_fixture {
> +		close(sysfs);
> +		drm_close_driver(fd);
> +	}
> +}
> diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
> index 3ec1b95cf..5d4d101ef 100644
> --- a/tests/intel-ci/fast-feedback.testlist
> +++ b/tests/intel-ci/fast-feedback.testlist
> @@ -4,6 +4,7 @@ igt at i915_module_load@load
>  # Keep alphabetically sorted by default
>  igt at core_auth@basic-auth
>  igt at core_debugfs@read-all-entries
> +igt at core_sysfs@read-all-entries
>  igt at fbdev@eof
>  igt at fbdev@info
>  igt at fbdev@nullptr
> diff --git a/tests/intel-ci/xe-fast-feedback.testlist b/tests/intel-ci/xe-fast-feedback.testlist
> index ac3177ae9..a5f799f6b 100644
> --- a/tests/intel-ci/xe-fast-feedback.testlist
> +++ b/tests/intel-ci/xe-fast-feedback.testlist
> @@ -8,6 +8,7 @@ igt at fbdev@read
>  igt at fbdev@write
>  
>  igt at core_debugfs@read-all-entries
> +igt at core_sysfs@read-all-entries
>  igt at intel_sysfs_debugfs@xe-base
>  igt at intel_sysfs_debugfs@xe-debugfs-read-all-entries
>  igt at intel_sysfs_debugfs@xe-forcewake
> diff --git a/tests/meson.build b/tests/meson.build
> index 1009bef2e..4976f2d91 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -7,6 +7,7 @@ test_progs = [
>  	'core_hotunplug',
>  	'core_setmaster',
>  	'core_setmaster_vs_auth',
> +	'core_sysfs',
>  	'dmabuf',
>  	'dmabuf_sync_file',
>  	'device_reset',
> -- 
> 2.43.0
> 


More information about the igt-dev mailing list