forked from wolfSSL/wolfBoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Test simulator against wolfHSM server | ||
|
||
on: | ||
push: | ||
branches: [ 'master', 'main', 'release/**' ] | ||
pull_request: | ||
branches: [ '*' ] | ||
|
||
jobs: | ||
wolfhsm_simulator_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Workaround for sources.list | ||
run: sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/sources.list | ||
|
||
- name: Update repository | ||
run: sudo apt-get update | ||
|
||
- name: make clean | ||
run: | | ||
make distclean | ||
- name: Select config (wolfHSM simulator) | ||
run: | | ||
cp config/examples/sim-wolfHSM.config .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 | ||
# checkout and build wolfHSM examples repo | ||
- name: Checkout wolfHSM-examples | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: wolfssl/wolfHSM-examples | ||
path: wolfHSM-examples | ||
|
||
- name: Build example POSIX TCP server | ||
run: cd wolfHSM-examples/posix/tcp/wh_server_tcp && make WOLFSSL_DIR=../../../wolfssl WOLFHSM_DIR=../../../wolfhsm | ||
|
||
# Start the server in the background | ||
- name: Run POSIX TCP server | ||
run: | | ||
cd wolfHSM-examples/posix/tcp/wh_server_tcp | ||
./Build/wh_server_tcp.elf & | ||
TCP_SERVER_PID=$! | ||
echo "TCP_SERVER_PID=$TCP_SERVER_PID" >> $GITHUB_ENV | ||
# 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 | ||
run: | | ||
kill $TCP_SERVER_PID |