Skip to content
Snippets Groups Projects
Commit 619f672b authored by Frédéric Dalleau's avatar Frédéric Dalleau Committed by Denis Pynkin
Browse files

Add test for Apertis update manager


Add a test to exercise the features of the Apertis update manager.
These tests only works on OSTree images and check following:
- API of update manager with `updatectl` utility
- automatic update from mass storage device with static delta
- manual upgrade with static delta file
- automatic rollback from "failed" update
- blacklist feature
- rollback feature of U-Boot bootloader

Signed-off-by: default avatarFrédéric Dalleau <frederic.dalleau@collabora.com>
Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
parent f3dbf44f
No related branches found
No related tags found
No related merge requests found
metadata:
name: apertis-update-manager-api
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."
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:
- "CLI utility `updatectl` is able to interact with Apertis update manager"
- "The update was properly applied"
run:
steps:
- "Check the current deployment"
- $ sudo ostree admin status
- "Start the user interface agent with mode preventing automatic system reboot after update"
- $ sudo updatectl --register-upgrade-handler &
- "Plug the USB flash drive into the device"
- "The update starts automatically"
- "After the update, the device does *not* reboot automatically"
- "Check that the user interface agent reports the pending update"
- |
>** Message: Upgrade status: Checking
** Message: An upgrade is pending
- "Remove the USB flash drive"
- "Check if there is pending deployment and reboot the DUT"
- $ sudo ostree admin status
- $ sudo reboot
- "Check the current deployment has been updated and that the rollback entry points to the initial deployment"
- $ sudo ostree admin status
- "Start the user interface agent"
- $ sudo updatectl &
- "Plug the USB flash drive with the same update file into the device"
- "Check that the user interface agent reports the system is up to update"
- |
>** Message: Upgrade status: Checking
** Message: System is up to date
metadata:
name: apertis-update-manager-auto
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 via mass storage device."
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 was properly applied"
run:
steps:
- "Check the current deployment"
- $ sudo ostree admin status
- "Plug the USB flash drive in the device"
- "The update starts automatically"
- "After the update, the device will reboot automatically"
- "Remove the USB flash drive immediatly after reboot"
- "Check the current deployment has been updated and that the rollback entry points to the initial deployment"
- $ sudo ostree admin status
metadata:
name: apertis-update-manager
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 manual update with apertis-update-manager."
resources:
- "A PC must be connected to DUT serial port"
expected:
- "The update was properly applied"
run:
steps:
- "Check the current deployment"
- $ sudo ostree admin status
- "Remove blacklist file if it exists"
- $ sudo rm -f /var/aum_blacklist.conf
- "Download a static delta update and copy it to the target using scp"
- $ scp /path/to/static/delta user@target:update.bundle
- "The update does not start automatically, start it manually"
- $ sudo updatectl --apply-static-delta /home/user/update.bundle
- "After the update, the device will reboot automatically"
- "Check the current deployment has been updated and that the rollback entry points to the initial deployment"
- $ sudo ostree admin status
metadata:
name: apertis-update-manager-rollback
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 automatic rollback and blacklist mechanism of apertis-update-manager."
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:
- "U-Boot is able to detect rollback situation"
- "U-Boot is able to use rollback configuration for bootloader"
- 'The "failed" update is rolled back'
- '"Failed" update is marked as blacklisted'
- 'Apertis-update-manager is able to detect blacklisted update and refuse to update the system with it'
run:
steps:
- "Check the current deployment"
- $ sudo ostree admin status
- "Start the user interface agent with mode preventing automatic system reboot after update"
- $ sudo updatectl --register-upgrade-handler &
- "Plug the USB flash drive into the device"
- "The update starts automatically"
- "After the update, the device does *not* reboot automatically"
- "Check that the user interface agent reports the pending update"
- |
>** Message: Upgrade status: Checking
** Message: An upgrade is pending
- "Remove the USB flash drive"
- "Check if there is pending deployment and reboot the DUT"
- $ sudo ostree admin status
- $ sudo reboot
- "In `U-Boot` console check the status of upgrade"
- $ printenv bootcount bootlimit upgrade_available
- |
>bootcount=1
bootlimit=3
upgrade_available=1
- "Reset the DUT 3 times before the boot finishes"
- "U-Boot should be able to detect the rollback mode and boot the system in rollback mode"
- |
>Warning: Bootlimit (3) exceeded. Using altbootcmd.
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found /extlinux/extlinux-rollback.conf
Retrieving file: /extlinux/extlinux-rollback.conf
- "Wait for system boot"
- "Check the update has been rolled back and that the initial deployment is still the active deployment"
- $ sudo ostree admin status
- "Start the user interface agent"
- $ sudo updatectl &
- "Plug the USB flash drive with the same update file into the device"
- "Check that the user interface agent reports the system is up to update"
- |
>** Message: Upgrade status: Checking
** Message: System is up to date
- "Check the journal log should mention that the update ID has been blacklisted"
- $ sudo journalctl -ef --unit apertis-update-manager
- |
>Dec 19 20:54:34 apertis apertis-update-[330]: Ostree static delta starting
Dec 19 20:54:34 apertis apertis-update-[330]: Revision '9804c4f6e952f0ba61659f55262b9cdd8879cb480084e7f24d9167c2b35f7f28' is marked as blacklisted; skipping
Dec 19 20:54:34 apertis apertis-update-[330]: Ostree already up to date
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