Message ID | b989bb17303518eb149064a6aaaa1c37d2b703c4.1633520807.git.cdleonard@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | selftests: Improve nettest and net/fcnal-test.sh | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Series has a cover letter |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Guessed tree name to be net-next |
netdev/subject_prefix | warning | Target tree name not specified in the subject |
netdev/cc_maintainers | success | CCed 5 of 5 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | No Fixes tag |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 24 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | No static functions without inline keyword in header files |
On 10/6/21 5:47 AM, Leonard Crestez wrote: > This way running with -v will show interspersed output from both nettest > client and server. This helps to identify the order of events. > > It is also required in order to make nettest fork in the background by > itself because shell capturing does not stop if the target forks. > > This also fixes SC2166 warning: > Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. > > Signed-off-by: Leonard Crestez <cdleonard@gmail.com> > --- > tools/testing/selftests/net/fcnal-test.sh | 16 +++++++--------- > 1 file changed, 7 insertions(+), 9 deletions(-) > Reviewed-by: David Ahern <dsahern@kernel.org>
diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh index b7fda51deb3f..09cb35e16219 100755 --- a/tools/testing/selftests/net/fcnal-test.sh +++ b/tools/testing/selftests/net/fcnal-test.sh @@ -189,21 +189,19 @@ kill_procs() done } do_run_cmd() { - local cmd="$*" - local out + local rc cmd="$*" - if [ "$VERBOSE" = "1" ]; then + if [[ "$VERBOSE" = "1" ]]; then echo "COMMAND: ${cmd}" - fi - - out=$($cmd 2>&1) - rc=$? - if [ "$VERBOSE" = "1" -a -n "$out" ]; then - echo "$out" + $cmd + rc=$? + else + $cmd &> /dev/null + rc=$? fi return $rc }
This way running with -v will show interspersed output from both nettest client and server. This helps to identify the order of events. It is also required in order to make nettest fork in the background by itself because shell capturing does not stop if the target forks. This also fixes SC2166 warning: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. Signed-off-by: Leonard Crestez <cdleonard@gmail.com> --- tools/testing/selftests/net/fcnal-test.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)