All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/3] kunit: add kunit.filter_glob cmdline option to filter suites
@ 2021-02-04  1:48 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-02-04  1:48 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2818 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210203234116.839819-2-dlatypov@google.com>
References: <20210203234116.839819-2-dlatypov@google.com>
TO: Daniel Latypov <dlatypov@google.com>
TO: brendanhiggins(a)google.com
TO: davidgow(a)google.com
CC: linux-kernel(a)vger.kernel.org
CC: linux-kselftest(a)vger.kernel.org
CC: skhan(a)linuxfoundation.org
CC: Daniel Latypov <dlatypov@google.com>

Hi Daniel,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on 88bb507a74ea7d75fa49edd421eaa710a7d80598]

url:    https://github.com/0day-ci/linux/commits/Daniel-Latypov/kunit-support-running-subsets-of-test-suites-from/20210204-074405
base:   88bb507a74ea7d75fa49edd421eaa710a7d80598
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago
config: x86_64-randconfig-m001-20210202 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
lib/kunit/executor.c:110 kunit_run_all_tests() error: double free of 'suite_set.start'

vim +110 lib/kunit/executor.c

45dcbb6f5ef78b Brendan Higgins 2020-08-04   95  
8c0d884986ba22 Brendan Higgins 2020-08-04   96  int kunit_run_all_tests(void)
aac35468ca20a3 Alan Maguire    2020-08-04   97  {
aac35468ca20a3 Alan Maguire    2020-08-04   98  	struct kunit_suite * const * const *suites;
aac35468ca20a3 Alan Maguire    2020-08-04   99  
d5554dd78a454b Daniel Latypov  2021-02-03  100  	struct suite_set suite_set = kunit_filter_suites();
45dcbb6f5ef78b Brendan Higgins 2020-08-04  101  
d5554dd78a454b Daniel Latypov  2021-02-03  102  	kunit_print_tap_header(&suite_set);
d5554dd78a454b Daniel Latypov  2021-02-03  103  
d5554dd78a454b Daniel Latypov  2021-02-03  104  	for (suites = suite_set.start; suites < suite_set.end; suites++)
aac35468ca20a3 Alan Maguire    2020-08-04  105  		__kunit_test_suites_init(*suites);
aac35468ca20a3 Alan Maguire    2020-08-04  106  
d5554dd78a454b Daniel Latypov  2021-02-03  107  	if (filter_glob) { /* a copy was made of each array */
d5554dd78a454b Daniel Latypov  2021-02-03  108  		for (suites = suite_set.start; suites < suite_set.end; suites++)
d5554dd78a454b Daniel Latypov  2021-02-03  109  			kfree(suites);
d5554dd78a454b Daniel Latypov  2021-02-03 @110  		kfree(suite_set.start);
d5554dd78a454b Daniel Latypov  2021-02-03  111  	}
d5554dd78a454b Daniel Latypov  2021-02-03  112  
aac35468ca20a3 Alan Maguire    2020-08-04  113  	return 0;
aac35468ca20a3 Alan Maguire    2020-08-04  114  }
aac35468ca20a3 Alan Maguire    2020-08-04  115  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33996 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH 0/3] kunit: support running subsets of test suites from
@ 2021-02-03 23:41 Daniel Latypov
  2021-02-03 23:41 ` [PATCH 1/3] kunit: add kunit.filter_glob cmdline option to filter suites Daniel Latypov
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Latypov @ 2021-02-03 23:41 UTC (permalink / raw)
  To: brendanhiggins, davidgow
  Cc: linux-kernel, linux-kselftest, skhan, Daniel Latypov

When using `kunit.py run` to run tests, users must populate a
`kunitconfig` file to select the options the tests are hidden behind and
all their dependencies.

The patch [1] to allow specifying a path to kunitconfig promises to make
this nicer as we can have checked in files corresponding to different
sets of tests.

But it's still annoying 
1) when trying to run a subet of tests
2) when you want to run tests that don't have such a pre-existing
kunitconfig and selecting all the necessary options is tricky.

This patch series aims to alleviate both:
1) `kunit.py run 'my-suite-*'`
I.e. use my current kunitconfig, but just run suites that match this glob
2) `kunit.py run --alltests 'my-suite-*'`
I.e. use allyesconfig so I don't have to worry about writing a
kunitconfig at all (this is a bit overkill, but it works!)

See the first commit message for more details and discussion about
future work.

This patch series also includes a bugfix for a latent bug that can't be
triggered right now but has worse consequences as a result of the
changes needed to plumb in this suite name glob.

[1] https://lore.kernel.org/linux-kselftest/20210201205514.3943096-1-dlatypov@google.com/

Daniel Latypov (3):
  kunit: add kunit.filter_glob cmdline option to filter suites
  kunit: tool: add support for filtering suites by glob
  kunit: tool: fix unintentional statefulness in run_kernel()

 lib/kunit/Kconfig                   |  1 +
 lib/kunit/executor.c                | 85 ++++++++++++++++++++++++++---
 tools/testing/kunit/kunit.py        | 21 +++++--
 tools/testing/kunit/kunit_kernel.py |  6 +-
 4 files changed, 99 insertions(+), 14 deletions(-)


base-commit: 88bb507a74ea7d75fa49edd421eaa710a7d80598
-- 
2.30.0.365.g02bc693789-goog


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-02-08 11:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-04  1:48 [PATCH 1/3] kunit: add kunit.filter_glob cmdline option to filter suites kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-02-03 23:41 [PATCH 0/3] kunit: support running subsets of test suites from Daniel Latypov
2021-02-03 23:41 ` [PATCH 1/3] kunit: add kunit.filter_glob cmdline option to filter suites Daniel Latypov
2021-02-04  7:11   ` Dan Carpenter
2021-02-04  7:11     ` Dan Carpenter
2021-02-04  7:11     ` Dan Carpenter
2021-02-04 17:30     ` Daniel Latypov
2021-02-04 17:30       ` Daniel Latypov
2021-02-08 11:12       ` Dan Carpenter
2021-02-08 11:12         ` Dan Carpenter
2021-02-08 11:12         ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.