Cirrus: Simplify evil-unit check in image
@@ -36,10 +36,12 @@ do
"$(systemctl list-unit-files --no-legend $REQ_UNIT)" = "$REQ_UNIT enabled" || let "RET+=1"
done
+for evil_unit in $EVIL_UNITS
+do
# 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"
+ 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
