← Documents Documentation/dev-tools/testing-devices.rst GitHub 원문 ↗

Linux 6.18.37 · Dev Tools

Device testing with kselftest

Devicetree, error log, discoverable bus와 device existence kselftest의 coverage와 요구 사항을 비교합니다.

Source pathDocumentation/dev-tools/testing-devices.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

testing-devices.rst:1-47

DT-based platform에는 준비가 필요 없는 dt와 error_logs test를 기본 적용하고 known-good reference를 생성해 devices/exist coverage를 추가하는 구성이 권장됩니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2 .. Copyright (c) 2024 Collabora Ltd
3
4 =============================
5 Device testing with kselftest
6 =============================
7
8
9 There are a few different kselftests available for testing devices generically,
10 with some overlap in coverage and different requirements. This document aims to
11 give an overview of each one.
12
13 Note: Paths in this document are relative to the kselftest folder
14 (``tools/testing/selftests``).
15
16 Device oriented kselftests:
17
18 * Devicetree (``dt``)
19
20 * **Coverage**: Probe status for devices described in Devicetree
21 * **Requirements**: None
22
23 * Error logs (``devices/error_logs``)
24
25 * **Coverage**: Error (or more critical) log messages presence coming from any
26 device
27 * **Requirements**: None
28
29 * Discoverable bus (``devices/probe``)
30
31 * **Coverage**: Presence and probe status of USB or PCI devices that have been
32 described in the reference file
33 * **Requirements**: Manually describe the devices that should be tested in a
34 YAML reference file (see ``devices/probe/boards/google,spherion.yaml`` for
35 an example)
36
37 * Exist (``devices/exist``)
38
39 * **Coverage**: Presence of all devices
40 * **Requirements**: Generate the reference (see ``devices/exist/README.rst``
41 for details) on a known-good kernel
42
43 Therefore, the suggestion is to enable the error log and devicetree tests on all
44 (DT-based) platforms, since they don't have any requirements. Then to greatly
45 improve coverage, generate the reference for each platform and enable the exist
46 test. The discoverable bus test can be used to verify the probe status of
47 specific USB or PCI devices, but is probably not worth it for most cases.
48

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

kselftest를 이용한 device testing

1-47

SPDX 라이선스 식별자: GPL-2.0

Copyright (c) 2024 Collabora Ltd

kselftest를 이용한 device testing

Device를 generic하게 검사하는 kselftest가 여러 개 있으며 coverage가 일부 겹치고 요구 사항은 서로 다릅니다. 이 문서는 각 test의 개요를 제공합니다.

참고: 이 문서의 path는 kselftest folder `tools/testing/selftests`를 기준으로 한 상대 path입니다.

Device-oriented kselftest는 다음과 같습니다.

Devicetree (`dt`): Devicetree에 기술된 device의 probe status를 검사하며 별도 요구 사항이 없습니다.

Error logs (`devices/error_logs`): 임의의 device에서 발생한 error level 또는 그보다 심각한 log message가 존재하는지 검사하며 별도 요구 사항이 없습니다.

Discoverable bus (`devices/probe`): Reference file에 기술된 USB 또는 PCI device의 존재와 probe status를 검사합니다. 검사할 device를 YAML reference file에 수동으로 기술해야 하며 예는 `devices/probe/boards/google,spherion.yaml`입니다.

Exist (`devices/exist`): 모든 device의 존재를 검사합니다. Known-good kernel에서 reference를 생성해야 하며 자세한 방법은 `devices/exist/README.rst`를 참조하십시오.

따라서 별도 요구 사항이 없는 error log test와 Devicetree test는 모든 DT-based platform에서 활성화하는 것이 좋습니다. Coverage를 크게 높이려면 platform마다 reference를 생성해 exist test도 활성화합니다.

Discoverable bus test는 특정 USB 또는 PCI device의 probe status 확인에 사용할 수 있지만 대부분의 경우 투입 비용만큼 유용하지 않을 수 있습니다.

Device-oriented kselftest 비교
TestCoverageRequirement
dtDevicetree device probe status없음
devices/error_logsDevice error 이상 log 존재없음
devices/probe지정 USB/PCI 존재와 probe수동 YAML reference
devices/exist모든 device 존재Known-good kernel reference 생성

각 test의 coverage와 사전 준비를 한눈에 비교합니다.