autopkgtests: check status in a more robust manner

Rather than checking for the absence of maintenance_mode?: true, check
for the presence of maintenance_mode?: false, which is more robust. Also
discard jq's stdout/stderr when doing the status check, since we don't
care about it.
parent 61579676
......@@ -20,7 +20,7 @@ get_status () {
}
check_status_var () {
get_status | jq -e ".status[\"$1\"] == $2"
get_status | jq -e ".status[\"$1\"] == $2" >/dev/null 2>&1
}
query () {
......@@ -43,12 +43,12 @@ wait_for_pdb() {
fi
;;
starting)
if check_status_var maintenance_mode? true >/dev/null; then
echo "Still in maintenance mode"
sleep 1
else
if check_status_var "maintenance_mode?" "false"; then
echo "Maintenance mode disabled"
break
else
echo "Still in maintenance mode"
sleep 1
fi
;;
esac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment