Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org, Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t] Check all sysfs entries are readable without dmesg spam
Date: Fri, 11 Oct 2019 13:43:28 +0100	[thread overview]
Message-ID: <20191011124328.3400-1-chris@chris-wilson.co.uk> (raw)

We already check that debugfs do not cause spam (and they tend to be
more heavyhanded and so more likely to break), but that does not excuse
not checking our sysfs directory!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/debugfs_test.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c
index f8dd851c9..2d4753df5 100644
--- a/tests/debugfs_test.c
+++ b/tests/debugfs_test.c
@@ -56,7 +56,7 @@ static void read_and_discard_sysfs_entries(int path_fd, int indent)
 			igt_debug("%sEntering subdir %s\n", tabs, dirent->d_name);
 			read_and_discard_sysfs_entries(sub_fd, indent + 1);
 			close(sub_fd);
-		} else {
+		} else if (dirent->d_type == DT_REG) {
 			char buf[512];
 			int sub_fd;
 			ssize_t ret;
@@ -149,7 +149,7 @@ static void kms_tests(int fd, int debugfs)
 
 igt_main
 {
-	int fd = -1, debugfs;
+	int fd = -1, debugfs, sysfs;
 
 	igt_skip_on_simulation();
 
@@ -157,10 +157,13 @@ igt_main
 		fd = drm_open_driver_master(DRIVER_INTEL);
 		igt_require_gem(fd);
 		debugfs = igt_debugfs_dir(fd);
+		sysfs = igt_sysfs_open(fd);
 
 		kmstest_set_vt_graphics_mode();
 	}
 
+	igt_subtest("sysfs")
+		read_and_discard_sysfs_entries(sysfs, 0);
 	igt_subtest("read_all_entries")
 		read_and_discard_sysfs_entries(debugfs, 0);
 
@@ -168,6 +171,7 @@ igt_main
 		kms_tests(fd, debugfs);
 
 	igt_fixture {
+		close(sysfs);
 		close(debugfs);
 		close(fd);
 	}
-- 
2.23.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-10-11 12:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 12:43 Chris Wilson [this message]
2019-10-11 12:57 ` [igt-dev] ✗ GitLab.Pipeline: warning for Check all sysfs entries are readable without dmesg spam Patchwork
2019-10-11 13:12 ` [igt-dev] [Intel-gfx] [PATCH i-g-t] " Tvrtko Ursulin
2019-10-11 13:31 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-10-11 20:11 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20191011124328.3400-1-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@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