mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-18 14:42:24 +00:00
psasim: small fixes to all.sh and test bash scripts
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
be6a47140b
commit
2016d66741
@ -7,6 +7,9 @@ set -e
|
|||||||
|
|
||||||
pkill psa_server || true
|
pkill psa_server || true
|
||||||
|
|
||||||
|
# Remove temporary files
|
||||||
|
rm -f psa_notify_*
|
||||||
|
|
||||||
# Remove all IPCs
|
# Remove all IPCs
|
||||||
# Not just ipcrm -all=msg as it is not supported on macOS.
|
# Not just ipcrm -all=msg as it is not supported on macOS.
|
||||||
# Filter out header and empty lines, choosing to select based on keys being
|
# Filter out header and empty lines, choosing to select based on keys being
|
||||||
|
@ -16,10 +16,9 @@ cd "$(dirname "$0")"
|
|||||||
CLIENT_BIN=$1
|
CLIENT_BIN=$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
ipcs | grep q | awk '{ printf " -q " $2 }' | xargs ipcrm > /dev/null 2>&1 || true
|
./kill_servers.sh
|
||||||
|
|
||||||
./start_server.sh
|
./start_server.sh
|
||||||
./$CLIENT_BIN "$@"
|
./$CLIENT_BIN "$@"
|
||||||
|
|
||||||
# Kill server once client exited
|
./kill_servers.sh
|
||||||
pkill psa_server
|
|
||||||
|
@ -379,8 +379,7 @@ cleanup()
|
|||||||
helper_psasim_cleanup_before_client() {
|
helper_psasim_cleanup_before_client() {
|
||||||
# Clean up library files
|
# Clean up library files
|
||||||
make -C library clean
|
make -C library clean
|
||||||
# Clean up intermediate files that were used to build the server
|
|
||||||
make -C $PSASIM_PATH clean_server_intermediate_files
|
|
||||||
# Restore files that were backup before building library files. This
|
# Restore files that were backup before building library files. This
|
||||||
# includes $CONFIG_H and $CRYPTO_CONFIG_H.
|
# includes $CONFIG_H and $CRYPTO_CONFIG_H.
|
||||||
for x in $files_to_back_up; do
|
for x in $files_to_back_up; do
|
||||||
|
@ -10,37 +10,37 @@
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
# Helper function for controlling (start & stop) the psasim server.
|
# Helper function for controlling (start & stop) the psasim server.
|
||||||
helper_psasim_server () {
|
helper_psasim_server() {
|
||||||
OPERATION=$1
|
OPERATION=$1
|
||||||
if [ "$OPERATION" == "start" ]; then
|
if [ "$OPERATION" == "start" ]; then
|
||||||
(
|
|
||||||
cd tests
|
|
||||||
msg "start server in tests"
|
msg "start server in tests"
|
||||||
psa-client-server/psasim/test/start_server.sh
|
(
|
||||||
|
cd tests
|
||||||
|
../$PSASIM_PATH/test/start_server.sh
|
||||||
|
)
|
||||||
msg "start server in tf-psa-crypto/tests"
|
msg "start server in tf-psa-crypto/tests"
|
||||||
cd ../tf-psa-crypto/tests
|
(
|
||||||
../../tests/psa-client-server/psasim/test/start_server.sh
|
cd tf-psa-crypto/tests
|
||||||
)
|
../../$PSASIM_PATH/test/start_server.sh
|
||||||
|
)
|
||||||
else
|
else
|
||||||
(
|
msg "terminate server in tests"
|
||||||
msg "terminate servers and cleanup"
|
(
|
||||||
tests/psa-client-server/psasim//test/kill_servers.sh
|
# This will kill both servers and clean up all the message queues,
|
||||||
|
# and clear temporary files in tests
|
||||||
# Remove temporary files and logs
|
cd tests
|
||||||
cd tests
|
../$PSASIM_PATH/test/kill_servers.sh
|
||||||
rm -f psa_notify_*
|
)
|
||||||
rm -f psa_service_*
|
msg "terminate server in tf-psa-crypto/tests"
|
||||||
rm -f psa_server.log
|
(
|
||||||
|
# This just clears temporary files in tf-psa-crypto/tests
|
||||||
cd ../tf-psa-crypto/tests
|
cd tf-psa-crypto/tests
|
||||||
rm -f psa_notify_*
|
../../$PSASIM_PATH/test/kill_servers.sh
|
||||||
rm -f psa_service_*
|
)
|
||||||
rm -f psa_server.log
|
|
||||||
)
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
component_test_psasim () {
|
component_test_psasim() {
|
||||||
msg "build server library and application"
|
msg "build server library and application"
|
||||||
scripts/config.py crypto
|
scripts/config.py crypto
|
||||||
helper_psasim_config server
|
helper_psasim_config server
|
||||||
@ -53,19 +53,21 @@ component_test_psasim () {
|
|||||||
helper_psasim_build client
|
helper_psasim_build client
|
||||||
|
|
||||||
msg "build basic psasim client"
|
msg "build basic psasim client"
|
||||||
make -C tests/psa-client-server/psasim CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" test/psa_client_base
|
make -C $PSASIM_PATH CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" test/psa_client_base
|
||||||
msg "test basic psasim client"
|
msg "test basic psasim client"
|
||||||
tests/psa-client-server/psasim/test/run_test.sh psa_client_base
|
$PSASIM_PATH/test/run_test.sh psa_client_base
|
||||||
|
|
||||||
msg "build full psasim client"
|
msg "build full psasim client"
|
||||||
make -C tests/psa-client-server/psasim CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" test/psa_client_full
|
make -C $PSASIM_PATH CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" test/psa_client_full
|
||||||
msg "test full psasim client"
|
msg "test full psasim client"
|
||||||
tests/psa-client-server/psasim/test/run_test.sh psa_client_full
|
$PSASIM_PATH/test/run_test.sh psa_client_full
|
||||||
|
|
||||||
make -C tests/psa-client-server/psasim clean
|
helper_psasim_server kill
|
||||||
|
make -C $PSASIM_PATH clean
|
||||||
}
|
}
|
||||||
|
|
||||||
component_test_suite_with_psasim () {
|
component_test_suite_with_psasim()
|
||||||
|
{
|
||||||
msg "build server library and application"
|
msg "build server library and application"
|
||||||
helper_psasim_config server
|
helper_psasim_config server
|
||||||
# Modify server's library configuration here (if needed)
|
# Modify server's library configuration here (if needed)
|
||||||
@ -83,7 +85,6 @@ component_test_suite_with_psasim () {
|
|||||||
msg "build test suites"
|
msg "build test suites"
|
||||||
make PSASIM=1 CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" tests
|
make PSASIM=1 CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" tests
|
||||||
|
|
||||||
helper_psasim_server kill
|
|
||||||
helper_psasim_server start
|
helper_psasim_server start
|
||||||
|
|
||||||
# psasim takes an extremely long execution time on some test suites so we
|
# psasim takes an extremely long execution time on some test suites so we
|
||||||
|
Loading…
x
Reference in New Issue
Block a user