Cirrus: Simplify evil-unit check in image

Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
Chris Evich 2019-07-24 11:01:49 -04:00
parent ceb3d76298
commit f55288c96f
No known key found for this signature in database
GPG Key ID: 03EDC70FD578067F
1 changed files with 6 additions and 4 deletions

View File

@ -36,10 +36,12 @@ do
"$(systemctl list-unit-files --no-legend $REQ_UNIT)" = "$REQ_UNIT enabled" || let "RET+=1"
done
# Exits zero if any unit matching pattern is running
UNIT_STATUS=$(systemctl is-active $EVIL_UNITS; echo $?)
item_test "No interfering background units are active:" \
"$UNIT_STATUS" -ne "0" || let "RET+=1"
for evil_unit in $EVIL_UNITS
do
# Exits zero if any unit matching pattern is running
unit_status=$(systemctl is-active $evil_unit &> /dev/null; echo $?)
item_test "No $evil_unit unit is present or active:" "$unit_status" -ne "0" || let "RET+=1"
done
echo "Total failed tests: $RET"
exit $RET