On Tue, 26 May 2020, Emanuele Giuseppe Esposito wrote:
> Add kunit tests to extensively test the stats_fs API functionality.
>
I've added in the kunit-related folks.
> In order to run them, the kernel .config must set CONFIG_KUNIT=y
> and a new .kunitconfig file must be created with CONFIG_STATS_FS=y
> and CONFIG_STATS_FS_TEST=y
>
It looks like CONFIG_STATS_FS is built-in, but it exports
much of the functionality you are testing. However could the
tests also be built as a module (i.e. make CONFIG_STATS_FS_TEST
a tristate variable)? To test this you'd need to specify
CONFIG_KUNIT=m and CONFIG_STATS_FS_TEST=m, and testing would
simply be a case of "modprobe"ing the stats fs module and collecting
results in /sys/kernel/debug/kunit/<module_name> (rather
than running kunit.py). Are you relying on unexported internals in
the the tests that would prevent building them as a module?
Thanks!
Alan
Hi, Andrii!
>>>>> On Tue, 26 May 2020 15:32:10 -0700, Andrii Nakryiko wrote:
> On Thu, May 21, 2020 at 11:41 PM Yauheni Kaliuta
> <yauheni.kaliuta(a)redhat.com> wrote:
>>
>>
>> Actually, a bit more needed :)
> From the other kselftest thread, it seems like selftests are not
> supporting builds out-of-tree. With that, wouldn't it be simpler to
> build in tree and then just copy selftests/bpf directory to wherever
> you need to run tests from? It would be simple and reliable. Given I
> and probably everyone else never build and run tests out-of-tree, it's
> just too easy to break this and you'll be constantly chasing some
> non-obvious breakages...
> Is there some problem with such approach?
This is `make install` ;).
I personally do not need OOT build, but since it's in the code,
I'd prefer either fix it or remove it, otherwise it's
misleading. But I have not got reply from kselftest.
>>
>> >>>>> On Fri, 22 May 2020 07:13:02 +0300, Yauheni Kaliuta wrote:
>>
>> > I had a look, here are some fixes.
>> > Yauheni Kaliuta (8):
>> > selftests/bpf: remove test_align from Makefile
>> > selftests/bpf: build bench.o for any $(OUTPUT)
>> > selftests/bpf: install btf .c files
>> > selftests/bpf: fix object files installation
>> > selftests/bpf: add output dir to include list
>> > selftests/bpf: fix urandom_read installation
>> > selftests/bpf: fix test.h placing for out of tree build
>> > selftests/bpf: factor out MKDIR rule
>>
>> > tools/testing/selftests/bpf/Makefile | 77 ++++++++++++++++++++--------
>> > 1 file changed, 55 insertions(+), 22 deletions(-)
>>
>> > --
>> > 2.26.2
>>
>>
>> --
>> WBR,
>> Yauheni Kaliuta
>>
--
WBR,
Yauheni Kaliuta
Hi, all.
I met a strange problem that kunit run 0 tests in Debian9.
Env:
```
root@lkp-hsw-ep4 ~/linus# head /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
root@lkp-hsw-ep4 ~/linus# uname -r
5.6.0
```
Reproduce: Just run `./tools/testing/kunit/kunit.py run --defconfig`
```
root@lkp-hsw-ep4 ~/linus# ./tools/testing/kunit/kunit.py run --defconfig
[13:41:30] Building KUnit Kernel ...
[13:41:33] Starting KUnit Kernel ...
[13:41:33] ============================================================
[13:41:33] Testing complete. 0 tests run. 0 failed. 0 crashed.
[13:41:33] Elapsed time: 2.619s total, 0.002s configuring, 2.610s
building, 0.007s running
root@lkp-hsw-ep4 ~/linus# cat .kunitconfig
CONFIG_KUNIT=y
CONFIG_KUNIT_TEST=y
CONFIG_KUNIT_EXAMPLE_TEST=y
```
As doc said, looks like everything worked correctly. But kunit run 0 tests.
```
If everything worked correctly, you should see the following:
Generating .config ...
Building KUnit Kernel ...
Starting KUnit Kernel ...
```
--
Best regards.
Liu Yiding
To make KUnit easier to use, and to avoid overwriting object and
.config files, the default KUnit build directory is set to .kunit
* Related bug: https://bugzilla.kernel.org/show_bug.cgi?id=205221
Fixed up minor merge conflicts - Shuah Khan <skhan(a)linuxfoundation.org>
Signed-off-by: Vitor Massaru Iha <vitor(a)massaru.org>
Reviewed-by: Brendan Higgins <brendanhiggins(a)google.com>
Signed-off-by: Shuah Khan <skhan(a)linuxfoundation.org>
---
version after merge on kunit brach:
* fix identation (tabs instead of spaces)
---
tools/testing/kunit/kunit.py | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index b01838b6f5f9..b3490271a103 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -169,7 +169,7 @@ def add_common_opts(parser):
parser.add_argument('--build_dir',
help='As in the make command, it specifies the build '
'directory.',
- type=str, default='', metavar='build_dir')
+ type=str, default='.kunit', metavar='build_dir')
parser.add_argument('--make_options',
help='X=Y make option, can be repeated.',
action='append')
@@ -245,12 +245,11 @@ def main(argv, linux=None):
cli_args = parser.parse_args(argv)
if cli_args.subcommand == 'run':
- if cli_args.build_dir:
- if not os.path.exists(cli_args.build_dir):
- os.mkdir(cli_args.build_dir)
- kunit_kernel.kunitconfig_path = os.path.join(
- cli_args.build_dir,
- kunit_kernel.kunitconfig_path)
+ if not os.path.exists(cli_args.build_dir):
+ os.mkdir(cli_args.build_dir)
+ kunit_kernel.kunitconfig_path = os.path.join(
+ cli_args.build_dir,
+ kunit_kernel.kunitconfig_path)
if not linux:
linux = kunit_kernel.LinuxSourceTree()
--
2.26.2
On 5/19/20 8:49 AM, Yauheni Kaliuta wrote:
> Hi, shuah!
>
>>>>>> On Tue, 19 May 2020 07:59:16 -0600, shuah wrote:
>
> > On 5/15/20 6:00 AM, Yauheni Kaliuta wrote:
> >>
> >> Yauheni Kaliuta (3):
> >> selftests: do not use .ONESHELL
> >> selftests: fix condition in run_tests
> >> selftests: simplify run_tests
> >>
> >> tools/testing/selftests/lib.mk | 19 ++++++-------------
> >> 1 file changed, 6 insertions(+), 13 deletions(-)
> >>
>
> > Quick note that, I will pull these in for 5.8-rc1.
Patches look okay to me, however, just noticed, this series hasn't
been cc'ed to linux-kselftest. Hence it didn't go through the
necessary reviews.
Please run get_maintainers and resend the series to everybody the
script suggests.
thanks,
-- Shuah
Hi!
lib.mk expects TEST_GEN_PROGS, TEST_GEN_PROGS_EXTENDED and
TEST_GEN_FILES to be in local directory and tries to handle out
of tree build adding OUTPUT to it at the beginning.
commit be16a244c199 ("selftests: lib.mk: add TEST_CUSTOM_PROGS to
allow custom test run/install") adds TEST_CUSTOM_PROGS but it
handles it differently. Should it add OUTPUT as well?
--
WBR,
Yauheni Kaliuta
I hope you are doing great?
This is Felix from Toronto-Canada. I have a lucrative business
offer that will benefit us both immensely within a very short
period of time. However, I need your initial approval of interest
prior to further and complete details regarding the deal.
Thanks,
Felix.