All of lore.kernel.org
 help / color / mirror / Atom feed
From: Riana Tauro <riana.tauro@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: badal.nilawar@intel.com, petri.latvala@intel.com
Subject: [igt-dev] [PATCH i-g-t v2 1/2] tests/debugfs_test: Add basic-hwmon test
Date: Wed,  2 Nov 2022 10:08:13 +0530	[thread overview]
Message-ID: <20221102043814.3821683-2-riana.tauro@intel.com> (raw)
In-Reply-To: <20221102043814.3821683-1-riana.tauro@intel.com>

Add a testcase that verifies hwmon directory in dgfx and prints all
the entries

v2 : Addressed cosmetic review comments (Ashutosh)

Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 tests/debugfs_test.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c
index 0b4b6e23..8c775158 100644
--- a/tests/debugfs_test.c
+++ b/tests/debugfs_test.c
@@ -24,12 +24,13 @@
 
 #include "i915/gem.h"
 #include "igt.h"
+#include "igt_hwmon.h"
 #include "igt_sysfs.h"
 #include <fcntl.h>
 #include <sys/types.h>
 #include <dirent.h>
 
-IGT_TEST_DESCRIPTION("Read entries from debugfs and sysfs paths.");
+IGT_TEST_DESCRIPTION("Read entries from debugfs, hwmon and sysfs paths.");
 
 static void read_and_discard_sysfs_entries(int path_fd, int indent)
 {
@@ -178,7 +179,7 @@ retry:
 
 igt_main
 {
-	int fd = -1, debugfs, sysfs;
+	int fd = -1, debugfs, sysfs, hwmon_fd;
 
 	igt_fixture {
 		fd = drm_open_driver_master(DRIVER_INTEL);
@@ -196,6 +197,15 @@ igt_main
 	igt_subtest("read_all_entries")
 		read_and_discard_sysfs_entries(debugfs, 0);
 
+	igt_describe("Read all entries from hwmon path");
+	igt_subtest("basic-hwmon") {
+		igt_require_f(gem_has_lmem(fd), "Test applicable only for dgfx\n");
+		hwmon_fd = igt_hwmon_open(fd);
+		igt_assert(hwmon_fd >= 0);
+		read_and_discard_sysfs_entries(hwmon_fd, 0);
+		close(hwmon_fd);
+	}
+
 	igt_describe("Read all debugfs entries with display on/off.");
 	igt_subtest_group
 		kms_tests(fd, debugfs);
-- 
2.25.1

  reply	other threads:[~2022-11-02  4:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02  4:38 [igt-dev] [PATCH i-g-t v2 0/2] Add a basic hwmon testcase Riana Tauro
2022-11-02  4:38 ` Riana Tauro [this message]
2022-11-02  4:38 ` [igt-dev] [PATCH i-g-t v2 2/2] tests/intel-ci/fast-feedback: Add basic-hwmon test to BAT Riana Tauro
2022-11-02  8:49   ` Petri Latvala
2022-11-02  5:43 ` [igt-dev] ✓ Fi.CI.BAT: success for Add a basic hwmon testcase (rev2) Patchwork
2022-11-02  8:49   ` Petri Latvala
2022-11-02 16:47     ` Vudum, Lakshminarayana
2022-11-02 11:06 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-11-02 16:24   ` Tauro, Riana
2022-11-02 18:22     ` Vudum, Lakshminarayana
2022-11-02 17:47 ` [igt-dev] ✓ Fi.CI.IGT: success " 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=20221102043814.3821683-2-riana.tauro@intel.com \
    --to=riana.tauro@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.