mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
psasim: build server library and binary before client's ones
This allows to keep the same CONFIG_H while building the Mbed TLS library and the application (no matter if it's client or server). Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
committed by
Tom Cosgrove
parent
75129e2ce3
commit
f98635c360
@ -12,9 +12,6 @@ LIBPSASERVER := -Llibpsaserver/ -lmbedcrypto
|
|||||||
MBEDTLS_ROOT_PATH = ../../..
|
MBEDTLS_ROOT_PATH = ../../..
|
||||||
COMMON_INCLUDE := -I./include -I$(MBEDTLS_ROOT_PATH)/include
|
COMMON_INCLUDE := -I./include -I$(MBEDTLS_ROOT_PATH)/include
|
||||||
|
|
||||||
TEST_BIN = test/psa_client \
|
|
||||||
test/psa_partition
|
|
||||||
|
|
||||||
GENERATED_H_FILES = include/psa_manifest/manifest.h \
|
GENERATED_H_FILES = include/psa_manifest/manifest.h \
|
||||||
include/psa_manifest/pid.h \
|
include/psa_manifest/pid.h \
|
||||||
include/psa_manifest/sid.h
|
include/psa_manifest/sid.h
|
||||||
@ -33,7 +30,7 @@ PSA_SERVER_SRC = $(PARTITION_SERVER_BOOTSTRAP) \
|
|||||||
|
|
||||||
.PHONY: all clean libpsaclient libpsaserver
|
.PHONY: all clean libpsaclient libpsaserver
|
||||||
|
|
||||||
all: $(TEST_BIN)
|
all:
|
||||||
|
|
||||||
test/seedfile:
|
test/seedfile:
|
||||||
dd if=/dev/urandom of=./test/seedfile bs=64 count=1
|
dd if=/dev/urandom of=./test/seedfile bs=64 count=1
|
||||||
@ -59,7 +56,7 @@ libpsaclient libpsaserver:
|
|||||||
$(MAKE) -C $(MBEDTLS_ROOT_PATH) clean
|
$(MAKE) -C $(MBEDTLS_ROOT_PATH) clean
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(TEST_BIN)
|
rm -f test/psa_client test/psa_partition
|
||||||
rm -f $(PARTITION_SERVER_BOOTSTRAP)
|
rm -f $(PARTITION_SERVER_BOOTSTRAP)
|
||||||
rm -rf libpsaclient libpsaserver
|
rm -rf libpsaclient libpsaserver
|
||||||
rm -rf include/psa_manifest
|
rm -rf include/psa_manifest
|
||||||
|
@ -971,11 +971,6 @@ helper_crypto_client_build() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
make -C tests/psa-client-server/psasim/ CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" $TARGET_LIB "$@"
|
make -C tests/psa-client-server/psasim/ CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" $TARGET_LIB "$@"
|
||||||
|
|
||||||
# cleanup() will restore some backed-up files which include $CONFIG_H and
|
|
||||||
# $CRYPTO_CONFIG_H. Built libraries were already copied to psasim at this
|
|
||||||
# point.
|
|
||||||
cleanup
|
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
@ -6212,18 +6207,23 @@ component_check_test_helpers () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
component_test_psasim() {
|
component_test_psasim() {
|
||||||
msg "build library for client"
|
|
||||||
|
|
||||||
helper_crypto_client_build client
|
|
||||||
|
|
||||||
msg "build library for server"
|
msg "build library for server"
|
||||||
|
|
||||||
scripts/config.py crypto
|
scripts/config.py crypto
|
||||||
|
|
||||||
helper_crypto_client_build server
|
helper_crypto_client_build server
|
||||||
|
|
||||||
msg "build psasim"
|
msg "build server"
|
||||||
make -C tests/psa-client-server/psasim CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS"
|
make -C tests/psa-client-server/psasim CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" test/psa_partition
|
||||||
|
|
||||||
|
# cleanup() will restore some backed-up files which include $CONFIG_H and
|
||||||
|
# $CRYPTO_CONFIG_H. Built libraries were already copied to psasim at this
|
||||||
|
# point.
|
||||||
|
cleanup
|
||||||
|
|
||||||
|
msg "build library for client"
|
||||||
|
helper_crypto_client_build client
|
||||||
|
|
||||||
|
msg "build psasim to test psa_client"
|
||||||
|
make -C tests/psa-client-server/psasim CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" test/psa_client
|
||||||
|
|
||||||
msg "test psasim"
|
msg "test psasim"
|
||||||
tests/psa-client-server/psasim/test/run_test.sh
|
tests/psa-client-server/psasim/test/run_test.sh
|
||||||
@ -6233,17 +6233,17 @@ component_test_psasim() {
|
|||||||
# Delete the executable to ensure we build using the right MAIN
|
# Delete the executable to ensure we build using the right MAIN
|
||||||
rm tests/psa-client-server/psasim/test/psa_client
|
rm tests/psa-client-server/psasim/test/psa_client
|
||||||
# API under test: psa_hash_compute()
|
# API under test: psa_hash_compute()
|
||||||
make -C tests/psa-client-server/psasim CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" MAIN="src/aut_psa_hash_compute.c"
|
make -C tests/psa-client-server/psasim CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" MAIN="src/aut_psa_hash_compute.c" test/psa_client
|
||||||
|
|
||||||
msg "test psasim running psa_hash_compute"
|
msg "test psasim running psa_hash_compute"
|
||||||
tests/psa-client-server/psasim/test/run_test.sh
|
tests/psa-client-server/psasim/test/run_test.sh
|
||||||
|
|
||||||
|
|
||||||
# Next APIs under test: psa_hash_*(). Just use the PSA hash example.
|
# Next APIs under test: psa_hash_*(). Use our copy of the PSA hash example.
|
||||||
msg "build psasim to test all psa_hash_* APIs"
|
msg "build psasim to test all psa_hash_* APIs"
|
||||||
# Delete the executable to ensure we build using the right MAIN
|
# Delete the executable to ensure we build using the right MAIN
|
||||||
rm tests/psa-client-server/psasim/test/psa_client
|
rm tests/psa-client-server/psasim/test/psa_client
|
||||||
make -C tests/psa-client-server/psasim CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" MAIN="src/aut_psa_hash.c"
|
make -C tests/psa-client-server/psasim CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" MAIN="src/aut_psa_hash.c" test/psa_client
|
||||||
|
|
||||||
msg "test psasim running psa_hash sample"
|
msg "test psasim running psa_hash sample"
|
||||||
tests/psa-client-server/psasim/test/run_test.sh
|
tests/psa-client-server/psasim/test/run_test.sh
|
||||||
|
Reference in New Issue
Block a user