public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [RFC PATCH 1/1] tst_test.sh: Print tst_{res, brk} into stdout
@ 2020-06-19 19:25 Petr Vorel
  2020-06-20  5:55 ` Jan Stancek
  2020-06-22  8:53 ` Cyril Hrubis
  0 siblings, 2 replies; 5+ messages in thread
From: Petr Vorel @ 2020-06-19 19:25 UTC (permalink / raw)
  To: ltp

This allows printing messages on functions which output is redirected
into variable or used in eval. Also this change unifies the behavior
with C new API, which printed into stderr from the beginning.

Hope this change does not bring any regression.

Legacy API kept printing into stdout (legacy C API also prints to
stdout).

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,

some examples:

Before:
/opt/ltp/testcases/bin/tst_net.sh: line 885: 33mTCONF:: command not found
/opt/ltp/testcases/bin/tst_net.sh: eval: line 888: syntax error near unexpected token `('
/opt/ltp/testcases/bin/tst_net.sh: eval: line 888: `tst_rhost_run 1 TCONF: 'rsh' not found tst_rhost_run 1 TINFO: AppArmor enabled, this may affect test results tst_rhost_run 1 TINFO: it can be disabled with TST_DISABLE_APPARMOR=1 (requires super/root) tst_rhost_run 1 TINFO: loaded AppArmor profiles: none Summary: passed 0 failed 0 skipped 1 warnings 1'

With this patch:
tst_rhost_run 1 TCONF: 'rsh' not found
/opt/ltp/testcases/bin/tst_net.sh: line 885: Summary:: command not found
tst_rhost_run 1 TCONF: 'rsh' not found
/opt/ltp/testcases/bin/tst_net.sh: line 888: Summary:: command not found
tst_rhost_run 1 TINFO: Network config (local -- remote):
tst_rhost_run 1 TINFO: ltp_ns_veth2 --
tst_rhost_run 1 TINFO: 10.0.0.2/24 -- 10.0.0.1/24
tst_rhost_run 1 TINFO: fd00:1:1:1::2/64 -- fd00:1:1:1::1/64
tst_rhost_run 1 TCONF: 'rsh' not found
tst_rhost_run 1 TINFO: timeout per run is 0h 5m 0s
tst_rhost_run 1 TCONF: 'rsh' not found

Kind regards,
Petr

 testcases/lib/tst_test.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 1cf724cbe..2e637b25b 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) Linux Test Project, 2014-2019
+# Copyright (c) Linux Test Project, 2014-2020
 # Author: Cyril Hrubis <chrubis@suse.cz>
 #
 # LTP test library for shell.
@@ -102,9 +102,9 @@ tst_res()
 
 	_tst_inc_res "$res"
 
-	printf "$TST_ID $TST_COUNT "
-	tst_print_colored $res "$res: "
-	echo "$@"
+	printf "$TST_ID $TST_COUNT " >&2
+	tst_print_colored $res "$res: " >&2
+	echo "$@" >&2
 }
 
 tst_brk()
-- 
2.27.0


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

end of thread, other threads:[~2020-06-22 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-19 19:25 [LTP] [RFC PATCH 1/1] tst_test.sh: Print tst_{res, brk} into stdout Petr Vorel
2020-06-20  5:55 ` Jan Stancek
2020-06-20  9:12   ` Petr Vorel
2020-06-22  8:53 ` Cyril Hrubis
2020-06-22 14:31   ` Petr Vorel

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