diff --git a/test-cases/apertis-update-manager-api.yaml b/test-cases/apertis-update-manager-api.yaml new file mode 100644 index 0000000000000000000000000000000000000000..230c13c5e7d99d2d45412e0c9e99ba6001f977b1 --- /dev/null +++ b/test-cases/apertis-update-manager-api.yaml @@ -0,0 +1,46 @@ +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 diff --git a/test-cases/apertis-update-manager-automount.yaml b/test-cases/apertis-update-manager-automount.yaml new file mode 100644 index 0000000000000000000000000000000000000000..14cbff93e45f27e2cb043c983331fea4ab0517f0 --- /dev/null +++ b/test-cases/apertis-update-manager-automount.yaml @@ -0,0 +1,29 @@ +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 diff --git a/test-cases/apertis-update-manager-manual.yaml b/test-cases/apertis-update-manager-manual.yaml new file mode 100644 index 0000000000000000000000000000000000000000..262c2b8b62182c56f17f8e850d62d910d0f00518 --- /dev/null +++ b/test-cases/apertis-update-manager-manual.yaml @@ -0,0 +1,31 @@ +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 + diff --git a/test-cases/apertis-update-manager-rollback.yaml b/test-cases/apertis-update-manager-rollback.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f7b7a4085a760e5836d672a5b8946534626047e5 --- /dev/null +++ b/test-cases/apertis-update-manager-rollback.yaml @@ -0,0 +1,73 @@ +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 +