apertis-update-manager-usb-unplug manual

medium

Image Types:
minimal-armhf
Image Deployment:
OSTree
Type:
functional

Description

Test the apertis-update-manager automatic update interrupted by mass storage removing.


Resources

  • A static update bundle file of the same architecture, variant and version as the testing image
  • A Fat32 USB flash drive, preloaded with the update bundle at the root of the disk
  • Downloaded update file (with '.delta' extension) should be copied to flash drive using the name 'static-update.bundle'
  • 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

Execution Steps

  1. Check the initial deployment
  2. $ sudo ostree admin status
  3. Prepare the copy of commit and deploy to allow the upgrade to the same version
  4. Command below shows you an initial commit ID, for instance
  5. $ export BOOTID=$(sudo ostree admin status | sed -n -e 's/^\* apertis \([0-9a-f]*\)\.[0-9]$/\1/p'); echo $BOOTID
  6. Get the Collection ID and ref
  7. $ export CID=$(sudo ostree refs -c | head -n 1 | tr -d '(),' | cut -f 1 -d ' '); echo COLLECTION_ID=$CID
    $ export REF=$(sudo ostree refs -c | head -n 1 | tr -d '(),' | cut -f 2 -d ' '); echo REF=$REF
  8. Create the commit with changed timestamp to allow upgrade with recent update file
  9. $ export NEWID=$(sudo ostree commit --orphan --tree=ref=$BOOTID --add-metadata-string=ostree.collection-binding=$CID --bind-ref=$REF --timestamp="1 year ago"); echo "New commit: $NEWID"
  10. Deploy the prepared commit
  11. $ sudo ostree admin upgrade --allow-downgrade --deploy-only --override-commit=$NEWID --reboot
  12. Wait until the system is booted again and check the deployment
  13. $ sudo ostree admin status
  14. The booted commit (started with '*') must have ID which we prepare and the initial commit ID should be marked as '(rollback)'
  15. Remove the initial deployment
  16. $ sudo ostree admin undeploy 1
  17. Reboot the system
  18. Check the current deployment
  19. $ sudo ostree admin status
  20. Need to monitor the journal log to catch events in time
  21. $ sudo journalctl -ef --unit apertis-update-manager &
  22. Plug the USB flash drive into the device
  23. The update starts automatically
  24. Wait while the upgrade starts (5-20 seconds depending on your HW) and remove the USB flash drive before it is completed:
  25. 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

  26. Update should be interrupted with error messages similar to
  27. [   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...

  28. Check the current deployment is the same that at the beginning of the test
  29. $ sudo ostree admin status
  30. Repeat the test several times by plug and unplug the USB stick
  31. Reboot the system
  32. $ sudo reboot
  33. Check the current deployment is the same that at the beginning of the test
  34. $ sudo ostree admin status

Expected

The update wasn't applied

System boots using the initial deployment