Added github action for powerfail tests

pull/290/head
Daniele Lacamera 2023-03-14 16:43:00 +01:00
parent 887f96c7b0
commit 7e9ecbad50
2 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,91 @@
name: Power-failure during update - test with simulator target
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
powerfail_simulator_tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: make clean
run: |
make keysclean && make -C tools/keytools clean && rm -f include/target.h
- name: Select config
run: |
cp config/examples/sim.config .config
- name: Build key tools
run: |
make -C tools/keytools
- name: Build wolfboot.elf
run: |
make test-sim-internal-flash-with-update
- name: Run sunny day update test
run: |
tools/scripts/sim-sunnyday-update.sh
- name: Rebuild wolfboot.elf
run: |
make test-sim-internal-flash-with-update
- name: Run update-revert test
run: |
tools/scripts/sim-update-fallback.sh
- name: Rebuild wolfboot.elf
run: |
make test-sim-internal-flash-with-update
- name: Run update-revert test with power failures
run: |
tools/scripts/sim-update-powerfail-resume.sh
# TEST wit NVM_WRITEONCE enabled
- name: make clean
run: |
make keysclean && make -C tools/keytools clean && rm -f include/target.h
- name: Select config with NVM_WRITEONCE
run: |
cp config/examples/sim-nvm-writeonce.config .config
- name: Build key tools
run: |
make -C tools/keytools
- name: Build wolfboot.elf
run: |
make test-sim-internal-flash-with-update
- name: Run sunny day update test (NVM_WRITEONCE)
run: |
tools/scripts/sim-sunnyday-update.sh
- name: Rebuild wolfboot.elf
run: |
make test-sim-internal-flash-with-update
- name: Run update-revert test (NVM_WRITEONCE)
run: |
tools/scripts/sim-update-fallback.sh
- name: Rebuild wolfboot.elf
run: |
make test-sim-internal-flash-with-update
- name: Run update-revert test with power failures (NVM_WRITEONCE)
run: |
tools/scripts/sim-update-powerfail-resume.sh

View File

@ -0,0 +1,17 @@
ARCH=sim
TARGET=sim
SIGN?=ED25519
HASH?=SHA256
WOLFBOOT_SMALL_STACK=1
SPI_FLASH=0
DEBUG=1
# it should be multiple of system page size
NVM_FLASH_WRITEONCE=1
WOLFBOOT_PARTITION_SIZE=0x2A000
WOLFBOOT_SECTOR_SIZE=0x1000
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x10000
# if on external flash, it should be multiple of system page size
WOLFBOOT_PARTITION_UPDATE_ADDRESS=0x3a000
WOLFBOOT_PARTITION_SWAP_ADDRESS=0x64000
# required for keytools
WOLFBOOT_FIXED_PARTITIONS=1