mbox series

[v4,0/6] lib/string: Add strscpy_pad() function

Message ID 20190405015859.32755-1-tobin@kernel.org (mailing list archive)
Headers show
Series lib/string: Add strscpy_pad() function | expand

Message

Tobin C. Harding April 5, 2019, 1:58 a.m. UTC
Hi Shua,

Here is the set with cleanup as suggested by Kees on v3.

Configured, built, and tested all modules loaded by
tools/testing/selftests/lib/*.sh

From previous cover letters ...

While doing the testing for strscpy_pad() it was noticed that there is
duplication in how test modules are being fed to kselftest and also in
the test modules themselves.

This set makes an attempt at adding a framework to kselftest for writing
kernel test modules.  It also adds a script for use in creating script
test runners for kselftest.  My macro-foo is not great, all criticism
and suggestions very much appreciated.  The design is based on test
modules lib/test_printf.c, lib/test_bitmap.c, lib/test_xarray.c.

Changes since last version:

 - Remove dependency on Bash (thanks Kees)
 - Use oneliner to implement kselftest test runners (thanks Kees)
 - Squash patch that adds kselftest script creator script with patch
   that uses it. 
 - Fix typos (thanks Randy)
 - Add Kees' Acked-by tags to all patches

thanks,
Tobin.


Tobin C. Harding (6):
  lib/test_printf: Add empty module_exit function
  kselftest: Add test runner creation script
  kselftest: Add test module framework header
  lib: Use new kselftest header
  lib/string: Add strscpy_pad() function
  lib: Add test module for strscpy_pad

 Documentation/dev-tools/kselftest.rst        |  94 +++++++++++-
 include/linux/string.h                       |   4 +
 lib/Kconfig.debug                            |   3 +
 lib/Makefile                                 |   1 +
 lib/string.c                                 |  47 +++++-
 lib/test_bitmap.c                            |  20 +--
 lib/test_printf.c                            |  17 +--
 lib/test_strscpy.c                           | 150 +++++++++++++++++++
 tools/testing/selftests/kselftest_module.h   |  48 ++++++
 tools/testing/selftests/kselftest_module.sh  |  84 +++++++++++
 tools/testing/selftests/lib/Makefile         |   2 +-
 tools/testing/selftests/lib/bitmap.sh        |  18 +--
 tools/testing/selftests/lib/config           |   1 +
 tools/testing/selftests/lib/prime_numbers.sh |  17 +--
 tools/testing/selftests/lib/printf.sh        |  19 +--
 tools/testing/selftests/lib/strscpy.sh       |   3 +
 16 files changed, 440 insertions(+), 88 deletions(-)
 create mode 100644 lib/test_strscpy.c
 create mode 100644 tools/testing/selftests/kselftest_module.h
 create mode 100755 tools/testing/selftests/kselftest_module.sh
 create mode 100755 tools/testing/selftests/lib/strscpy.sh

Comments

Tobin Harding April 7, 2019, 9:45 p.m. UTC | #1
On Fri, Apr 05, 2019 at 12:58:53PM +1100, Tobin C. Harding wrote:
> Hi Shua,

Apologies for continually leaving off the 'h' from your name Shuah.


	Tobin
Shuah April 8, 2019, 2:08 p.m. UTC | #2
On 4/4/19 7:58 PM, Tobin C. Harding wrote:
> Hi Shua,
> 
> Here is the set with cleanup as suggested by Kees on v3.
> 
> Configured, built, and tested all modules loaded by
> tools/testing/selftests/lib/*.sh
> 
>>From previous cover letters ...
> 
> While doing the testing for strscpy_pad() it was noticed that there is
> duplication in how test modules are being fed to kselftest and also in
> the test modules themselves.
> 
> This set makes an attempt at adding a framework to kselftest for writing
> kernel test modules.  It also adds a script for use in creating script
> test runners for kselftest.  My macro-foo is not great, all criticism
> and suggestions very much appreciated.  The design is based on test
> modules lib/test_printf.c, lib/test_bitmap.c, lib/test_xarray.c.
> 
> Changes since last version:
> 
>   - Remove dependency on Bash (thanks Kees)
>   - Use oneliner to implement kselftest test runners (thanks Kees)
>   - Squash patch that adds kselftest script creator script with patch
>     that uses it.
>   - Fix typos (thanks Randy)
>   - Add Kees' Acked-by tags to all patches
> 
> thanks,
> Tobin.
> 
> 

Hi Tobin,

Thanks for this restructuring work and adding the framework. Thanks Kees
for the reviews.

The patch is series in now in linux-kselftest next for 5.2

thanks,
-- Shuah
Kees Cook April 8, 2019, 2:59 p.m. UTC | #3
On Mon, Apr 8, 2019 at 7:09 AM shuah <shuah@kernel.org> wrote:
> The patch is series in now in linux-kselftest next for 5.2

Yay, awesome! :) Thanks!