[XEN PATCH 3/9] CI: Fix status check for tools/tests

Anthony PERARD posted 9 patches 4 months, 4 weeks ago
There is a newer version of this series
[XEN PATCH 3/9] CI: Fix status check for tools/tests
Posted by Anthony PERARD 4 months, 4 weeks ago
From: Anthony PERARD <anthony.perard@vates.tech>

Without "pipefail", $? have the exit value of `tee`, which should
always be 0. But instead of using "pipefail", do collect the value of
from the test with $PIPESTATUS.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
---

Notes:
    Without the next patch "CI: Ignore run-tools-test return value", this
    just mean that if one test fail, the script `qubes-x86-64.sh` will
    detect a ERROR-Timeout because the expected string is never printed.

 automation/scripts/run-tools-tests | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/run-tools-tests b/automation/scripts/run-tools-tests
index 2bca1589db..695ed77e46 100755
--- a/automation/scripts/run-tools-tests
+++ b/automation/scripts/run-tools-tests
@@ -20,7 +20,7 @@ for f in "$1"/*; do
     echo "Running $f"
     printf '  <testcase name="%s">\n' "$f" >> "$xml_out"
     "$f" 2>&1 | tee /tmp/out
-    ret=$?
+    ret=${PIPESTATUS[0]}
     if [ "$ret" -ne 0 ]; then
         echo "FAILED: $f"
         failed+=" $f"
-- 
Anthony PERARD
Re: [XEN PATCH 3/9] CI: Fix status check for tools/tests
Posted by Andrew Cooper 4 months, 4 weeks ago
On 03/06/2025 1:42 pm, Anthony PERARD wrote:
> From: Anthony PERARD <anthony.perard@vates.tech>
>
> Without "pipefail", $? have the exit value of `tee`, which should
> always be 0. But instead of using "pipefail", do collect the value of
> from the test with $PIPESTATUS.
>
> Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Re: [XEN PATCH 3/9] CI: Fix status check for tools/tests
Posted by Stefano Stabellini 4 months, 4 weeks ago
On Tue, 3 Jun 2025, Andrew Cooper wrote:
> On 03/06/2025 1:42 pm, Anthony PERARD wrote:
> > From: Anthony PERARD <anthony.perard@vates.tech>
> >
> > Without "pipefail", $? have the exit value of `tee`, which should
> > always be 0. But instead of using "pipefail", do collect the value of
> > from the test with $PIPESTATUS.
> >
> > Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>