Skip to content
Snippets Groups Projects

Backport v2024 <- v2025dev2: Fixes for power cut and out of space tests

Merged Walter Lozano requested to merge apertis/v2025dev2 into apertis/v2024
4 files
+ 38
24
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -14,14 +14,13 @@ phase_clean_previous_install()
phase_test_update_does_not_start_if_disk_too_low()
{
ostree admin status
# Ensure ostree does not prevent the update to start
ostree config set core.min-free-space-percent "5"
systemctl restart apertis-update-manager
# Compute remaining disk space from df output (Note that this does not use Available because there is in fact more space available that advertised)
local MAGIC=25
local DISKSPACE=$(busybox df -P -B 1M / | grep / | awk '{ print $2-$3-'$MAGIC' }')
ostree admin status
# Fill the disk
busybox dd if=/dev/zero of=/var/bigfile bs=1M count=$DISKSPACE
fill_disk
# Ensure the update did not apply
ret=0
@@ -40,7 +39,7 @@ phase_test_update_does_not_start_if_disk_too_low()
;;
esac
rm -f /var/bigfile
undo_fill_disk
}
phase_update_stops_safely_if_disk_too_low()
@@ -49,10 +48,7 @@ phase_update_stops_safely_if_disk_too_low()
ostree config set core.min-free-space-percent "0"
systemctl restart apertis-update-manager
# Fill the disk
local MAGIC=25
local DISKSPACE=$(busybox df -P -B 1M / | grep / | awk '{ print $2-$3-'$MAGIC' }')
busybox dd if=/dev/zero of=/var/bigfile bs=1M count=$DISKSPACE
fill_disk
# Ensure the update did not apply
ret=0
@@ -74,7 +70,8 @@ phase_update_stops_safely_if_disk_too_low()
# Ensure the reason was to distinguish from the first test
# Ostree upgrade failed: mkdir(boot/loader.0/entries): Input/output error
# Ostree upgrade failed: Error writing to file descriptor: No space left on device
rm -f /var/bigfile
undo_fill_disk
}
phase_check_update()
Loading