User Tools

Site Tools


start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
start [2014-08-29 23:40]
tbird20d [sub-projects]
start [2018-11-08 00:23] (current)
shuah
Line 1: Line 1:
-===== kselftest ​wiki ===== +The Linux kernel contains a set of developer unit and regression tests (Kselftests) in the Kernel sources under tools/​testing/​selftest directory. These tests exercise individual code paths in the kernel. Even though ​kselftest’s main purpose ​is for developer regression test, testers and users can also use it to ensure there are no regressions in a new kernel.
-This wiki is dedicated ​to holding information about the kselftest feature of the Linux kernel.+
  
-==== About kselftest ====+Kselftest is run everyday on several Linux kernel trees on the 0-Day and Linaro Test Farm and other Linux kernel integration test rings. 
 + 
 +Please find current status as of Linux 4.19 and progress made since 3.17 in [[https://​drive.google.com/​open?​id=15eSgzws88nuTf_wHyzI6SVCTrIZznWtG|Shuah'​s Kselftest Overview]]. 
 + 
 +Please find Kselftest framework details and how to contribute to Kselftest sub-system and write new tests in [[https://​drive.google.com/​open?​id=1K_mrWL_pR-7wXjnuo1moSlj8Ewd8Fwq9|Shuah'​s Kselftest How to Guide]] 
 + 
 +===== Resources ===== 
 +  * Shuah Khan maintains next anf fixes branches of the Kselftest git on kernel.org 
 +    * <​code>​git://​git.kernel.org/​pub/​scm/​shuah/​linux-kselftest</​code>​ 
 +  * mailing list: linux-kselftest@vger.kernel.org 
 +    * lkml should be copied (as for other kernel sub-system work) 
 +  * [[https://​patchwork.kernel.org/​project/​linux-kselftest/​list/​|Patchwork:​linux-kselftest]] 
 + 
 + 
 +===== Archived Information - About kselftest ​=====
 The purpose of kselftest is to provide kernel developers and end-users a quick method of running tests against The purpose of kselftest is to provide kernel developers and end-users a quick method of running tests against
-the Linux kernel. ​ As of this writing, Samsung developer Shuah Kahn is the project leader.+the Linux kernel. ​ As of this writing, Samsung developer Shuah Khan is the project leader.
  
 kselftest was discussed at the 2014 kernel summit (in August, 2014), with Shuah making kselftest was discussed at the 2014 kernel summit (in August, 2014), with Shuah making
 a presentation during the "core day" of the summit. ​ Some followup discussions were held during an a presentation during the "core day" of the summit. ​ Some followup discussions were held during an
 "​unconference"​ session the following day. "​unconference"​ session the following day.
 +
 +Source code for kselftest tests is contained in the directory ''​tools/​testing/​selftests''​ in the kernel source tree.
  
   * There is an [[https://​lwn.net/​Articles/​608959/​|LWN.net Kernel self tests article]] which discusses the discussions held during the core day.   * There is an [[https://​lwn.net/​Articles/​608959/​|LWN.net Kernel self tests article]] which discusses the discussions held during the core day.
   * [[https://​lwn.net/​Articles/​609374/​|Paul McKenney'​s notes from discussions at the kernel summit]] are also available.   * [[https://​lwn.net/​Articles/​609374/​|Paul McKenney'​s notes from discussions at the kernel summit]] are also available.
 +  * More discussion happened follwing the summit, on the ksummit-discuss mailing list.
 +    * See [[http://​lists.linuxfoundation.org/​pipermail/​ksummit-discuss/​2014-August/​thread.html#​1059|this thread]]
 +    * And [[http://​lists.linuxfoundation.org/​pipermail/​ksummit-discuss/​2014-August/​thread.html#​1191|this thread]]
  
 The kselftest feature (in rough draft form, I'd say) first appeared in kernel version 3.16. The kselftest feature (in rough draft form, I'd say) first appeared in kernel version 3.16.
Line 17: Line 35:
 ==== Some features of kselftest ==== ==== Some features of kselftest ====
  
-Here is a list of desired features for kselftest ​(some of which already exist (as of August 2014):+Here is a list of desired features for kselftest ​-- some of which already exist (as of August 2014):
   * ability to quickly execute tests (current target is under 20 minutes)   * ability to quickly execute tests (current target is under 20 minutes)
     * some developers want tests to run in a few seconds ​     * some developers want tests to run in a few seconds ​
Line 23: Line 41:
   * test source code is kept in the kernel source tree, where it is easily accessible to anyone working with the kernel source   * test source code is kept in the kernel source tree, where it is easily accessible to anyone working with the kernel source
  
-==== sub-projects ​====+===== Status ​===== 
 +As of August, 2014, Shuah Khan reported the status of kselftest as follows: 
 +(see http://​lists.linuxfoundation.org/​pipermail/​ksummit-discuss/​2014-August/​001059.html)
  
 +Short summary of work done so far for 3.17:
 +
 +  * fix compile errors and warnings in various tests
 +  * fix run-time errors when tests aren't run as root
 +  * enhance and improve cpu and memory hot-plug tests to run in limited scope mode by default. A new make target to select full-scope testing. Prior to this change, cpu and memory hot-plug tests hung trying to hot-plug all but cpu0 and a large portion of the memory.
 +  * add a new kselftest target to run existing selftests to start with.
 +
 +What's planned for 3.18 and beyond:
 +  * get feedback on the new kselftest target from the community
 +  * add more tests to be run under kselftest umbrella
 +  * identify existing tests under /lib and other areas that make a good candidate to be included under kselftest
 +  * Some of these could be run as a tool and/or a independent test with a few changes and some probably aren't like the /​lib/​locking tests.
 +  * As a goal, try to leverage existing tests and modify them as needed to run them as a black-box test (e.g: look into ways to make it run as a tool)
 +  * Greg KH sparked the kernel selftest idea, has been in the loop for the work done so far, and reviewed the plan for 3.18.
 +
 +===== Sub-projects =====
 There are some sub-projects or additional features, that some developers have expressed interest in, for There are some sub-projects or additional features, that some developers have expressed interest in, for
 the kselftest system. ​ Below is a bullet list for tracking the status of these different sub-projects:​ the kselftest system. ​ Below is a bullet list for tracking the status of these different sub-projects:​
 (In parenthesis are some people who have expressed interest in this sub-project or feature) ​ If a link is present then there'​s a sub-page to discuss that project. (In parenthesis are some people who have expressed interest in this sub-project or feature) ​ If a link is present then there'​s a sub-page to discuss that project.
  
-  * standardize the test output format (Grant Likely)+  * [[standardize the test output]] format (Grant Likely)
   * [[support cross-compilation]] (Tim Bird, Grant Likely, and others)   * [[support cross-compilation]] (Tim Bird, Grant Likely, and others)
   * support local execution of tests in a virtualized environment (kvm, virtualbox, qemu)   * support local execution of tests in a virtualized environment (kvm, virtualbox, qemu)
Line 40: Line 76:
     * cross-compilation (ie CROSS_COMPILE support)     * cross-compilation (ie CROSS_COMPILE support)
  
-===== some desired tests ====+==== Some desired tests ====
 Initially, Shuah started collecting existing unit tests from other places both inside and outside the kernel Initially, Shuah started collecting existing unit tests from other places both inside and outside the kernel
 source tree.  Here are some tests that have been discussed or requested: source tree.  Here are some tests that have been discussed or requested:
Line 47: Line 82:
   * performance tests   * performance tests
   * basic boot test (get to login prompt)   * basic boot test (get to login prompt)
- 
- 
  
start.1409355607.txt.gz · Last modified: 2014-08-29 23:40 by tbird20d