<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib/kunit, branch v5.8</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.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-06-01T20:23:25Z</updated>
<entry>
<title>kunit: default KUNIT_* fragments to KUNIT_ALL_TESTS</title>
<updated>2020-06-01T20:23:25Z</updated>
<author>
<name>Anders Roxell</name>
<email>anders.roxell@linaro.org</email>
</author>
<published>2020-05-11T13:14:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=beaed42c427dbe8fedba4518b2baf5203f5e398b'/>
<id>urn:sha1:beaed42c427dbe8fedba4518b2baf5203f5e398b</id>
<content type='text'>
This makes it easier to enable all KUnit fragments.

Adding 'if !KUNIT_ALL_TESTS' so individual tests can not be turned off.
Therefore if KUNIT_ALL_TESTS is enabled that will hide the prompt in
menuconfig.

Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Anders Roxell &lt;anders.roxell@linaro.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: Kconfig: enable a KUNIT_ALL_TESTS fragment</title>
<updated>2020-06-01T20:19:16Z</updated>
<author>
<name>Anders Roxell</name>
<email>anders.roxell@linaro.org</email>
</author>
<published>2020-05-11T13:14:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=92238b31bd054cc2a046df96507575f3f10c277f'/>
<id>urn:sha1:92238b31bd054cc2a046df96507575f3f10c277f</id>
<content type='text'>
Make it easier to enable all KUnit fragments.  This is useful for kernel
devs or testers, so its easy to get all KUnit tests enabled and if new
gets added they will be enabled as well.  Fragments that has to be
builtin will be missed if CONFIG_KUNIT_ALL_TESTS is set as a module.

Signed-off-by: Anders Roxell &lt;anders.roxell@linaro.org&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: Add missing newline in summary message</title>
<updated>2020-04-23T21:42:00Z</updated>
<author>
<name>Marco Elver</name>
<email>elver@google.com</email>
</author>
<published>2020-04-16T11:42:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6cb1818798812fe7e2c8fe3f489ad1c86adfd6c4'/>
<id>urn:sha1:6cb1818798812fe7e2c8fe3f489ad1c86adfd6c4</id>
<content type='text'>
Add missing newline, as otherwise flushing of the final summary message
to the console log can be delayed.

