diff --git a/test-cases/apertis-update-manager-api.yaml b/test-cases/apertis-update-manager-api.yaml index 5eb99c0c2c676ed8e271ddc13a76ab8c8de86b56..840ae280c3328b9d9c2893147738b3f51211e1c5 100644 --- a/test-cases/apertis-update-manager-api.yaml +++ b/test-cases/apertis-update-manager-api.yaml @@ -13,8 +13,9 @@ metadata: The automated version of this test: https://qa.apertis.org/aum-api.html" resources: - - "A static update bundle file from https://images.apertis.org/updater-test/armhf-minimal/static-update.bundle" + - "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" @@ -24,6 +25,26 @@ metadata: 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 - "Start the user interface agent with mode preventing automatic system reboot after update" @@ -39,7 +60,7 @@ run: - "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" + - "Check the current deployment has been updated and that the rollback entry points to the prepared deployment" - $ sudo ostree admin status - "Start the user interface agent" - $ sudo updatectl & diff --git a/test-cases/apertis-update-manager-automount.yaml b/test-cases/apertis-update-manager-automount.yaml index ba6a1d9b46c10a20227e7436b9e1f5f2ba757472..e04e4b15a0da75c6f99a054b96a046f41f375c34 100644 --- a/test-cases/apertis-update-manager-automount.yaml +++ b/test-cases/apertis-update-manager-automount.yaml @@ -12,8 +12,9 @@ metadata: description: "Test the apertis-update-manager automatic update via mass storage device." resources: - - "A static update bundle file from https://images.apertis.org/updater-test/armhf-minimal/static-update.bundle" + - "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" @@ -22,11 +23,29 @@ metadata: run: steps: - - "Check the current deployment" + - "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" - "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" + - "Check the current deployment has been updated and that the rollback entry points to the prepared deployment" - $ sudo ostree admin status diff --git a/test-cases/apertis-update-manager-diskfull.yaml b/test-cases/apertis-update-manager-diskfull.yaml index bb0a150ccfb44eec9683ac387d5e4be8fadccc78..ab56686e6db4e0d43305504e0c581f4138a47936 100644 --- a/test-cases/apertis-update-manager-diskfull.yaml +++ b/test-cases/apertis-update-manager-diskfull.yaml @@ -13,8 +13,9 @@ metadata: The automated version of this test: https://qa.apertis.org/aum-out-of-space.html" resources: - - "A static update bundle file from https://images.apertis.org/updater-test/armhf-minimal/static-update.bundle" + - "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" @@ -24,6 +25,26 @@ metadata: 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 - "Need to monitor the journal log" diff --git a/test-cases/apertis-update-manager-manual.yaml b/test-cases/apertis-update-manager-manual.yaml index 862a3f93ce81415e4a7eaf22ee0bfd5e97d16c21..8b9d1a6c1602690c953837f21bc5034782bf3eaa 100644 --- a/test-cases/apertis-update-manager-manual.yaml +++ b/test-cases/apertis-update-manager-manual.yaml @@ -14,22 +14,42 @@ metadata: 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, download a static delta update and copy it to the target using scp" - - $ wget https://images.apertis.org/updater-test/armhf-minimal/static-update.bundle + - "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 initial deployment" + - "Check the current deployment has been updated and that the rollback entry points to the prepared deployment" - $ sudo ostree admin status diff --git a/test-cases/apertis-update-manager-powercut.yaml b/test-cases/apertis-update-manager-powercut.yaml index d1958a9f81b4a46275f4689faac86eee00b92fcc..006e3cb2a5a6cbf0031c9fc38f975cb8ddb70485 100644 --- a/test-cases/apertis-update-manager-powercut.yaml +++ b/test-cases/apertis-update-manager-powercut.yaml @@ -13,8 +13,9 @@ metadata: The automated version of this test: https://qa.apertis.org/aum-power-cut.html" resources: - - "A static update bundle file from https://images.apertis.org/updater-test/armhf-minimal/static-update.bundle" + - "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" @@ -25,6 +26,26 @@ metadata: 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 - "Need to monitor the journal log to catch events in time" diff --git a/test-cases/apertis-update-manager-rollback.yaml b/test-cases/apertis-update-manager-rollback.yaml index 07c08e509f926822dc1f29a0bab997413386c951..d1c5e2bc2b61f2ea849a1d193a46a9401a878eca 100644 --- a/test-cases/apertis-update-manager-rollback.yaml +++ b/test-cases/apertis-update-manager-rollback.yaml @@ -13,8 +13,9 @@ metadata: The automated version of this test: https://qa.apertis.org/aum-rollback-blacklist.html" resources: - - "A static update bundle file from https://images.apertis.org/updater-test/armhf-minimal/static-update.bundle" + - "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" @@ -27,6 +28,26 @@ metadata: 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 - "Start the user interface agent with mode preventing automatic system reboot after update" diff --git a/test-cases/apertis-update-manager-usb-unplug.yaml b/test-cases/apertis-update-manager-usb-unplug.yaml index 9e85eaf289ede36df976787e04ddae1c5f54f9f9..f3fa4b504e756ebde2eb07ec62726c9d0031a223 100644 --- a/test-cases/apertis-update-manager-usb-unplug.yaml +++ b/test-cases/apertis-update-manager-usb-unplug.yaml @@ -12,8 +12,9 @@ metadata: description: "Test the apertis-update-manager automatic update interrupted by mass storage removing." resources: - - "A static update bundle file from https://images.apertis.org/updater-test/armhf-minimal/static-update.bundle" + - "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" @@ -23,6 +24,26 @@ metadata: 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 - "Need to monitor the journal log to catch events in time"