Skip to content

Commit

Permalink
Ensure sync before shutdown in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Dec 5, 2024
1 parent f4a3641 commit 17148d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/image.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ imageFile() {
mkdir -p tests/{fs,kernel,dtb}
mount -o rw -t ext4 "/dev/mapper/${loopPrefix}p2" "tests/fs"
mount -o rw -t vfat "/dev/mapper/${loopPrefix}p1" "tests/fs/boot"
sync
elif [[ $1 == "umount" ]]; then
sync
umount tests/fs/boot
Expand Down
4 changes: 3 additions & 1 deletion tests/run.exp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ expect {
exp_continue
}
"pi@raspberrypi:~$ " {
send "sudo shutdown -h now\r"
send "sync\r"
}
expect "pi@raspberrypi:~$ "
send "sudo shutdown -h 5s\r"
}

exit $retval
2 changes: 1 addition & 1 deletion uninstall.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if ! [[ -f /usr/local/sbin/zram-config || -f /usr/sbin/zram-config ]]; then
fi

zram-config "stop"
tar -czvf "${BASEDIR}/logs.tar.gz" -C /usr/local/share/zram-config/log .
tar -czf "${BASEDIR}/logs.tar.gz" -C /usr/local/share/zram-config/log .
if [[ $OS == "alpine" ]]; then
rc-service zram-config stop
rc-update del zram-config boot
Expand Down

0 comments on commit 17148d7

Please sign in to comment.