From ef7559bad92310f2002f6815a161f422eb39f7bb Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Thu, 17 Feb 2022 23:02:38 +0100 Subject: [PATCH] Print output of verity test if concurrent check fails. This tests randomly fails in CI, at least print output if this happens. --- tests/verity-compat-test | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/verity-compat-test b/tests/verity-compat-test index 38b0e97a..351c06e0 100755 --- a/tests/verity-compat-test +++ b/tests/verity-compat-test @@ -418,12 +418,13 @@ function check_concurrent() # $1 hash # Then do two concurrent opens, and check that libdevmapper did not return -EINVAL, which is # not gracefully recoverable. Either could fail depending on scheduling, so just check that # the libdevmapper error does not appear in either of the outputs. - exec {out_1}< <($VERITYSETUP create -v $DEV_NAME $DEV_PARAMS $1 2>&1) - exec {out_2}< <($VERITYSETUP create -v $DEV_NAME $DEV_PARAMS $1 2>&1) + cat /dev/null >$DEV_OUT + $VERITYSETUP create -v $DEV_NAME $DEV_PARAMS $1 >>$DEV_OUT 2>&1 & + $VERITYSETUP create -v $DEV_NAME $DEV_PARAMS $1 >>$DEV_OUT 2>&1 & wait - cat <&${out_1} | grep -q "Command failed with code .* (wrong or missing parameters)" && fail - cat <&${out_2} | grep -q "Command failed with code .* (wrong or missing parameters)" && fail + grep -q "Command failed with code .* (wrong or missing parameters)" $DEV_OUT && fail check_exists + rm $DEV_OUT $VERITYSETUP close $DEV_NAME >/dev/null 2>&1 || fail echo "[OK]"