Skip to content
Snippets Groups Projects
Forked from tests / apertis-test-cases
528 commits behind the upstream repository.
apertis-update-manager-manual.yaml 2.59 KiB
metadata:
  name: apertis-update-manager
  format: "Apertis Test Definition 1.0"
  image-types:
    minimal: [ armhf ]
  image-deployment:
    - OSTree
  type: functional
  exec-type: manual
  priority: low
  maintainer: "Apertis Project"
  description: "Test the manual update with apertis-update-manager.
                The automated version of this test: https://qa.apertis.org/aum-offline-upgrade.html"

  resources:
    - "A PC must be connected to DUT serial port"
    - "A static update bundle file of the same architecture, variant and version as the testing image"

  expected:
    - "The update was properly applied"

run:
  steps:
    - "Check the initial deployment"
    - $ sudo ostree admin status
    - "Prepare the copy of commit and deploy to allow the upgrade to the same version"
    - "Command below shows you an initial commit ID, for instance"
    - |
        $ export BOOTID=$(sudo ostree admin status | sed -n -e 's/^\* apertis \([0-9a-f]*\)\.[0-9]$/\1/p'); echo $BOOTID
    - "Get the Collection ID and ref"
    -  $ 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
    - "Create the commit with changed timestamp to allow upgrade with recent update file"
    - |
        $ 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"
    - "Deploy the prepared commit"
    - $ sudo ostree admin upgrade --allow-downgrade --deploy-only --override-commit=$NEWID --reboot
    - "Wait until the system is booted again and check the deployment"
    - $ sudo ostree admin status
    - "The booted commit (started with '*') must have ID which we prepare and the initial commit ID should be marked as '(rollback)'"
    - "Remove the initial deployment"
    - $ sudo ostree admin undeploy 1
    - "Reboot the system"
    - "Check the current deployment"
    - $ sudo ostree admin status
    - "Remove blacklist file if it exists"
    - $ sudo rm -f /var/aum_blacklist.conf
    - "From the host, copy the static delta update 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 prepared deployment"
    - $ sudo ostree admin status