Fixes: e2219db280e3 ("kunit: add debugfs /sys/kernel/debug/kunit/&lt;suite&gt;/results display")
Signed-off-by: Marco Elver &lt;elver@google.com&gt;
Tested-by: David Gow &lt;davidgow@google.com&gt;
Reviewed-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Acked-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: subtests should be indented 4 spaces according to TAP</title>
<updated>2020-03-26T20:08:41Z</updated>
<author>
<name>Alan Maguire</name>
<email>alan.maguire@oracle.com</email>
</author>
<published>2020-03-26T14:25:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c3bba690a2643245f59a4d5d66e6b687459696d9'/>
<id>urn:sha1:c3bba690a2643245f59a4d5d66e6b687459696d9</id>
<content type='text'>
Introduce KUNIT_SUBTEST_INDENT macro which corresponds to 4-space
indentation and KUNIT_SUBSUBTEST_INDENT macro which corresponds to
8-space indentation in line with TAP spec (e.g. see "Subtests"
section of https://node-tap.org/tap-protocol/).

Use these macros in place of one or two tabs in strings to clarify
why we are indenting.

Suggested-by: Frank Rowand &lt;frowand.list@gmail.com&gt;
Signed-off-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Reviewed-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: add log test</title>
<updated>2020-03-26T20:08:01Z</updated>
<author>
<name>Alan Maguire</name>
<email>alan.maguire@oracle.com</email>
</author>
<published>2020-03-26T14:25:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eda8e324f70815e90360bef1032d49ef7c61e877'/>
<id>urn:sha1:eda8e324f70815e90360bef1032d49ef7c61e877</id>
<content type='text'>
the logging test ensures multiple strings logged appear in the
log string associated with the test when CONFIG_KUNIT_DEBUGFS is
enabled.

Signed-off-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Reviewed-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: add debugfs /sys/kernel/debug/kunit/&lt;suite&gt;/results display</title>
<updated>2020-03-26T20:07:18Z</updated>
<author>
<name>Alan Maguire</name>
<email>alan.maguire@oracle.com</email>
</author>
<published>2020-03-26T14:25:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e2219db280e3fe52e5cc242e4225dd2685af3c56'/>
<id>urn:sha1:e2219db280e3fe52e5cc242e4225dd2685af3c56</id>
<content type='text'>
add debugfs support for displaying kunit test suite results; this is
especially useful for module-loaded tests to allow disentangling of
test result display from other dmesg events.  debugfs support is
provided if CONFIG_KUNIT_DEBUGFS=y.

As well as printk()ing messages, we append them to a per-test log.

Signed-off-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Reviewed-by: Frank Rowand &lt;frank.rowand@sony.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: Always print actual pointer values in asserts</title>
<updated>2020-03-25T18:12:33Z</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2019-11-21T23:50:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2d68df6cc4bf5822d78cd0f067174d6e29a2f739'/>
<id>urn:sha1:2d68df6cc4bf5822d78cd0f067174d6e29a2f739</id>
<content type='text'>
KUnit assertions and expectations will print the values being tested. If
these are pointers (e.g., KUNIT_EXPECT_PTR_EQ(test, a, b)), these
pointers are currently printed with the %pK format specifier, which -- to
prevent information leaks which may compromise, e.g., ASLR -- are often
either hashed or replaced with ____ptrval____ or similar, making debugging
tests difficult.

By replacing %pK with %px as Documentation/core-api/printk-formats.rst
suggests, we disable this security feature for KUnit assertions and
expectations, allowing the actual pointer values to be printed. Given
that KUnit is not intended for use in production kernels, and the
pointers are only printed on failing tests, this seems like a worthwhile
tradeoff.

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: allow kunit to be loaded as a module</title>
<updated>2020-01-09T23:43:40Z</updated>
<author>
<name>Alan Maguire</name>
<email>alan.maguire@oracle.com</email>
</author>
<published>2020-01-06T22:28:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9fe124bf1b7788058ecfe5778fea1660b01e3e9c'/>
<id>urn:sha1:9fe124bf1b7788058ecfe5778fea1660b01e3e9c</id>
<content type='text'>
Making kunit itself buildable as a module allows for "always-on"
kunit configuration; specifying CONFIG_KUNIT=m means the module
is built but only used when loaded.  Kunit test modules will load
kunit.ko as an implicit dependency, so simply running
"modprobe my-kunit-tests" will load the tests along with the kunit
module and run them.

Co-developed-by: Knut Omang &lt;knut.omang@oracle.com&gt;
Signed-off-by: Knut Omang &lt;knut.omang@oracle.com&gt;
Signed-off-by: Alan Maguire &lt;alan.maguire@oracle.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: remove timeout dependence on sysctl_hung_task_timeout_seconds</title>
<updated>2020-01-09T23:42:55Z</updated>
<author>
<name>Alan Maguire</name>
<email>alan.maguire@oracle.com</email>
</author>
<published>2020-01-06T22:28:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1c024d45151b51c8f8d4749e65958b0bcf3e7c52'/>
<id>urn:sha1:1c024d45151b51c8f8d4749e65958b0bcf3e7c52</id>
<content type='text'>
In discussion of how to handle timeouts, it was noted that if
sysctl_hung_task_timeout_seconds is exceeded for a kunit test,
the test task will be killed and an oops generated.  This should
suffice as a means of debugging such timeout issues for now.

Hence remove use of sysctl_hung_task_timeout_secs, which has the
added benefit of avoiding the need to export that symbol from
the core kernel.

Co-developed-by: Knut Omang &lt;knut.omang@oracle.com&gt;
Signed-off-by: Knut Omang &lt;knut.omang@oracle.com&gt;
Signed-off-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Acked-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: allow kunit tests to be loaded as a module</title>
<updated>2020-01-09T23:42:29Z</updated>
<author>
<name>Alan Maguire</name>
<email>alan.maguire@oracle.com</email>
</author>
<published>2020-01-06T22:28:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c475c77d5b56398303e726969e81208196b3aab3'/>
<id>urn:sha1:c475c77d5b56398303e726969e81208196b3aab3</id>
<content type='text'>
As tests are added to kunit, it will become less feasible to execute
all built tests together.  By supporting modular tests we provide
a simple way to do selective execution on a running system; specifying

CONFIG_KUNIT=y
CONFIG_KUNIT_EXAMPLE_TEST=m

...means we can simply "insmod example-test.ko" to run the tests.

To achieve this we need to do the following:

o export the required symbols in kunit
o string-stream tests utilize non-exported symbols so for now we skip
  building them when CONFIG_KUNIT_TEST=m.
o drivers/base/power/qos-test.c contains a few unexported interface
  references, namely freq_qos_read_value() and freq_constraints_init().
  Both of these could be potentially defined as static inline functions
  in include/linux/pm_qos.h, but for now we simply avoid supporting
  module build for that test suite.
o support a new way of declaring test suites.  Because a module cannot
  do multiple late_initcall()s, we provide a kunit_test_suites() macro
  to declare multiple suites within the same module at once.
o some test module names would have been too general ("test-test"
  and "example-test" for kunit tests, "inode-test" for ext4 tests);
  rename these as appropriate ("kunit-test", "kunit-example-test"
  and "ext4-inode-test" respectively).

Also define kunit_test_suite() via kunit_test_suites()
as callers in other trees may need the old definition.

Co-developed-by: Knut Omang &lt;knut.omang@oracle.com&gt;
Signed-off-by: Knut Omang &lt;knut.omang@oracle.com&gt;
Signed-off-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Acked-by: Theodore Ts'o &lt;tytso@mit.edu&gt; # for ext4 bits
Acked-by: David Gow &lt;davidgow@google.com&gt; # For list-test
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
</feed>
