← Documents Documentation/gpu/automated_testing.rst GitHub 원문 ↗

Linux 6.18.37 · GPU

Automated testing of the DRM subsystem

DRM GitLab CI 설정, expectation 파일, 자동 시험 활성화, coverage, external fix, lab status를 전문 번역합니다.

Source pathDocumentation/gpu/automated_testing.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

automated_testing.rst:1-171

DRM 자동화 시험은 GitLab CI와 공유 hardware farm으로 여러 driver·hardware 조합의 regression을 검사합니다. Root 설정 변수와 공통 testlist를 기반으로 fails·flakes·skips expectation을 적용하며, 개발자는 자신의 tree, drm-ci fork, external-fixes branch, lab-status를 통해 실행 환경을 관리합니다.

DRM CI 운영 지도
영역핵심 파일 또는 값
Root 설정drivers/gpu/drm/ci/gitlab-ci.yml
공통 testsdrivers/gpu/drm/ci/testlist.txt
Expectationsfails.txt, flakes.txt, skips.txt
권한drm/ci-ok
External fixes${TARGET_BRANCH}-external-fixes
Lab 상태gfx-ci/lab-status/main/lab-status.yml

설정, 기대값, 실행, 유지보수 파일을 구분합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0+
2
3 =========================================
4 Automated testing of the DRM subsystem
5 =========================================
6
7 Introduction
8 ============
9
10 Making sure that changes to the core or drivers don't introduce regressions can
11 be very time-consuming when lots of different hardware configurations need to
12 be tested. Moreover, it isn't practical for each person interested in this
13 testing to have to acquire and maintain what can be a considerable amount of
14 hardware.
15
16 Also, it is desirable for developers to check for regressions in their code by
17 themselves, instead of relying on the maintainers to find them and then
18 reporting back.
19
20 There are facilities in gitlab.freedesktop.org to automatically test Mesa that
21 can be used as well for testing the DRM subsystem. This document explains how
22 people interested in testing it can use this shared infrastructure to save
23 quite some time and effort.
24
25
26 Relevant files
27 ==============
28
29 drivers/gpu/drm/ci/gitlab-ci.yml
30 --------------------------------
31
32 This is the root configuration file for GitLab CI. Among other less interesting
33 bits, it specifies the specific version of the scripts to be used. There are
34 some variables that can be modified to change the behavior of the pipeline:
35
36 DRM_CI_PROJECT_PATH
37 Repository that contains the Mesa software infrastructure for CI
38
39 DRM_CI_COMMIT_SHA
40 A particular revision to use from that repository
41
42 UPSTREAM_REPO
43 URL to git repository containing the target branch
44
45 TARGET_BRANCH
46 Branch to which this branch is to be merged into
47
48 IGT_VERSION
49 Revision of igt-gpu-tools being used, from
50 https://gitlab.freedesktop.org/drm/igt-gpu-tools
51
52 drivers/gpu/drm/ci/testlist.txt
53 -------------------------------
54
55 IGT tests to be run on all drivers (unless mentioned in a driver's \*-skips.txt
56 file, see below).
57
58 drivers/gpu/drm/ci/${DRIVER_NAME}-${HW_REVISION}-fails.txt
59 ----------------------------------------------------------
60
61 Lists the known failures for a given driver on a specific hardware revision.
62
63 drivers/gpu/drm/ci/${DRIVER_NAME}-${HW_REVISION}-flakes.txt
64 -----------------------------------------------------------
65
66 Lists the tests that for a given driver on a specific hardware revision are
67 known to behave unreliably. These tests won't cause a job to fail regardless of
68 the result. They will still be run.
69
70 Each new flake entry must be associated with a link to the email reporting the
71 bug to the author of the affected driver or the relevant GitLab issue. The entry
72 must also include the board name or Device Tree name, the first kernel version
73 affected, the IGT version used for tests, and an approximation of the failure rate.
74
75 They should be provided under the following format::
76
77 # Bug Report: $LORE_URL_OR_GITLAB_ISSUE
78 # Board Name: broken-board.dtb
79 # Linux Version: 6.6-rc1
80 # IGT Version: 1.28-gd2af13d9f
81 # Failure Rate: 100
82 flaky-test
83
84 Use the appropriate link below to create a GitLab issue:
85 amdgpu driver: https://gitlab.freedesktop.org/drm/amd/-/issues
86 i915 driver: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues
87 msm driver: https://gitlab.freedesktop.org/drm/msm/-/issues
88 xe driver: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues
89
90 drivers/gpu/drm/ci/${DRIVER_NAME}-${HW_REVISION}-skips.txt
91 -----------------------------------------------------------
92
93 Lists the tests that won't be run for a given driver on a specific hardware
94 revision. These are usually tests that interfere with the running of the test
95 list due to hanging the machine, causing OOM, taking too long, etc.
96
97
98 How to enable automated testing on your tree
99 ============================================
100
101 1. Create a Linux tree in https://gitlab.freedesktop.org/ if you don't have one
102 yet
103
104 2. In your kernel repo's configuration (eg.
105 https://gitlab.freedesktop.org/janedoe/linux/-/settings/ci_cd), change the
106 CI/CD configuration file from .gitlab-ci.yml to
107 drivers/gpu/drm/ci/gitlab-ci.yml.
108
109 3. Request to be added to the drm/ci-ok group so that your user has the
110 necessary privileges to run the CI on https://gitlab.freedesktop.org/drm/ci-ok
111
112 4. Next time you push to this repository, you will see a CI pipeline being
113 created (eg. https://gitlab.freedesktop.org/janedoe/linux/-/pipelines)
114
115 5. The various jobs will be run and when the pipeline is finished, all jobs
116 should be green unless a regression has been found.
117
118 6. Warnings in the pipeline indicate that lockdep
119 (see Documentation/locking/lockdep-design.rst) issues have been detected
120 during the tests.
121
122
123 How to update test expectations
124 ===============================
125
126 If your changes to the code fix any tests, you will have to remove one or more
127 lines from one or more of the files in
128 drivers/gpu/drm/ci/${DRIVER_NAME}_*_fails.txt, for each of the test platforms
129 affected by the change.
130
131
132 How to expand coverage
133 ======================
134
135 If your code changes make it possible to run more tests (by solving reliability
136 issues, for example), you can remove tests from the flakes and/or skips lists,
137 and then the expected results if there are any known failures.
138
139 If there is a need for updating the version of IGT being used (maybe you have
140 added more tests to it), update the IGT_VERSION variable at the top of the
141 gitlab-ci.yml file.
142
143
144 How to test your changes to the scripts
145 =======================================
146
147 For testing changes to the scripts in the drm-ci repo, change the
148 DRM_CI_PROJECT_PATH and DRM_CI_COMMIT_SHA variables in
149 drivers/gpu/drm/ci/gitlab-ci.yml to match your fork of the project (eg.
150 janedoe/drm-ci). This fork needs to be in https://gitlab.freedesktop.org/.
151
152
153 How to incorporate external fixes in your testing
154 =================================================
155
156 Often, regressions in other trees will prevent testing changes local to the
157 tree under test. These fixes will be automatically merged in during the build
158 jobs from a branch in the target tree that is named as
159 ${TARGET_BRANCH}-external-fixes.
160
161 If the pipeline is not in a merge request and a branch with the same name
162 exists in the local tree, commits from that branch will be merged in as well.
163
164
165 How to deal with automated testing labs that may be down
166 ========================================================
167
168 If a hardware farm is down and thus causing pipelines to fail that would
169 otherwise pass, one can disable all jobs that would be submitted to that farm
170 by editing the file at
171 https://gitlab.freedesktop.org/gfx-ci/lab-status/-/blob/main/lab-status.yml.
172

3. 한국어 전문 번역

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

공유 DRM 자동화 시험의 목적

1-23

Core 또는 driver 변경이 regression을 만들지 않았는지 확인하려면 다양한 hardware configuration을 시험해야 하므로 시간이 많이 듭니다. 시험에 관심 있는 각 사람이 상당한 양의 hardware를 직접 구입하고 유지하는 것도 현실적이지 않습니다.

또한 maintainer가 regression을 찾아 되돌려 알릴 때까지 기다리기보다 developer가 자신의 code에서 regression을 직접 확인하는 편이 바람직합니다.

gitlab.freedesktop.org에는 Mesa를 자동 시험하는 facility가 있으며 DRM subsystem 시험에도 사용할 수 있습니다. 이 문서는 공유 infrastructure를 이용해 시험 시간과 노력을 줄이는 방법을 설명합니다.

자동화 시험이 해결하는 문제
문제공유 CI의 역할
다양한 hardware configuration공유 시험 장비에서 여러 구성을 실행
개별 장비 구입·유지 부담공동 infrastructure 사용
Regression 발견 지연Developer가 자신의 변경을 직접 검증
반복 작업GitLab CI pipeline으로 자동화

개별 hardware 보유와 maintainer 의존을 공유 CI로 줄입니다.

DRM 자동화 시험 목적
Core 또는 driver 변경 준비gitlab.freedesktop.org 공유 CI 사용여러 hardware configuration에서 시험Developer가 regression 여부 직접 확인

Code 변경에서 공유 장비의 regression 결과까지 이어지는 흐름입니다.

.. SPDX-License-Identifier: GPL-2.0+

=========================================
Automated testing of the DRM subsystem
=========================================

Introduction
============

Making sure that changes to the core or drivers don't introduce regressions can
be very time-consuming when lots of different hardware configurations need to
be tested. Moreover, it isn't practical for each person interested in this
testing to have to acquire and maintain what can be a considerable amount of
hardware.

Also, it is desirable for developers to check for regressions in their code by
themselves, instead of relying on the maintainers to find them and then
reporting back.

There are facilities in gitlab.freedesktop.org to automatically test Mesa that
can be used as well for testing the DRM subsystem. This document explains how
people interested in testing it can use this shared infrastructure to save
quite some time and effort.

Root CI 설정과 공통 test list

24-56

`drivers/gpu/drm/ci/gitlab-ci.yml`은 GitLab CI의 root configuration file입니다. 사용해야 할 script의 특정 version을 지정하며 pipeline 동작을 바꾸는 변수도 제공합니다.

gitlab-ci.yml 변수
변수의미
DRM_CI_PROJECT_PATHCI용 Mesa software infrastructure가 들어 있는 repository
DRM_CI_COMMIT_SHA그 repository에서 사용할 특정 revision
UPSTREAM_REPOTarget branch가 있는 git repository URL
TARGET_BRANCH현재 branch가 merge될 대상 branch
IGT_VERSION사용할 igt-gpu-tools revision

변수 이름과 원문 정의를 일대일로 보존합니다.

`IGT_VERSION`의 revision은 `https://gitlab.freedesktop.org/drm/igt-gpu-tools` 프로젝트를 기준으로 합니다.

`drivers/gpu/drm/ci/testlist.txt`에는 모든 driver에서 실행할 IGT test가 들어 있습니다. 다만 해당 driver의 `*-skips.txt`에 기록된 test는 실행하지 않습니다.

공통 시험 선택
gitlab-ci.yml에서 infrastructure와 revision 변수 설정testlist.txt에서 공통 IGT tests 읽기Driver·hardware별 *-skips.txt 적용남은 test를 pipeline job에 배치

Root 설정과 공통 목록, driver별 skip이 실제 실행 집합을 만듭니다.



Relevant files
==============

drivers/gpu/drm/ci/gitlab-ci.yml
--------------------------------

This is the root configuration file for GitLab CI. Among other less interesting
bits, it specifies the specific version of the scripts to be used. There are
some variables that can be modified to change the behavior of the pipeline:

DRM_CI_PROJECT_PATH
    Repository that contains the Mesa software infrastructure for CI

DRM_CI_COMMIT_SHA
    A particular revision to use from that repository

UPSTREAM_REPO
    URL to git repository containing the target branch

TARGET_BRANCH
    Branch to which this branch is to be merged into

IGT_VERSION
    Revision of igt-gpu-tools being used, from
    https://gitlab.freedesktop.org/drm/igt-gpu-tools

drivers/gpu/drm/ci/testlist.txt
-------------------------------

IGT tests to be run on all drivers (unless mentioned in a driver's \*-skips.txt
file, see below).

Known failure, flake, skip 파일

57-95

`drivers/gpu/drm/ci/${DRIVER_NAME}-${HW_REVISION}-fails.txt`는 특정 hardware revision의 해당 driver에서 알려진 failure를 나열합니다.

`${DRIVER_NAME}-${HW_REVISION}-flakes.txt`는 신뢰성 없이 동작하는 것으로 알려진 test를 나열합니다. 이 test들은 계속 실행되지만 결과와 관계없이 job failure를 일으키지 않습니다.

새 flake entry에는 affected driver author에게 bug를 보고한 email 링크 또는 관련 GitLab issue 링크가 반드시 있어야 합니다. Board name 또는 Device Tree name, 처음 영향을 받은 kernel version, 시험에 사용한 IGT version, 대략적인 failure rate도 포함해야 합니다.

# Bug Report: $LORE_URL_OR_GITLAB_ISSUE
# Board Name: broken-board.dtb
# Linux Version: 6.6-rc1
# IGT Version: 1.28-gd2af13d9f
# Failure Rate: 100
flaky-test
Driver별 GitLab issue
DriverIssue URL
amdgpuhttps://gitlab.freedesktop.org/drm/amd/-/issues
i915https://gitlab.freedesktop.org/drm/i915/kernel/-/issues
msmhttps://gitlab.freedesktop.org/drm/msm/-/issues
xehttps://gitlab.freedesktop.org/drm/xe/kernel/-/issues

원문이 제공하는 driver별 issue 생성 위치입니다.

`${DRIVER_NAME}-${HW_REVISION}-skips.txt`는 특정 hardware revision의 driver에서 실행하지 않을 test를 나열합니다. 보통 machine hang, OOM, 지나치게 긴 실행 시간 등으로 전체 test list 실행을 방해하는 test입니다.

fails·flakes·skips 비교
파일실행 여부Pipeline 판정
fails.txt실행특정 platform의 알려진 failure expectation
flakes.txt실행결과와 관계없이 job failure를 유발하지 않음
skips.txt실행하지 않음Hang·OOM·장시간 test 등을 제외

세 파일은 test의 실행 여부와 job 판정에 서로 다른 영향을 줍니다.


drivers/gpu/drm/ci/${DRIVER_NAME}-${HW_REVISION}-fails.txt
----------------------------------------------------------

Lists the known failures for a given driver on a specific hardware revision.

drivers/gpu/drm/ci/${DRIVER_NAME}-${HW_REVISION}-flakes.txt
-----------------------------------------------------------

Lists the tests that for a given driver on a specific hardware revision are
known to behave unreliably. These tests won't cause a job to fail regardless of
the result. They will still be run.

Each new flake entry must be associated with a link to the email reporting the
bug to the author of the affected driver or the relevant GitLab issue. The entry
must also include the board name or Device Tree name, the first kernel version
affected, the IGT version used for tests, and an approximation of the failure rate.

They should be provided under the following format::

  # Bug Report: $LORE_URL_OR_GITLAB_ISSUE
  # Board Name: broken-board.dtb
  # Linux Version: 6.6-rc1
  # IGT Version: 1.28-gd2af13d9f
  # Failure Rate: 100
  flaky-test

Use the appropriate link below to create a GitLab issue:
amdgpu driver: https://gitlab.freedesktop.org/drm/amd/-/issues
i915 driver: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues
msm driver: https://gitlab.freedesktop.org/drm/msm/-/issues
xe driver: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues

drivers/gpu/drm/ci/${DRIVER_NAME}-${HW_REVISION}-skips.txt
-----------------------------------------------------------

Lists the tests that won't be run for a given driver on a specific hardware
revision. These are usually tests that interfere with the running of the test
list due to hanging the machine, causing OOM, taking too long, etc.

자신의 tree에서 자동 시험 활성화

96-120

자동 시험을 활성화하려면 gitlab.freedesktop.org에 Linux tree를 만들고 repository CI/CD 설정에서 configuration file을 `.gitlab-ci.yml` 대신 `drivers/gpu/drm/ci/gitlab-ci.yml`로 바꿉니다.

CI 실행 권한을 얻도록 `drm/ci-ok` group 추가를 요청합니다. 그 다음 repository에 push하면 CI pipeline이 생성되고 여러 job이 실행됩니다.

자동 시험 활성화 6단계
1. gitlab.freedesktop.org에 Linux tree 생성2. CI/CD configuration file을 drivers/gpu/drm/ci/gitlab-ci.yml로 변경3. drm/ci-ok group 추가를 요청해 CI 권한 획득4. Repository에 push하여 pipeline 생성 확인5. Pipeline 완료 후 regression이 없으면 모든 job이 green인지 확인6. Warning이 있으면 test 중 lockdep issue 검출 여부 확인

원문 번호 순서를 그대로 유지합니다.

활성화에 사용되는 위치
목적위치
CI/CD 설정 예시https://gitlab.freedesktop.org/janedoe/linux/-/settings/ci_cd
CI configurationdrivers/gpu/drm/ci/gitlab-ci.yml
권한 grouphttps://gitlab.freedesktop.org/drm/ci-ok
Pipeline 예시https://gitlab.freedesktop.org/janedoe/linux/-/pipelines
Lockdep 설명Documentation/locking/lockdep-design.rst

예시 URL과 repository 내부 설정 파일을 구분합니다.

Pipeline이 끝나면 regression이 발견되지 않은 한 모든 job이 green이어야 합니다. Pipeline warning은 시험 중 lockdep issue가 검출됐음을 나타냅니다.



How to enable automated testing on your tree
============================================

1. Create a Linux tree in https://gitlab.freedesktop.org/ if you don't have one
yet

2. In your kernel repo's configuration (eg.
https://gitlab.freedesktop.org/janedoe/linux/-/settings/ci_cd), change the
CI/CD configuration file from .gitlab-ci.yml to
drivers/gpu/drm/ci/gitlab-ci.yml.

3. Request to be added to the drm/ci-ok group so that your user has the
necessary privileges to run the CI on https://gitlab.freedesktop.org/drm/ci-ok

4. Next time you push to this repository, you will see a CI pipeline being
created (eg. https://gitlab.freedesktop.org/janedoe/linux/-/pipelines)

5. The various jobs will be run and when the pipeline is finished, all jobs
should be green unless a regression has been found.

6. Warnings in the pipeline indicate that lockdep
(see Documentation/locking/lockdep-design.rst) issues have been detected
during the tests.

Expectation 갱신과 coverage 확장

121-141

Code 변경으로 test가 고쳐졌다면, 그 변경의 영향을 받은 각 test platform에 대해 하나 이상의 `drivers/gpu/drm/ci/${DRIVER_NAME}_*_fails.txt` 파일에서 해당 줄을 제거해야 합니다.

Reliability 문제 해결 등으로 더 많은 test를 실행할 수 있게 됐다면 flakes 또는 skips list에서 해당 test를 제거할 수 있습니다. 알려진 failure가 있다면 이어서 expected result도 맞게 조정합니다.

사용하는 IGT version을 갱신해야 한다면, 예를 들어 IGT에 test를 더 추가했다면 `gitlab-ci.yml` 맨 위의 `IGT_VERSION` 변수를 갱신합니다.

변경 유형별 기대값 갱신
변경갱신 대상
Known failure 수정${DRIVER_NAME}_*_fails.txt에서 해당 platform 줄 제거
Flaky test 안정화flakes list에서 제거
실행 불가 원인 해결skips list에서 제거
Known failure가 남음Expected result 조정
IGT revision 변경gitlab-ci.yml의 IGT_VERSION

Code와 test infrastructure 변경에 맞는 파일을 선택합니다.

Coverage 확장 후 정리
Reliability 문제 해결Flakes 또는 skips list에서 test 제거Test를 실제 pipeline 실행 집합에 포함Known failure가 있으면 expected result 갱신

실행 범위를 늘린 뒤 expectation을 일치시킵니다.



How to update test expectations
===============================

If your changes to the code fix any tests, you will have to remove one or more
lines from one or more of the files in
drivers/gpu/drm/ci/${DRIVER_NAME}_*_fails.txt, for each of the test platforms
affected by the change.


How to expand coverage
======================

If your code changes make it possible to run more tests (by solving reliability
issues, for example), you can remove tests from the flakes and/or skips lists,
and then the expected results if there are any known failures.

If there is a need for updating the version of IGT being used (maybe you have
added more tests to it), update the IGT_VERSION variable at the top of the
gitlab-ci.yml file.

CI script 변경과 external fix 병합

142-163

drm-ci repository의 script 변경을 시험하려면 `drivers/gpu/drm/ci/gitlab-ci.yml`에서 `DRM_CI_PROJECT_PATH`와 `DRM_CI_COMMIT_SHA`를 자신의 project fork와 revision에 맞춥니다. 예시는 `janedoe/drm-ci`이며 fork는 gitlab.freedesktop.org에 있어야 합니다.

Script fork 시험 변수
변수설정
DRM_CI_PROJECT_PATHgitlab.freedesktop.org의 자신의 drm-ci fork
DRM_CI_COMMIT_SHA시험할 fork revision

Project 위치와 정확한 revision을 함께 지정합니다.

다른 tree의 regression 때문에 현재 tree의 변경을 시험할 수 없는 경우가 자주 있습니다. 필요한 fix는 target tree에서 `${TARGET_BRANCH}-external-fixes`라는 branch에 두면 build job 중 자동으로 merge됩니다.

Pipeline이 merge request 안에서 실행되지 않고 local tree에도 같은 이름의 branch가 있으면, 그 local branch의 commit도 함께 merge됩니다.

External fix 병합
TARGET_BRANCH 값 확인Target tree에 ${TARGET_BRANCH}-external-fixes branch 준비Build job이 해당 fix를 자동 mergeNon-MR pipeline이면 local tree의 같은 이름 branch도 확인존재하면 local branch commit도 merge

Target tree와 local tree의 branch 적용 조건을 구분합니다.



How to test your changes to the scripts
=======================================

For testing changes to the scripts in the drm-ci repo, change the
DRM_CI_PROJECT_PATH and DRM_CI_COMMIT_SHA variables in
drivers/gpu/drm/ci/gitlab-ci.yml to match your fork of the project (eg.
janedoe/drm-ci). This fork needs to be in https://gitlab.freedesktop.org/.


How to incorporate external fixes in your testing
=================================================

Often, regressions in other trees will prevent testing changes local to the
tree under test. These fixes will be automatically merged in during the build
jobs from a branch in the target tree that is named as
${TARGET_BRANCH}-external-fixes.

If the pipeline is not in a merge request and a branch with the same name
exists in the local tree, commits from that branch will be merged in as well.

중단된 automated testing lab 처리

164-171

Hardware farm 중단 때문에 원래 통과해야 할 pipeline이 실패한다면, 해당 farm으로 제출될 모든 job을 비활성화할 수 있습니다.

비활성화 상태는 `https://gitlab.freedesktop.org/gfx-ci/lab-status/-/blob/main/lab-status.yml` 파일을 편집하여 설정합니다.

Lab 중단 대응
상황조치
Hardware farm down해당 farm으로 제출될 모든 job 비활성화
상태 파일gfx-ci/lab-status의 main/lab-status.yml 편집

원인과 조치 파일을 직접 연결합니다.

Lab 장애 시 pipeline 보호
Hardware farm down 여부 확인lab-status.yml에서 해당 farm 상태 편집해당 farm 대상 job 비활성화원래 통과할 pipeline의 장비 장애 실패 방지

장비 문제를 code regression으로 오판하지 않도록 job 제출을 제어합니다.


How to deal with automated testing labs that may be down
========================================================

If a hardware farm is down and thus causing pipelines to fail that would
otherwise pass, one can disable all jobs that would be submitted to that farm
by editing the file at
https://gitlab.freedesktop.org/gfx-ci/lab-status/-/blob/main/lab-status.yml.