Valerio Setti 655b9793c0 crypto-client test: implement the first IPC call for psa_crypto_init()
This commit implements the first useful IPC communication between
the client and the server. The implemented command is simple,
psa_crypto_init(), and its return value is sent back to the client.

Note: the newly added file psa_functions_codes.h is temporary
and it's probably the one that needs to be automatically
generated by a python script to support all crypto functions.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-10 05:22:23 +02:00

38 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# This is a simple bash script that tests psa_client/psa_server interaction.
# This script is automatically executed when "make run" is launched by the
# "psasim" root folder. The script can also be launched manually once
# binary files are built (i.e. after "make test" is executed from the "psasim"
# root folder).
#
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
set -e
cd "$(dirname "$0")"
function clean_run() {
rm -f psa_notify_*
pkill psa_partition || true
pkill psa_client || true
ipcs | grep q | awk '{ printf " -q " $$2 }' | xargs ipcrm > /dev/null 2>&1 || true
}
# The server creates some local files when it starts up so we can wait for this
# event as signal that the server is ready so that we can start client(s).
function wait_for_server_startup() {
while [ ! -f ./psa_notify_* ]; do
sleep 0.1
done
}
clean_run
./psa_partition -k > psa_partition.log 2>&1 &
SERV_PID=$!
wait_for_server_startup
./psa_client > psa_client.log 2>&1
wait $SERV_PID