Repository navigation
Add SEGGER RTT debug output support #2658
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: wolfHSM simulator test | |
| on: | |
| push: | |
| branches: [ 'master', 'main', 'release/**' ] | |
| pull_request: | |
| branches: [ '*' ] | |
| workflow_dispatch: | |
| jobs: | |
| wolfhsm_simulator_test: | |
| # Matrix strategy runs all steps below for each config specified. | |
| # This allows testing multiple configurations without duplicating the workflow. | |
| strategy: | |
| matrix: | |
| config: | |
| - name: "wolfHSM client ECC" | |
| file: "config/examples/sim-wolfHSM-client-ecc.config" | |
| needs_posix_server: true | |
| posix_server_nvminit: false | |
| needs_nvm_image: false | |
| - name: "wolfHSM client ML-DSA" | |
| file: "config/examples/sim-wolfHSM-client-mldsa.config" | |
| needs_posix_server: true | |
| posix_server_nvminit: false | |
| needs_nvm_image: false | |
| - name: "wolfHSM client cert chain verify ECC" | |
| file: "config/examples/sim-wolfHSM-client-certchain-ecc.config" | |
| needs_posix_server: true | |
| posix_server_nvminit: true | |
| needs_nvm_image: false | |
| - name: "wolfHSM client cert chain verify RSA4096" | |
| file: "config/examples/sim-wolfHSM-client-certchain-rsa4096.config" | |
| needs_posix_server: true | |
| posix_server_nvminit: true | |
| needs_nvm_image: false | |
| - name: "wolfHSM server cert chain verify ECC" | |
| file: "config/examples/sim-wolfHSM-server-certchain-ecc.config" | |
| needs_posix_server: false | |
| posix_server_nvminit: false | |
| needs_nvm_image: true | |
| - name: "wolfHSM server cert chain verify RSA4096" | |
| file: "config/examples/sim-wolfHSM-server-certchain-rsa4096.config" | |
| needs_posix_server: false | |
| posix_server_nvminit: false | |
| needs_nvm_image: true | |
| - name: "wolfHSM server cert chain verify RSA2048/SHA384 CA, ECC256 leaf" | |
| file: "config/examples/sim-wolfHSM-server-certchain-rsa2048-ca.config" | |
| needs_posix_server: false | |
| posix_server_nvminit: false | |
| needs_nvm_image: true | |
| fail-fast: false | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/wolfssl/wolfboot-ci-sim:v1.0 | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Trust workspace | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: make clean | |
| run: | | |
| make distclean | |
| - name: Select config (${{ matrix.config.name }}) | |
| run: | | |
| cp ${{ matrix.config.file }} .config | |
| - name: Build tools | |
| run: | | |
| make -C tools/keytools && make -C tools/bin-assemble | |
| - name: Build wolfboot.elf | |
| run: | | |
| make clean && make test-sim-internal-flash-with-update | |
| - name: Build example POSIX TCP server | |
| if: matrix.config.needs_posix_server | |
| run: cd lib/wolfHSM/examples/posix/wh_posix_server && make WOLFSSL_DIR=../../../../wolfssl | |
| # Start the server in the background | |
| - name: Run POSIX TCP server | |
| if: matrix.config.needs_posix_server | |
| run: | | |
| cd lib/wolfHSM/examples/posix/wh_posix_server | |
| if [ "${{ matrix.config.posix_server_nvminit }}" = "true" ]; then | |
| tmpfile=$(mktemp) | |
| # The server maps root CA ID 1 from client 1 to NVM ID 0x6101 | |
| # (cert type 0x6, client 1, ID 1) | |
| echo "obj 0x6101 0xFFFF 0x0000 \"cert CA\" ../../../../../test-dummy-ca/root-cert.der" >> $tmpfile | |
| ./Build/wh_posix_server.elf --type tcp --nvminit $tmpfile & | |
| else | |
| # --flags=0x100 sets the WH_NVM_FLAGS_USAGE_VERIFY flag | |
| ./Build/wh_posix_server.elf --type tcp --client 1 --id 255 --flags 0x100 --key ../../../../../wolfboot_signing_private_key_pub.der & | |
| fi | |
| TCP_SERVER_PID=$! | |
| echo "TCP_SERVER_PID=$TCP_SERVER_PID" >> $GITHUB_ENV | |
| # For testing the wolfHSM server cert chain verify feature, we need to create an NVM image containing our root CA that | |
| # the internal wolfHSM server can load. | |
| - name: Create NVM image for wolfHSM server cert chain verify | |
| if: matrix.config.needs_nvm_image | |
| run: | | |
| make -C lib/wolfHSM/tools/whnvmtool | |
| tmpfile=$(mktemp) | |
| # Root CA at NVM ID 0x6101, the sim HAL default. --size must match | |
| # partition_size in hal/sim.c | |
| echo "obj 0x6101 0xFFFF 0x0000 \"cert CA\" test-dummy-ca/root-cert.der" >> $tmpfile | |
| ./lib/wolfHSM/tools/whnvmtool/whnvmtool --image=wolfBoot_wolfHSM_NVM.bin --size=16384 --invert-erased-byte $tmpfile | |
| # Run the sunny day update test against the server | |
| - name: Run sunny day update test | |
| run: | | |
| tools/scripts/sim-sunnyday-update.sh | |
| # Kill the server if it is still running | |
| - name: Kill POSIX TCP server | |
| if: always() && matrix.config.needs_posix_server | |
| run: | | |
| kill $TCP_SERVER_PID || true |