[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <201910301216.5C3F9BA010@keescook>
Date: Wed, 30 Oct 2019 12:16:39 -0700
From: Kees Cook <keescook@...omium.org>
To: Naresh Kamboju <naresh.kamboju@...aro.org>
Cc: "Tobin C. Harding" <tobin@...nel.org>,
Shuah Khan <shuah@...nel.org>, Jann Horn <jannh@...gle.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Randy Dunlap <rdunlap@...radead.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Andy Lutomirski <luto@...capital.net>,
Daniel Micay <danielmicay@...il.com>,
Arnd Bergmann <arnd@...db.de>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
kernel-hardening@...ts.openwall.com,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 2/6] kselftest: Add test runner creation script
On Wed, Oct 30, 2019 at 06:15:22PM +0530, Naresh Kamboju wrote:
> Hi Tobin,
>
> On Fri, 5 Apr 2019 at 07:30, Tobin C. Harding <tobin@...nel.org> wrote:
> >
> > Currently if we wish to use kselftest to run tests within a kernel
> > module we write a small script to load/unload and do error reporting.
> > There are a bunch of these under tools/testing/selftests/lib/ that are
> > all identical except for the test name. We can reduce code duplication
> > and improve maintainability if we have one version of this. However
> > kselftest requires an executable for each test. We can move all the
> > script logic to a central script then have each individual test script
> > call the main script.
> >
> > Oneliner to call kselftest_module.sh courtesy of Kees, thanks!
> >
> > Add test runner creation script. Convert
> > tools/testing/selftests/lib/*.sh to use new test creation script.
> >
> > Testing
> > -------
> >
> > Configure kselftests for lib/ then build and boot kernel. Then run
> > kselftests as follows:
> >
> > $ cd /path/to/kernel/tree
> > $ sudo make O=$output_path -C tools/testing/selftests TARGETS="lib" run_tests
>
> We are missing "kselftest_module.sh" file when we do "make install"
> and followed by generating a tar file "gen_kselftest_tar.sh" and
> copying that on to target device and running tests by using
> "run_kselftest.sh" script file on the target.
Yikes -- there's a problem with gen_kselftest_tar.sh using the wrong
directory. I'll send a patch...
-Kees
>
> Could you install the supporting script file "kselftest_module.sh" ?
>
> Error log,
> -------------
> # selftests lib printf.sh
> lib: printf.sh_ #
> # ./printf.sh line 4 ./../kselftest_module.sh No such file or directory
> line: 4_./../kselftest_module.sh #
> [FAIL] 1 selftests lib printf.sh # exit=127
> selftests: lib_printf.sh [FAIL]
> # selftests lib bitmap.sh
> lib: bitmap.sh_ #
> # ./bitmap.sh line 3 ./../kselftest_module.sh No such file or directory
> line: 3_./../kselftest_module.sh #
> [FAIL] 2 selftests lib bitmap.sh # exit=127
> selftests: lib_bitmap.sh [FAIL]
> # selftests lib prime_numbers.sh
> lib: prime_numbers.sh_ #
> # ./prime_numbers.sh line 4 ./../kselftest_module.sh No such file or directory
> line: 4_./../kselftest_module.sh #
> [FAIL] 3 selftests lib prime_numbers.sh # exit=127
> selftests: lib_prime_numbers.sh [FAIL]
> # selftests lib strscpy.sh
> lib: strscpy.sh_ #
> # ./strscpy.sh line 3 ./../kselftest_module.sh No such file or directory
> line: 3_./../kselftest_module.sh #
> [FAIL] 4 selftests lib strscpy.sh # exit=127
> selftests: lib_strscpy.sh [FAIL]
>
> - Naresh
--
Kees Cook
Powered by blists - more mailing lists