From 58bf3de02cf555a16bd420d7603f2a10dbe9ea6a Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 10 Jun 2025 11:57:43 +0200 Subject: [PATCH] virt-aa-helper-test: Print errors to stderr MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When a test case fails, there are two echo-s executed: the first one either prints the error message into /dev/null (default) or onto stdout (when the test script is executed with -d). Then, the second one prints the error message onto stdout. While this technically works, there's nothing ever printed onto stderr which is usually what's captured. Worse, if some command within the script fails, it prints something onto stderr but then looking at meson logs it's needlessly hard to match stderr and stdout lines. Just print error messages onto stderr. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- tests/virt-aa-helper-test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/virt-aa-helper-test b/tests/virt-aa-helper-test index 4c8d31c9d7..8259c2679f 100755 --- a/tests/virt-aa-helper-test +++ b/tests/virt-aa-helper-test @@ -116,7 +116,7 @@ testme() { input="$4" if [ ! -e "$input" ]; then echo "FAIL: could not find $input" >$output - echo "FAIL: could not find $input" + echo "FAIL: could not find $input" >&2 echo " '$extra_args $args': " errors=$(($errors + 1)) fi @@ -141,6 +141,7 @@ testme() { if [ -n "$checkrule" ]; then if ! grep "$checkrule" "$tmpout" >/dev/null; then echo "FAIL: missing rule '$checkrule'" >"$output" + echo "FAIL: missing rule '$checkrule'" >&2 rule_missing=1 fi fi -- 2.47.3