File: core_sysfs.c

package info (click to toggle)
intel-gpu-tools 2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 63,368 kB
  • sloc: xml: 781,458; ansic: 360,567; python: 8,336; yacc: 2,781; perl: 1,196; sh: 1,177; lex: 487; asm: 227; lisp: 35; makefile: 30
file content (48 lines) | stat: -rw-r--r-- 882 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// 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);
		sysfs = igt_sysfs_open(fd);
		igt_require(sysfs >= 0);

		kmstest_set_vt_graphics_mode();
	}

	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);
	}
}