public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/6] C API: .needs_cmds and SAFE_RUN_CMD()
@ 2020-03-27 21:39 Petr Vorel
  2020-03-27 21:39 ` [LTP] [PATCH 1/6] lib: Implement .needs_cmds Petr Vorel
                   ` (6 more replies)
  0 siblings, 7 replies; 30+ messages in thread
From: Petr Vorel @ 2020-03-27 21:39 UTC (permalink / raw)
  To: ltp

Hi,

I implemented .needs_cmds + SAFE_RUN_CMD().

I also checked for command in path in tst_run_cmd_fds_() as suggested by
Cyril + added possibility to TCONF when program not found. This leaded
to more verbose changes. + There is a double check (first in
.needs_cmds, then in SAFE_RUN_CMD()), maybe that's not needed.

Also this change is not used in copy_file_range02.c, because it does not
require these commands. Is it worth to reduce code it'd be good to separate
file into two, put common functions in header and tests with
fd_immutable and fd_swapfile into new test?

Petr Vorel (6):
  lib: Implement .needs_cmds
  Use .needs_cmds
  lib/tst_run_cmd_*(): Turn int pass_exit_val into enum
  lib/tst_run_cmd_*(): Search for program in $PATH
  lib: Implement SAFE_RUN_CMD() macro (new API only)
  Use SAFE_RUN_CMD()

 doc/test-writing-guidelines.txt               | 29 +++++++++++---
 include/tst_cmd.h                             | 39 +++++++++++--------
 include/tst_safe_macros.h                     | 20 ++++++++++
 include/tst_test.h                            |  3 ++
 lib/tst_kernel.c                              |  3 +-
 lib/tst_mkfs.c                                |  3 +-
 lib/tst_module.c                              |  3 +-
 lib/tst_run_cmd.c                             | 28 ++++++++-----
 lib/tst_test.c                                | 11 ++++++
 testcases/kernel/input/input_helper.c         |  4 +-
 testcases/kernel/syscalls/acct/acct02.c       |  2 +-
 testcases/kernel/syscalls/add_key/add_key05.c | 24 +++++-------
 .../copy_file_range/copy_file_range02.c       |  2 +-
 .../kernel/syscalls/quotactl/quotactl01.c     | 18 +++------
 .../kernel/syscalls/quotactl/quotactl06.c     | 16 +++-----
 .../syscalls/setpriority/setpriority01.c      |  5 ++-
 testcases/network/netstress/netstress.c       |  2 +-
 17 files changed, 134 insertions(+), 78 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2020-03-30 12:37 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-27 21:39 [LTP] [PATCH 0/6] C API: .needs_cmds and SAFE_RUN_CMD() Petr Vorel
2020-03-27 21:39 ` [LTP] [PATCH 1/6] lib: Implement .needs_cmds Petr Vorel
2020-03-30  6:13   ` Li Wang
2020-03-30  7:03     ` Petr Vorel
2020-03-30 11:31       ` Cyril Hrubis
2020-03-27 21:39 ` [LTP] [PATCH 2/6] Use .needs_cmds Petr Vorel
2020-03-30 11:31   ` Cyril Hrubis
2020-03-30 11:48     ` Petr Vorel
2020-03-30 11:57       ` Li Wang
2020-03-30 12:17         ` Petr Vorel
2020-03-30 12:37         ` Petr Vorel
2020-03-27 21:39 ` [LTP] [PATCH 3/6] lib/tst_run_cmd_*(): Turn int pass_exit_val into enum Petr Vorel
2020-03-30 11:38   ` Cyril Hrubis
2020-03-30 11:40     ` Petr Vorel
2020-03-27 21:39 ` [LTP] [PATCH 4/6] lib/tst_run_cmd_*(): Search for program in $PATH Petr Vorel
2020-03-30 11:40   ` Cyril Hrubis
2020-03-30 11:52     ` Petr Vorel
2020-03-30 11:53       ` Cyril Hrubis
2020-03-27 21:39 ` [LTP] [PATCH 5/6] lib: Implement SAFE_RUN_CMD() macro (new API only) Petr Vorel
2020-03-30  6:35   ` Li Wang
2020-03-30  8:44     ` Petr Vorel
2020-03-27 21:39 ` [LTP] [PATCH 6/6] Use SAFE_RUN_CMD() Petr Vorel
2020-03-28  2:41 ` [LTP] [PATCH 0/6] C API: .needs_cmds and SAFE_RUN_CMD() Xiao Yang
2020-03-28  3:42   ` Petr Vorel
2020-03-29  5:29     ` Xiao Yang
2020-03-30  4:39       ` Li Wang
2020-03-30  5:20         ` Xiao Yang
2020-03-30  7:12           ` Petr Vorel
2020-03-30  7:43             ` Xiao Yang
2020-03-30  4:24     ` Li Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox