Skip to content

Commit d460551

Browse files
committed
Implement a generic client and server. Implement wh_Port API
1 parent 2a334a3 commit d460551

25 files changed

+2540
-12
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Build and Run Generic Port
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
include:
14+
- name: "Standard"
15+
flags: ""
16+
- name: "ASAN"
17+
flags: "ASAN=1"
18+
- name: "DEBUG"
19+
flags: "DEBUG=1"
20+
- name: "DEBUG ASAN"
21+
flags: "DEBUG=1 ASAN=1"
22+
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 10
25+
name: Generic Port (${{ matrix.name }})
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Checkout wolfssl
31+
uses: actions/checkout@v4
32+
with:
33+
repository: wolfssl/wolfssl
34+
path: wolfssl
35+
36+
- name: Build generic server
37+
run: cd port/posix/server && make -j ${{ matrix.flags }} WOLFSSL_DIR=../../../wolfssl
38+
39+
- name: Build generic client
40+
run: cd port/posix/client && make -j ${{ matrix.flags }} WOLFSSL_DIR=../../../wolfssl
41+
42+
- name: Run server and client
43+
run: |
44+
cd port/posix
45+
46+
# Start server in background
47+
server/Build/server.elf &
48+
SERVER_PID=$!
49+
50+
# Give server time to start listening
51+
sleep 1
52+
53+
# Run client (will connect, run workload, and exit)
54+
timeout 30 client/Build/client.elf &
55+
CLIENT_PID=$!
56+
57+
# Wait for client to finish
58+
wait $CLIENT_PID
59+
CLIENT_RC=$?
60+
61+
# Kill the server
62+
kill $SERVER_PID || true
63+
wait $SERVER_PID 2>/dev/null || true
64+
65+
exit $CLIENT_RC
66+
67+
- name: Cleanup
68+
if: always()
69+
run: |
70+
# Clean up FIFO if it exists
71+
rm -f /tmp/wolfhsm_notify

benchmark/wh_bench.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* You should have received a copy of the GNU General Public License
1717
* along with wolfHSM. If not, see <http://www.gnu.org/licenses/>.
1818
*/
19+
20+
#include "wolfhsm/wh_settings.h"
21+
1922
#include <stdint.h>
2023
#include <string.h> /* For memset, memcpy */
2124

@@ -25,7 +28,6 @@
2528
#include <unistd.h> /* For sleep */
2629
#endif
2730

28-
#include "wolfhsm/wh_settings.h"
2931

3032
#include "wolfhsm/wh_error.h"
3133
#include "wolfhsm/wh_comm.h"

0 commit comments

Comments
 (0)