From 1ecd787249901df629ab7dbc76f68da17c75d51c Mon Sep 17 00:00:00 2001 From: yan wang Date: Wed, 18 Feb 2026 22:33:04 +0100 Subject: [PATCH] ci: cram: freedom: test the upgrade with swupdate in Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run upgrades in dry-mode with a correctly signed image and another one where the keys to sign the .swu image and to authenticate the image before the upgrade are different. This last test also covers the case where the image is corrupted. Implements: PCF-1876, PCF-1878 Tracked-by: FEAT-29 Signed-off-by: yan wang Signed-off-by: Petr Štetiar [cram fixes] --- .gitlab/tests/cram/wnc-freedom/211-swupdate.t | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .gitlab/tests/cram/wnc-freedom/211-swupdate.t diff --git a/.gitlab/tests/cram/wnc-freedom/211-swupdate.t b/.gitlab/tests/cram/wnc-freedom/211-swupdate.t new file mode 100644 index 0000000000..170e8a5183 --- /dev/null +++ b/.gitlab/tests/cram/wnc-freedom/211-swupdate.t @@ -0,0 +1,27 @@ +Create alias: + + $ alias R="${CRAM_REMOTE_COMMAND:-}" + $ alias C="${CRAM_REMOTE_COPY:-}" + +Check boot information before upgrade: + + $ R "cat /proc/device-tree/chosen/u-boot,booted-bank | tr -d '\0'; echo" + active + +Copy the .swu image for the swupdate dry run test: + + $ C ${CI_PROJECT_DIR}/bin/targets/ipq95xx/generic/prplos-ipq95xx-generic-prpl_freedom-image.swu root@${TARGET_LAN_IP}:/tmp/ + Warning: Permanently added '*' (*) to the list of known hosts* (glob) + +Run SWUpdate in dry-run mode: + + $ R "test -f /tmp/prplos-ipq95xx-generic-prpl_freedom-image.swu" + $ R "swupdate -n -k /security/public.pem -i /tmp/prplos-ipq95xx-generic-prpl_freedom-image.swu -v -H freedom:1.0.0 -e active,full 2>/dev/null | grep -F 'SWUpdate was successful'" + [INFO ] : SWUPDATE running : [endupdate] : SWUpdate was successful ! + +Run SWUpdate in dry-run mode using a wrong public key: + + $ R "test -f /tmp/prplos-ipq95xx-generic-prpl_freedom-image.swu" + $ R "openssl genrsa -out /tmp/private.pem 2048; openssl rsa -in /tmp/private.pem -pubout -out /tmp/public.pem > /dev/null 2>&1" + $ R "swupdate -n -k /tmp/public.pem -i /tmp/prplos-ipq95xx-generic-prpl_freedom-image.swu -v -H freedom:1.0.0 -e active,full 2>&1 | grep -i 'endupdate .* SWUpdate \*failed\* !'" + [ERROR] : SWUPDATE failed [0] ERROR install_from_file.c : endupdate : 55 : SWUpdate *failed* !