ci: fix test on /exitstatus existence and size

The condition for the test is incorrect, we want to add a default exit
status if the file is empty. But [[ -s file ]] returns true if the file
exists and has a size greater than zero. Let's reverse the condition.

Fixes: 385b2d1738 ("ci: change VM's /exitstatus format to prepare it for several results")
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
This commit is contained in:
Quentin Monnet
2021-12-01 20:59:48 +00:00
committed by Andrii Nakryiko
parent 690d0531f9
commit 4884bf3dbd

View File

@@ -480,7 +480,7 @@ ${setup_cmd}; exitstatus=\$?
echo -e '$(travis_fold start collect_status "Collect status")'
set -e
# If setup command did not write its exit status to /exitstatus, do it now
if [[ -s /exitstatus ]]; then
if [[ ! -s /exitstatus ]]; then
echo setup_cmd:\$exitstatus > /exitstatus
fi
chmod 644 /exitstatus