summaryrefslogtreecommitdiff
path: root/tests/debugfs_test.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-10-11 13:36:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-10-11 21:13:12 +0100
commit8b026b098fb3631f2c4026266716a98a592ffadd (patch)
tree35d265c4729c788affcd62b5f4b98039ca0b59ad /tests/debugfs_test.c
parentd7bf9a67be6b2c5189a9c85f45eab196238a3998 (diff)
Check all sysfs entries are readable without dmesg spam
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> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests/debugfs_test.c')
-rw-r--r--tests/debugfs_test.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c
index f8dd851c..2d4753df 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);
}