File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed
Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -198,11 +198,18 @@ jobs:
198198 - name : Rebuild wolfboot.elf
199199 run : |
200200 make test-sim-internal-flash-with-delta-update
201-
201+
202202 - name : Run update-revert test with power failures (DELTA)
203203 run : |
204204 tools/scripts/sim-update-powerfail-resume.sh
205205
206+ - name : Rebuild with wrong delta base version
207+ run : |
208+ make clean && make test-sim-internal-flash-with-wrong-delta-update
209+
210+ - name : Run negative update test with wrong base version (DELTA)
211+ run : |
212+ tools/scripts/sim-delta-wrongversion-update.sh
206213
207214 # TEST with encryption (aes128)
208215 - name : make clean
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ V=` ./wolfboot.elf update_trigger get_version 2> /dev/null`
4+ if [ " x$V " != " x1" ]; then
5+ echo " Failed first boot with update_trigger"
6+ exit 1
7+ fi
8+
9+ # First boot: attempt update, should be rejected
10+ V=` ./wolfboot.elf success get_version 2> /dev/null`
11+ if [ " x$V " != " x1" ]; then
12+ echo " Error: Delta update with wrong image reported as successful."
13+ exit 1
14+ fi
15+
16+ # Second boot to verify system is alive
17+ V=` ./wolfboot.elf success get_version 2> /dev/null`
18+ if [ " x$V " != " x1" ]; then
19+ echo " Error: System is possibly unrecoverable"
20+ exit 1
21+ fi
22+ echo " Update successfully rejected (V: $V )"
23+
24+ echo Test successful.
25+ exit 0
26+
27+
Original file line number Diff line number Diff line change @@ -237,6 +237,15 @@ test-sim-internal-flash-with-delta-update:
237237 $$(($(WOLFBOOT_PARTITION_UPDATE_ADDRESS ) -$(ARCH_FLASH_OFFSET ) ) ) test-app/image_v$(TEST_UPDATE_VERSION ) _signed_diff.bin \
238238 $$(($(WOLFBOOT_PARTITION_SWAP_ADDRESS ) -$(ARCH_FLASH_OFFSET ) ) ) erased_sec.dd
239239
240+ test-sim-internal-flash-with-wrong-delta-update :
241+ make test-sim-internal-flash-with-update DELTA_UPDATE_OPTIONS=" --delta test-app/image_v1_signed.bin"
242+ make test-sim-internal-flash-with-update DELTA_UPDATE_OPTIONS=" --delta test-app/image_v2_signed.bin" TEST_UPDATE_VERSION=3
243+ $(Q )$(BINASSEMBLE ) internal_flash.dd \
244+ 0 wolfboot.bin \
245+ $$(($(WOLFBOOT_PARTITION_BOOT_ADDRESS ) - $(ARCH_FLASH_OFFSET ) ) ) test-app/image_v1_signed.bin \
246+ $$(($(WOLFBOOT_PARTITION_UPDATE_ADDRESS ) -$(ARCH_FLASH_OFFSET ) ) ) test-app/image_v3_signed_diff.bin \
247+ $$(($(WOLFBOOT_PARTITION_SWAP_ADDRESS ) -$(ARCH_FLASH_OFFSET ) ) ) erased_sec.dd
248+
240249test-sim-update-flash : wolfboot.elf test-sim-internal-flash-with-update FORCE
241250 $(Q ) (test ` ./wolfboot.elf success update_trigger get_version` -eq 1)
242251 $(Q ) (test ` ./wolfboot.elf success get_version` -eq $( TEST_UPDATE_VERSION) )
You can’t perform that action at this time.
0 commit comments