Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Senna Tschudin <peter.senna@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Peter Senna Tschudin <peter.senna@linux.intel.com>,
	michal.wajdeczko@intel.com, marcin.bernatowicz@intel.com,
	kamil.konieczny@linux.intel.com, katarzyna.piecielska@intel.com,
	zbigniew.kempczynski@intel.com, ewelina.musial@intel.com
Subject: [PATCH v3 resend i-g-t 4/6] tests: Add core_sysfs
Date: Mon, 16 Jun 2025 09:42:36 +0200	[thread overview]
Message-ID: <20250616074240.45818-5-peter.senna@linux.intel.com> (raw)
In-Reply-To: <20250616074240.45818-1-peter.senna@linux.intel.com>

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: michal.wajdeczko@intel.com
Cc: marcin.bernatowicz@intel.com
Cc: kamil.konieczny@linux.intel.com
Cc: katarzyna.piecielska@intel.com
Cc: zbigniew.kempczynski@intel.com
Cc: ewelina.musial@intel.com
Signed-off-by: Peter Senna Tschudin <peter.senna@linux.intel.com>
---
v3:
 - removed "sysfs" from the name of subtest (Thanks Michal Wajdeczko)
v2:
 - changed style of comparison to NULL

 tests/core_sysfs.c                       | 58 ++++++++++++++++++++++++
 tests/intel-ci/fast-feedback.testlist    |  1 +
 tests/intel-ci/xe-fast-feedback.testlist |  1 +
 tests/meson.build                        |  1 +
 4 files changed, 61 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..db70e940b
--- /dev/null
+++ b/tests/core_sysfs.c
@@ -0,0 +1,58 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2025 Intel Corporation
+ */
+
+#include "igt.h"
+#include "igt_dir.h"
+#include "igt_sysfs.h"
+
+struct {
+	bool warn_on_not_hit;
+} opt = { 0 };
+
+/**
+ * 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_dir_t *igt_dir = NULL;
+
+	igt_fixture {
+		fd = drm_open_driver_master(DRIVER_ANY);
+		sysfs = igt_sysfs_open(fd);
+		igt_require(sysfs >= 0);
+
+		igt_dir = igt_dir_create(sysfs);
+		igt_require(igt_dir);
+
+		kmstest_set_vt_graphics_mode();
+	}
+
+	igt_describe("Read all entries from sysfs path.");
+	igt_subtest("read-all-entries") {
+		igt_dir_scan_dirfd(igt_dir, -1);
+		igt_dir_process_files(igt_dir, NULL, NULL);
+	}
+
+	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@i915_module_load@load
 # Keep alphabetically sorted by default
 igt@core_auth@basic-auth
 igt@core_debugfs@read-all-entries
+igt@core_sysfs@read-all-entries
 igt@fbdev@eof
 igt@fbdev@info
 igt@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@fbdev@read
 igt@fbdev@write
 
 igt@core_debugfs@read-all-entries
+igt@core_sysfs@read-all-entries
 igt@intel_sysfs_debugfs@xe-base
 igt@intel_sysfs_debugfs@xe-debugfs-read-all-entries
 igt@intel_sysfs_debugfs@xe-forcewake
diff --git a/tests/meson.build b/tests/meson.build
index 99dbd4feb..a06172d2e 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -8,6 +8,7 @@ test_progs = [
 	'core_hotunplug',
 	'core_setmaster',
 	'core_setmaster_vs_auth',
+	'core_sysfs',
 	'dmabuf',
 	'dmabuf_sync_file',
 	'device_reset',
-- 
2.43.0


  parent reply	other threads:[~2025-06-16  7:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16  7:42 [PATCH v3 resend i-g-t 0/6] Replace intel_sysfs_debugfs Peter Senna Tschudin
2025-06-16  7:42 ` [PATCH v3 resend i-g-t 1/6] lib/igt_dir: Directory processing and flexible file handling Peter Senna Tschudin
2025-06-24 13:24   ` Sokolowski, Jan
2025-06-16  7:42 ` [PATCH v3 resend i-g-t 2/6] tests: Add core_debugfs Peter Senna Tschudin
2025-06-16  7:42 ` [PATCH v3 resend i-g-t 3/6] tests: Add core_debugfs_heads_power Peter Senna Tschudin
2025-07-03 20:39   ` Rodrigo Vivi
2025-07-04  8:06     ` Peter Senna Tschudin
2025-07-04 10:01       ` Karthik B S
2025-07-04 11:36         ` Kamil Konieczny
2025-07-04 10:02   ` Karthik B S
2025-06-16  7:42 ` Peter Senna Tschudin [this message]
2025-06-16  7:42 ` [PATCH v3 resend i-g-t 5/6] tests: Add xe_debugfs Peter Senna Tschudin
2025-07-03 20:36   ` Rodrigo Vivi
2025-07-04  8:57     ` Peter Senna Tschudin
2025-07-04  9:06     ` Peter Senna Tschudin
2025-07-07 14:43       ` Rodrigo Vivi
2025-06-16  7:42 ` [PATCH v3 resend i-g-t 6/6] tests/intel: Remove intel_sysfs_debugfs Peter Senna Tschudin
2025-07-03 20:39   ` Rodrigo Vivi
2025-06-16 19:50 ` ✓ Xe.CI.BAT: success for Replace intel_sysfs_debugfs Patchwork
2025-06-17  2:49 ` ✗ Xe.CI.Full: failure " Patchwork
2025-06-17 13:01 ` ✗ i915.CI.BAT: " Patchwork
2025-07-03 21:44 ` ✓ Xe.CI.BAT: success for Replace intel_sysfs_debugfs (rev2) Patchwork
2025-07-03 21:45 ` ✓ i915.CI.BAT: " Patchwork
2025-07-04  4:29 ` ✗ i915.CI.Full: failure " Patchwork
2025-07-05 14:40 ` ✓ Xe.CI.Full: success " Patchwork
2025-07-07 21:03 ` [PATCH v4 i-g-t 0/6] Replace intel_sysfs_debugfs Peter Senna Tschudin
2025-07-07 21:03   ` [PATCH v4 i-g-t 1/6] lib/igt_dir: Directory processing and flexible file handling Peter Senna Tschudin
2025-07-07 21:03   ` [PATCH v4 i-g-t 2/6] tests: Add core_debugfs Peter Senna Tschudin
2025-07-07 21:03   ` [PATCH v4 i-g-t 3/6] tests: Add kms_debugfs Peter Senna Tschudin
2025-07-07 21:03   ` [PATCH v4 i-g-t 4/6] tests: Add core_sysfs Peter Senna Tschudin
2025-07-07 21:03   ` [PATCH v4 i-g-t 5/6] tests: Add xe_debugfs Peter Senna Tschudin
2025-07-07 21:03   ` [PATCH v4 i-g-t 6/6] tests/intel: Remove intel_sysfs_debugfs Peter Senna Tschudin

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=20250616074240.45818-5-peter.senna@linux.intel.com \
    --to=peter.senna@linux.intel.com \
    --cc=ewelina.musial@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=katarzyna.piecielska@intel.com \
    --cc=marcin.bernatowicz@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=zbigniew.kempczynski@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