diff --git a/test-cases/apertis-update-manager-diskfull.yaml b/test-cases/apertis-update-manager-diskfull.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f8195988e6e2ccdfdc14e52c12ed567cd9acb7b9 --- /dev/null +++ b/test-cases/apertis-update-manager-diskfull.yaml @@ -0,0 +1,54 @@ +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 diff --git a/test-cases/apertis-update-manager-powercut.yaml b/test-cases/apertis-update-manager-powercut.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0b788fd0716eaa9b463f7a036a923d1f8e273dcc --- /dev/null +++ b/test-cases/apertis-update-manager-powercut.yaml @@ -0,0 +1,40 @@ +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 diff --git a/test-cases/apertis-update-manager-usb-unplug.yaml b/test-cases/apertis-update-manager-usb-unplug.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e1bfc30fdf9aab5987e3af66ccd7811db9131271 --- /dev/null +++ b/test-cases/apertis-update-manager-usb-unplug.yaml @@ -0,0 +1,56 @@ +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 +