Adapt psasim
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/tests/psa-client-server/psasim/Makefile b/tests/psa-client-server/psasim/Makefile
index ec6691f..c23017f 100644
--- a/tests/psa-client-server/psasim/Makefile
+++ b/tests/psa-client-server/psasim/Makefile
@@ -77,5 +77,5 @@
clean: clean_server_intermediate_files
rm -f test/psa_client_base test/psa_client_full test/psa_server
rm -rf client_libs server_libs
- rm -f test/psa_service_* test/psa_notify_* test/*.log
+ rm -f test/*.log
rm -f test/seedfile
diff --git a/tests/psa-client-server/psasim/include/util.h b/tests/psa-client-server/psasim/include/util.h
index 5eb8238..bbff3ca 100644
--- a/tests/psa-client-server/psasim/include/util.h
+++ b/tests/psa-client-server/psasim/include/util.h
@@ -28,4 +28,4 @@
#define PROJECT_ID 'M'
#define PATHNAMESIZE 256
-#define TMP_FILE_BASE_PATH "./"
+#define TMP_FILE_BASE_PATH "/tmp/"
diff --git a/tests/psa-client-server/psasim/src/psa_ff_server.c b/tests/psa-client-server/psasim/src/psa_ff_server.c
index b106092..00c5272 100644
--- a/tests/psa-client-server/psasim/src/psa_ff_server.c
+++ b/tests/psa-client-server/psasim/src/psa_ff_server.c
@@ -605,9 +605,9 @@
key_t key;
int qid;
FILE *fp;
- char doorbell_path[PATHNAMESIZE] = { 0 };
+ char doorbell_file[PATHNAMESIZE] = { 0 };
char queue_path[PATHNAMESIZE];
- snprintf(doorbell_path, PATHNAMESIZE, TMP_FILE_BASE_PATH "psa_notify_%u", getpid());
+ snprintf(doorbell_file, PATHNAMESIZE, "psa_notify_%u", getpid());
if (library_initialised > 0) {
return;
@@ -619,7 +619,7 @@
FATAL("Unsupported value. Aborting.");
}
- array[3] = doorbell_path;
+ array[3] = doorbell_file;
for (int i = 0; i < 32; i++) {
if (strncmp(array[i], "", 1) != 0) {
diff --git a/tests/psa-client-server/psasim/test/kill_server.sh b/tests/psa-client-server/psasim/test/kill_server.sh
index 7aba5a3..0425282 100755
--- a/tests/psa-client-server/psasim/test/kill_server.sh
+++ b/tests/psa-client-server/psasim/test/kill_server.sh
@@ -8,8 +8,8 @@
pkill psa_server || true
# Remove temporary files and logs
-rm -f psa_notify_*
-rm -f psa_service_*
+rm -f /tmp/psa_notify_*
+rm -f /tmp/psa_service_*
rm -f psa_server.log
# Remove all IPCs
diff --git a/tests/psa-client-server/psasim/test/start_server.sh b/tests/psa-client-server/psasim/test/start_server.sh
index fcc8a97..58ab850 100755
--- a/tests/psa-client-server/psasim/test/start_server.sh
+++ b/tests/psa-client-server/psasim/test/start_server.sh
@@ -8,7 +8,7 @@
# 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 [ $(find . -name "psa_notify_*" | wc -l) -eq 0 ]; do
+ while [ -z $(find /tmp -maxdepth 1 -name "psa_notify_*" -printf 1 -quit) ]; do
sleep 0.1
done
}