Skip to content
Snippets Groups Projects

Backport v2022 <- v2023: Wait for AUM log before continue testing

Merged Walter Lozano requested to merge apertis/v2024dev1 into apertis/v2022
All threads resolved!
1 file
+ 26
0
Compare changes
  • Side-by-side
  • Inline
+ 26
0
@@ -124,6 +124,32 @@ apply_update_sync()
# and if the handler quits, AUM reboots. And if AUM reboots, LAVA timeouts.
nohup updatectl --register-upgrade-handler & UPGRADEHANDLERPID=$!
# Wait for the "Starting Apertis update manager" log to appear before continuing
# or timeout
AUM_RESTARTED=0
for i in $(seq 0 5); do
sleep 5
if journalctl --after-cursor "${CURSOR}" --unit apertis-update-manager | grep -qE "Starting Apertis update manager" ; then
AUM_RESTARTED=1
break
fi
done
if [ "$AUM_RESTARTED" = 0 ] ; then
echo "AUM did not restart"
RESULT=99
# kill the upgrade handler
# Requires update-manager 0.1812.1 to avoid reboot when
# the handler disconnects
kill $UPGRADEHANDLERPID
# Terminate journal logging
kill $JOURNALPID
# Do not use exit in functions because it prevents lava to terminate
return $RESULT
fi
# Update the cursor to catch events after restart
CURSOR="$(journalctl --show-cursor --unit apertis-update-manager -n 0 -o cat)"
CURSOR="${CURSOR#-- cursor: }"
Loading