From 6ff04647e935ba34d3e1990f8417c40fa869dfe3 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Fri, 8 Apr 2022 10:32:46 +0200 Subject: [PATCH] Added automated footprint regression tests --- .github/workflows/footprint.yml | 44 +++++++++++++++++++++++++++++++++ tools/test.mk | 17 +++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/footprint.yml diff --git a/.github/workflows/footprint.yml b/.github/workflows/footprint.yml new file mode 100644 index 00000000..262208cc --- /dev/null +++ b/.github/workflows/footprint.yml @@ -0,0 +1,44 @@ +name: Footprint test + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build_and_test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + # Get the arm-non-eabi-gcc toolchain + - name: Install arm-none-eabi-gcc + uses: fiam/arm-none-eabi-gcc@v1 + with: + # The arm-none-eabi-gcc release to use. + release: "9-2019-q4" + + - name: make clean + run: | + make clean && make -C tools/keytools clean && rm -f include/target.h + + - name: Install wolfSSL + run: | + sudo apt-get install --no-install-recommends -y -q make libwolfssl-dev + + - name: Select config + run: | + cp config/examples/stm32f4.config .config && make include/target.h + + - name: Build key tools + run: | + make -C tools/keytools + + - name: Build wolfboot and test footprint + run: | + make test-size-all + diff --git a/tools/test.mk b/tools/test.mk index 38a66971..6eb5a3f8 100644 --- a/tools/test.mk +++ b/tools/test.mk @@ -66,6 +66,11 @@ $(EXPVER): $(BINASSEMBLE): $(MAKE) -C $(dir $@) +test-size: FORCE + $(Q)make clean + $(Q)make wolfboot.bin + $(Q)FP=`$(SIZE) -A wolfboot.elf | awk -e ' /Total/ {print $$2;}'`; echo SIZE: $$FP LIMIT: $$LIMIT; test $$FP -le $$LIMIT + # Testbed actions # # @@ -759,3 +764,15 @@ test-all: clean make test-no-asm-smallstack make test-fastmath-smallstack make test-delta-update + +test-size-all: + make test-size SIGN=ED25519 LIMIT=10670 + make test-size SIGN=ECC256 LIMIT=21538 + make test-size SIGN=ECC256 NO_ASM=1 LIMIT=13042 + make test-size SIGN=RSA2048 LIMIT=10538 + make test-size SIGN=RSA2048 NO_ASM=1 LIMIT=11626 + make test-size SIGN=RSA4096 LIMIT=10894 + make test-size SIGN=RSA4096 NO_ASM=1 LIMIT=11910 + make test-size SIGN=ECC384 LIMIT=16866 + make test-size SIGN=ECC384 NO_ASM=1 LIMIT=14294 + make test-size SIGN=ED448 LIMIT=12830