Skip to content

Commit

Permalink
automated: linux: fix issues with static-delta OTA update
Browse files Browse the repository at this point in the history
When updating the device using static deltas, the test script has to
wait for aktualizr-lite to complete installation before rebooting.

When there is no static detla available, the test job should end as
incomplete.

This patch also changes how the aklite signal is checked to align with
other OTA testing scripts.

Signed-off-by: Milosz Wasilewski <[email protected]>
  • Loading branch information
mwasilew authored and roxell committed Jan 19, 2024
1 parent 2268a8f commit a125bec
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions automated/linux/ota-update/static-delta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ SIZE_SEARCH_STRING=".[].\"${CURRENT_OSTREE_SHA}\".u_size"
DELTA_SIZE=$(jq -r "${SIZE_SEARCH_STRING}" delta.json)
if [ -z "${DELTA_SIZE}" ] || [ "${DELTA_SIZE}" = "null" ]; then
error_msg "Size of static delta for update from ${CURRENT_OSTREE_SHA} not found"
exit 0;
exit 1;
fi

# check how much disk is free
Expand Down Expand Up @@ -151,24 +151,21 @@ done
if [ "${FILL_SIZE}" -gt 100 ]; then
# no OTA should be performed
# wait for 'install-post' signal
SIGNAL=$(</var/sota/ota.signal)
while [ ! "${SIGNAL}" = "install-post" ] && [ ! "${SIGNAL}" = "download-post" ]
while ! grep "install-post" /var/sota/ota.signal && ! grep "download-post" /var/sota/ota.signal
do
echo "Sleeping 1s"
sleep 1
cat /var/sota/ota.signal
SIGNAL=$(</var/sota/ota.signal)
echo "SIGNAL: ${SIGNAL}."
done
sleep 5
if [ "${SIGNAL}" = "download-post" ]; then

if grep "download-post" /var/sota/ota.signal; then
if (journalctl --no-pager -u aktualizr-lite | grep "Fetching ostree commit"); then
report_fail "full-disk-abort-download"
else
report_pass "full-disk-abort-download"
fi
fi
if [ "${SIGNAL}" = "install-post" ]; then
if grep "install-post" /var/sota/ota.signal; then
report_fail "full-disk-abort-download"
fi
else
Expand All @@ -192,6 +189,12 @@ else
report_pass "ota-static-delta-update"
fi
done
while ! grep "install-post" /var/sota/ota.signal
do
echo "Waiting 1s for aklite to complete installation"
sleep 1
cat /var/sota/ota.signal
done
fi
journalctl --no-pager -u aktualizr-lite
exit 0;

0 comments on commit a125bec

Please sign in to comment.