<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/testing/kunit/kunit_tool_test.py, branch v5.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-08-05T17:07:39Z</updated>
<entry>
<title>Merge tag 'linux-kselftest-kunit-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest</title>
<updated>2020-08-05T17:07:39Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-08-05T17:07:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=53e5504bdbdb16548e39a4834c97742693964197'/>
<id>urn:sha1:53e5504bdbdb16548e39a4834c97742693964197</id>
<content type='text'>
Pull kunit updates from Shuah Khan:

 - Add a generic kunit_resource API extending it to support resources
   that are passed in to kunit in addition kunit allocated resources. In
   addition, KUnit resources are now refcounted to avoid passed in
   resources being released while in use by kunit.

 - Add support for named resources.

 - Important bug fixes from Brendan Higgins and Will Chen

* tag 'linux-kselftest-kunit-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  kunit: tool: fix improper treatment of file location
  kunit: tool: fix broken default args in unit tests
  kunit: capture stderr on all make subprocess calls
  Documentation: kunit: Remove references to --defconfig
  kunit: add support for named resources
  kunit: generalize kunit_resource API beyond allocated resources
</content>
</entry>
<entry>
<title>kunit: tool: fix improper treatment of file location</title>
<updated>2020-07-17T20:17:49Z</updated>
<author>
<name>Brendan Higgins</name>
<email>brendanhiggins@google.com</email>
</author>
<published>2020-07-14T20:41:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d43c7fb05765152d4d4a39a8ef957c4ea14d8847'/>
<id>urn:sha1:d43c7fb05765152d4d4a39a8ef957c4ea14d8847</id>
<content type='text'>
Commit 01397e822af4 ("kunit: Fix TabError, remove defconfig code and
handle when there is no kunitconfig") and commit 45ba7a893ad8 ("kunit:
kunit_tool: Separate out config/build/exec/parse") introduced two
closely related issues which built off of each other: they excessively
created the build directory when not present and modified a constant
(constants in Python only exist by convention).

Together these issues broken a number of unit tests for KUnit tool, so
fix them.

Fixed up commit log to fic checkpatch commit description style error.
Shuah Khan &lt;skhan@linuxfoundation.org&gt;

Fixes: 01397e822af4 ("kunit: Fix TabError, remove defconfig code and handle when there is no kunitconfig")
Fixes: 45ba7a893ad8 ("kunit: kunit_tool: Separate out config/build/exec/parse")
Signed-off-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: tool: fix broken default args in unit tests</title>
<updated>2020-07-17T20:17:42Z</updated>
<author>
<name>Brendan Higgins</name>
<email>brendanhiggins@google.com</email>
</author>
<published>2020-07-14T20:41:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6816fe61bda8c819c368ad2002cd27172ecb79de'/>
<id>urn:sha1:6816fe61bda8c819c368ad2002cd27172ecb79de</id>
<content type='text'>
Commit ddbd60c779b4 ("kunit: use --build_dir=.kunit as default") changed
the default build directory for KUnit tests, but failed to update
associated unit tests for kunit_tool, so update them.

Fixes: ddbd60c779b4 ("kunit: use --build_dir=.kunit as default")
Signed-off-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: show error if kunit results are not present</title>
<updated>2020-06-26T20:29:10Z</updated>
<author>
<name>Uriel Guajardo</name>
<email>urielguajardo@google.com</email>
</author>
<published>2020-06-11T21:05:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e173b8b8c419897eabe0e337a0125c6d87ef1644'/>
<id>urn:sha1:e173b8b8c419897eabe0e337a0125c6d87ef1644</id>
<content type='text'>
Currently, if the kernel is configured incorrectly or if it crashes before any
kunit tests are run, kunit finishes without error, reporting
that 0 test cases were run.

To fix this, an error is shown when the tap header is not found, which
indicates that kunit was not able to run at all.

Signed-off-by: Uriel Guajardo &lt;urielguajardo@google.com&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: kunit_tool: Separate out config/build/exec/parse</title>
<updated>2020-05-11T22:53:40Z</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2020-05-01T04:27:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=45ba7a893ad89114e773b3dc32f6431354c465d6'/>
<id>urn:sha1:45ba7a893ad89114e773b3dc32f6431354c465d6</id>
<content type='text'>
Add new subcommands to kunit.py to allow stages of the existing 'run'
subcommand to be run independently:
- 'config': Verifies that .config is a subset of .kunitconfig
- 'build': Compiles a UML kernel for KUnit
- 'exec': Runs the kernel, and outputs the test results.
- 'parse': Parses test results from a file or stdin

The 'run' command continues to behave as before.

Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: kunit_tool: Allow .kunitconfig to disable config items</title>
<updated>2020-03-25T18:13:16Z</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2020-03-24T02:43:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=97752c39bdaeea990260d3111250f6c861519808'/>
<id>urn:sha1:97752c39bdaeea990260d3111250f6c861519808</id>
<content type='text'>
Rework kunit_tool in order to allow .kunitconfig files to better enforce
that disabled items in .kunitconfig are disabled in the generated
.config.

Previously, kunit_tool simply enforced that any line present in
.kunitconfig was also present in .config, but this could cause problems
if a config option was disabled in .kunitconfig, but not listed in .config
due to (for example) having disabled dependencies.

To fix this, re-work the parser to track config names and values, and
require values to match unless they are explicitly disabled with the
"CONFIG_x is not set" comment (or by setting its value to 'n'). Those
"disabled" values will pass validation if omitted from the .config, but
not if they have a different value.

Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: Run all KUnit tests through allyesconfig</title>
<updated>2020-03-20T22:17:39Z</updated>
<author>
<name>Heidi Fahim</name>
<email>heidifahim@google.com</email>
</author>
<published>2020-03-16T20:21:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=021ed9f551da33449a5238e45e849913422671d7'/>
<id>urn:sha1:021ed9f551da33449a5238e45e849913422671d7</id>
<content type='text'>
Implemented the functionality to run all KUnit tests through kunit_tool
by specifying an --alltests flag, which builds UML with allyesconfig
enabled, and consequently runs every KUnit test. A new function was
added to kunit_kernel: make_allyesconfig.
Firstly, if --alltests is specified, kunit.py triggers build_um_kernel
which call make_allyesconfig. This function calls the make command,
disables the broken configs that would otherwise prevent UML from
building, then starts the kernel with all possible configurations
enabled. All stdout and stderr is sent to test.log and read from there
then fed through kunit_parser to parse the tests to the user. Also added
a signal_handler in case kunit is interrupted while running.
Tested: Run under different conditions such as testing with
--raw_output, testing program interrupt then immediately running kunit
again without --alltests and making sure to clean the console.

Signed-off-by: Heidi Fahim &lt;heidifahim@google.com&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: kunit_parser: make parser more robust</title>
<updated>2020-03-20T22:15:57Z</updated>
<author>
<name>Heidi Fahim</name>
<email>heidifahim@google.com</email>
</author>
<published>2020-03-16T20:21:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=afc63da64f1e5e41875c98707020e85050f8a0c5'/>
<id>urn:sha1:afc63da64f1e5e41875c98707020e85050f8a0c5</id>
<content type='text'>
Previously, kunit_parser did not properly handle kunit TAP output that
- had any prefixes (generated from different configs e.g.
CONFIG_PRINTK_TIME)
- had unrelated kernel output mixed in the middle of
it, which has shown up when testing with allyesconfig
To remove prefixes, the parser looks for the first line that includes
TAP output, "TAP version 14".  It then determines the length of the
string before this sequence, and strips that number of characters off
the beginning of the following lines until the last KUnit output line is
reached.
These fixes have been tested with additional tests in the
KUnitParseTest and their associated logs have also been added.

Signed-off-by: Heidi Fahim &lt;heidifahim@google.com&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit/kunit_tool_test: Test '--build_dir' option run</title>
<updated>2019-12-23T17:52:41Z</updated>
<author>
<name>SeongJae Park</name>
<email>sjpark@amazon.de</email>
</author>
<published>2019-12-20T05:14:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b1b35201bcf411191986eefdef5f5fb5f41cd879'/>
<id>urn:sha1:b1b35201bcf411191986eefdef5f5fb5f41cd879</id>
<content type='text'>
This commit adds kunit tool test for the '--build_dir' option.

Signed-off-by: SeongJae Park &lt;sjpark@amazon.de&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Tested-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: Place 'test.log' under the 'build_dir'</title>
<updated>2019-12-23T17:52:41Z</updated>
<author>
<name>SeongJae Park</name>
<email>sjpark@amazon.de</email>
</author>
<published>2019-12-20T05:14:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=609952c2afc9542b336cf9a72d4a09606e05fa2a'/>
<id>urn:sha1:609952c2afc9542b336cf9a72d4a09606e05fa2a</id>
<content type='text'>
'kunit' writes the 'test.log' under the kernel source directory even
though a 'build_dir' option is given.  As users who use the option might
expect the outputs to be placed under the specified directory, this
commit modifies the logic to write the log file under the 'build_dir'.

Signed-off-by: SeongJae Park &lt;sjpark@amazon.de&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Tested-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
</feed>
