From 0eb0991ad624a073203185592f15a3ca4ee4e68a Mon Sep 17 00:00:00 2001 From: Chrissie Caulfield Date: Thu, 16 Jun 2022 07:17:59 +0100 Subject: [PATCH] tests: cleanup the last of the empty directories (#467) This should, FINALLY, allow the libqb tests to run and properly cleanup up after themselves. --- tests/check_ipc.c | 11 +++++++---- tests/resources.test | 9 +++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/check_ipc.c b/tests/check_ipc.c index 3aa4bfa1..17713208 100644 --- a/tests/check_ipc.c +++ b/tests/check_ipc.c @@ -1598,15 +1598,18 @@ test_ipc_stress_connections(void) } multiple_connections = QB_FALSE; - request_server_exit(); - verify_graceful_stop(pid); - qb_ipcc_disconnect(conn); - + /* Re-enable logging here so we get the "Free'ing" message which allows + for resources.test to clear up after us if needed */ qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_CLEAR_ALL, QB_LOG_FILTER_FILE, "*", LOG_TRACE); qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD, QB_LOG_FILTER_FILE, "*", LOG_TRACE); qb_log_ctl(QB_LOG_STDERR, QB_LOG_CONF_ENABLED, QB_TRUE); + + request_server_exit(); + qb_ipcc_disconnect(conn); + verify_graceful_stop(pid); + } static void diff --git a/tests/resources.test b/tests/resources.test index e18a837d..25dbf54d 100755 --- a/tests/resources.test +++ b/tests/resources.test @@ -58,6 +58,15 @@ for d in /dev/shm /var/run $SOCKETDIR; do RETURN=1 fi done + +# Clean up empty /dev/shm directories left over by some tests +DIRS=$(grep "Free'ing ringbuffer" ipc.log ipc_sock.log| cut -f4 -d ' '|cut -f-4 -d'/'|sort|uniq) +for i in $DIRS +do + rmdir $i 2>/dev/null +done + + ps aux | grep -v grep | grep -E 'lt-.*\.test' if [ $? -eq 0 ]; then echo "test program frozen"