Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/build-and-run-generic-port.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Run Generic Port

on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]

jobs:
build:
strategy:
matrix:
include:
- name: "Standard"
flags: ""
- name: "ASAN"
flags: "ASAN=1"
- name: "DEBUG"
flags: "DEBUG=1"
- name: "DEBUG ASAN"
flags: "DEBUG=1 ASAN=1"

runs-on: ubuntu-latest
timeout-minutes: 10
name: Generic Port (${{ matrix.name }})

steps:
- uses: actions/checkout@v4

- name: Checkout wolfssl
uses: actions/checkout@v4
with:
repository: wolfssl/wolfssl
path: wolfssl

- name: Build generic server
run: cd port/posix/server && make -j ${{ matrix.flags }} WOLFSSL_DIR=../../../wolfssl

- name: Build generic client
run: cd port/posix/client && make -j ${{ matrix.flags }} WOLFSSL_DIR=../../../wolfssl
Comment on lines +37 to +40
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make -j ${{ matrix.flags }} is passing variable assignments (e.g. ASAN=1) as the argument to -j, which expects a job count; this will fail with "invalid -j argument" in non-Standard matrix entries. Pass ${{ matrix.flags }} as separate make arguments (e.g. make -j ${{ runner.cpu_cores }} ${{ matrix.flags }} ...) or drop -j if you don’t want parallelism.

Suggested change
run: cd port/posix/server && make -j ${{ matrix.flags }} WOLFSSL_DIR=../../../wolfssl
- name: Build generic client
run: cd port/posix/client && make -j ${{ matrix.flags }} WOLFSSL_DIR=../../../wolfssl
run: cd port/posix/server && make -j ${{ runner.cpu_cores }} ${{ matrix.flags }} WOLFSSL_DIR=../../../wolfssl
- name: Build generic client
run: cd port/posix/client && make -j ${{ runner.cpu_cores }} ${{ matrix.flags }} WOLFSSL_DIR=../../../wolfssl

Copilot uses AI. Check for mistakes.
Comment on lines +36 to +40
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says CI will 'build and run' the POSIX generic port, but the workflow currently only builds. To match the description (and the workflow name), add steps to run the server in the background, run the client, and then terminate/clean up the server (with a timeout to avoid hangs).

Copilot uses AI. Check for mistakes.
10 changes: 7 additions & 3 deletions benchmark/wh_bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
* You should have received a copy of the GNU General Public License
* along with wolfHSM. If not, see <http://www.gnu.org/licenses/>.
*/

#include "wolfhsm/wh_settings.h"

#include <stdint.h>
#include <string.h> /* For memset, memcpy */

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

#include "wolfhsm/wh_settings.h"

#include "wolfhsm/wh_error.h"
#include "wolfhsm/wh_comm.h"
Expand Down Expand Up @@ -751,6 +753,7 @@ typedef struct {
int transport;
} whBenchClientTaskData;

#if defined(WOLFHSM_CFG_ENABLE_SERVER) && defined(WOLFHSM_CFG_ENABLE_CLIENT)
static void* _whBenchClientTask(void* data)
{
whBenchClientTaskData* taskData = (whBenchClientTaskData*)data;
Expand Down Expand Up @@ -838,7 +841,8 @@ static void _whBenchClientServerThreadTest(whClientConfig* c_conf,
}
}

/* Global static variables for transport configurations */
/* Global static variables for transport configurations (used by
* wh_Bench_ClientServer_Posix which requires both client and server) */
static uint8_t g_mem_req[BUFFER_SIZE] = {0};
static uint8_t g_mem_resp[BUFFER_SIZE] = {0};
static whTransportMemConfig g_mem_tmcf = {
Expand Down Expand Up @@ -1016,7 +1020,6 @@ static int _configureServerTransport(whBenchTransportType transport,
return ret;
}


/* transport is the type of transport to use */
int wh_Bench_ClientServer_Posix(int transport, int moduleIndex)
{
Expand Down Expand Up @@ -1131,6 +1134,7 @@ int wh_Bench_ClientServer_Posix(int transport, int moduleIndex)

return WH_ERROR_OK;
}
#endif /* WOLFHSM_CFG_ENABLE_SERVER && WOLFHSM_CFG_ENABLE_CLIENT */


#endif /* WOLFHSM_CFG_TEST_POSIX */
Expand Down
Loading
Loading