summaryrefslogtreecommitdiff
path: root/tools/testing/kunit/kunit_kernel.py
diff options
context:
space:
mode:
authorDaniel Latypov <dlatypov@google.com>2021-02-05 16:08:53 -0800
committerShuah Khan <skhan@linuxfoundation.org>2021-02-08 16:10:00 -0700
commitd992880b3d265597c5a16af3775257999492e957 (patch)
treedfa85051d80c44cbb6423a0a4fe454cdd95a0e16 /tools/testing/kunit/kunit_kernel.py
parent5d31f71efcb6bce56ca3ab92eed0c8f2dbcc6f9a (diff)
downloadlinux-d992880b3d265597c5a16af3775257999492e957.tar.gz
linux-d992880b3d265597c5a16af3775257999492e957.tar.bz2
linux-d992880b3d265597c5a16af3775257999492e957.zip
kunit: tool: add support for filtering suites by glob
This allows running different subsets of tests, e.g. $ ./tools/testing/kunit/kunit.py build $ ./tools/testing/kunit/kunit.py exec 'list*' $ ./tools/testing/kunit/kunit.py exec 'kunit*' This passes the "kunit_filter.glob" commandline option to the UML kernel, which currently only supports filtering by suite name. Signed-off-by: Daniel Latypov <dlatypov@google.com> Reviewed-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/kunit/kunit_kernel.py')
-rw-r--r--tools/testing/kunit/kunit_kernel.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
index 0b461663e7d9..71a5f5c1750b 100644
--- a/tools/testing/kunit/kunit_kernel.py
+++ b/tools/testing/kunit/kunit_kernel.py
@@ -203,8 +203,10 @@ class LinuxSourceTree(object):
return False
return self.validate_config(build_dir)
- def run_kernel(self, args=[], build_dir='', timeout=None) -> Iterator[str]:
+ def run_kernel(self, args=[], build_dir='', filter_glob='', timeout=None) -> Iterator[str]:
args.extend(['mem=1G', 'console=tty'])
+ if filter_glob:
+ args.append('kunit.filter_glob='+filter_glob)
self._ops.linux_bin(args, timeout, build_dir)
outfile = get_outfile_path(build_dir)
subprocess.call(['stty', 'sane'])