]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virt-aa-helper-test: Print errors to stderr
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 10 Jun 2025 09:57:43 +0000 (11:57 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 2 Jul 2025 11:54:07 +0000 (13:54 +0200)
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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/virt-aa-helper-test

index 4c8d31c9d7f5160dac1564f57b2e0189cf08c54e..8259c2679fbf6183342a7ce722994e6ef410bcae 100755 (executable)
@@ -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