Skip to content
Snippets Groups Projects
Commit 2ee9764b authored by Denis Pynkin's avatar Denis Pynkin
Browse files

Add test for Apertis update manager error conditions


Add test to check proper behavior in the following circumstances:
- Power cut during an update
- USB mass storage unplug during an update
- The disk is full during an update

Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
Signed-off-by: default avatarFrédéric Dalleau <frederic.dalleau@collabora.com>
parent 619f672b
No related branches found
No related tags found
No related merge requests found
metadata:
name: apertis-update-manager-diskfull
format: "Apertis Test Definition 1.0"
image-type: any
image-arch: armhf
type: functional
exec-type: manual
priority: medium
maintainer: "Apertis Project"
description: "Ensure that failures due to disk full errors during updates have no effect on the system"
resources:
- "A Fat32 USB flash drive, preloaded with an update bundle named static-update.bundle at the root of the disk"
- "The DUT u-boot environment must be clean: in u-boot, run: `env default -a` followed by `saveenv`"
- "A PC must be connected to DUT serial port"
expected:
- "The update wasn't applied"
- "System boots using the initial deployment"
run:
steps:
- "Check the current deployment"
- $ sudo ostree admin status
- "Need to monitor the journal log"
- $ sudo journalctl -ef --unit apertis-update-manager &
- "Check the free space on rootfs, calculate the size of file to leave only 3% of free space.
For instance, NUM=2604620 for case below -- just round to lesser value the result of calculation: 2716616-(3733136/100*3)"
- $ sudo df -B 512 /
- |
>Filesystem 512B-blocks Used Available Use% Mounted on
/dev/mmcblk0p2 3733136 790784 2716616 23% /
- $ sudo dd if=/dev/zero of=/var/bigfile bs=512 count=<NUM>
- "Plug the USB flash drive in the device"
- "The update should fail with some error message related to disk space, for instance:"
- |
>Dec 19 22:55:10 apertis apertis-update-[319]: Ostree upgrade failed: mkdir(boot/loader.0/entries): Input/output error
Dec 19 22:43:46 apertis apertis-update-[794]: Ostree upgrade failed: Error writing to file descriptor: No space left on device
- "Remove the USB flash drive"
- "Remove temporary file"
- $ sudo rm -f /var/bigfile
- "Fill the disk with root filesystem to 100%"
- $ sudo dd if=/dev/zero of=/var/bigfile bs=1M
- "Plug the USB flash drive in the device"
- "The update should fail with error message"
- |
>Dec 19 22:53:33 apertis apertis-update-[348]: Ostree upgrade failed: min-free-space-percent '3%' would be exceeded, 16.8 MB available
- "Remove the USB flash drive"
- "Remove temporary file"
- $ sudo rm -f /var/bigfile
- "Reboot the system"
- $ sudo reboot
- "Check that the status is the same than at the beginning of the test"
- $ sudo ostree admin status
metadata:
name: apertis-update-manager-powercut
format: "Apertis Test Definition 1.0"
image-type: any
image-arch: armhf
type: functional
exec-type: manual
priority: medium
maintainer: "Apertis Project"
description: "Ensure that failures due to power losses during updates have no effect on the system"
resources:
- "A Fat32 USB flash drive, preloaded with an update bundle named static-update.bundle at the root of the disk"
- "The DUT u-boot environment must be clean: in u-boot, run: `env default -a` followed by `saveenv`"
- "A PC must be connected to DUT serial port"
expected:
- "The update wasn't applied"
- "System boots using the initial deployment"
- "Possible corruption of root file system which should not affect to boot into initial OSTree deployment"
run:
steps:
- "Check the current deployment"
- $ sudo ostree admin status
- "Need to monitor the journal log to catch events in time"
- $ sudo journalctl -ef --unit apertis-update-manager &
- "Plug the USB flash drive into the device"
- "The update starts automatically"
- "Wait while the upgrade starts"
- |
>Dec 19 22:31:46 apertis apertis-update-[390]: mount added : /media/test
Dec 19 22:31:46 apertis apertis-update-[390]: Ostree static delta starting
Dec 19 22:31:46 apertis apertis-update-[390]: Cannot check the ID in black list: No such file or directory
- "Wait for message similar to below in log and immediately unplug the power"
- |
>Dec 19 22:46:59 apertis apertis-update-managerd[887]: Copying /etc changes: 5 modified, 0 removed, 16 added
- "Plug the power back and let the device boot"
- "Check the current deployment is the same that at the beginning of the test"
- $ sudo ostree admin status
metadata:
name: apertis-update-manager-usb-unplug
format: "Apertis Test Definition 1.0"
image-type: any
image-arch: armhf
type: functional
exec-type: manual
priority: medium
maintainer: "Apertis Project"
description: "Test the apertis-update-manager automatic update interrupted by mass storage removing."
resources:
- "A Fat32 USB flash drive, preloaded with an update bundle named static-update.bundle at the root of the disk"
- "The DUT u-boot environment must be clean: in u-boot, run: `env default -a` followed by `saveenv`"
- "A PC must be connected to DUT serial port"
expected:
- "The update wasn't applied"
- "System boots using the initial deployment"
run:
steps:
- "Check the current deployment"
- $ sudo ostree admin status
- "Need to monitor the journal log to catch events in time"
- $ sudo journalctl -ef --unit apertis-update-manager &
- "Plug the USB flash drive into the device"
- "The update starts automatically"
- "Wait while the upgrade starts"
- |
>Dec 19 22:31:46 apertis apertis-update-[390]: mount added : /media/test
Dec 19 22:31:46 apertis apertis-update-[390]: Ostree static delta starting
Dec 19 22:31:46 apertis apertis-update-[390]: Cannot check the ID in black list: No such file or directory
- "Wait 10-20 seconds (depending on your HW) and remove the USB flash drive"
- "Update should be interrupted with error messages similar to"
- |
>[ 59.542717] scsi 1:0:0:0: rejecting I/O to offline device
[ 59.548183] scsi 1:0:0:0: rejecting I/O to offline device
[ 59.553633] scsi 1:0:0:0: rejecting I/O to dead device
[ 59.558840] scsi 1:0:0:0: rejecting I/O to dead device
[ 59.564239] print_req_error: I/O error, dev sda, sector 24393
[ 59.570120] print_req_error: I/O error, dev sda, sector 24633
Dec 19 22:31:49 apertis systemd[1]: apertis-update-manager.service: Main process exited, code=killed, status=7/BUS
Dec 19 22:31:49 apertis systemd[1]: apertis-update-manager.service: Unit entered failed state.
Dec 19 22:31:49 apertis systemd[1]: apertis-update-manager.service: Failed with result 'signal'.
Dec 19 22:31:49 apertis systemd[1]: apertis-update-manager.service: Service hold-off time over, scheduling restart.
Dec 19 22:31:49 apertis systemd[1]: Stopped Apertis update manager.
Dec 19 22:31:49 apertis systemd[1]: Starting Apertis update manager...
- "Check the current deployment is the same that at the beginning of the test"
- $ sudo ostree admin status
- "Repeat the test several times by plug and unplug the USB stick"
- "Reboot the system"
- $ sudo reboot
- "Check the current deployment is the same that at the beginning of the test"
- $ sudo ostree admin status
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment