Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy some scripts #454

Merged
merged 6 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/check_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ READY_SIGNALLER(connected_signaller, _)
request_server_exit();
}

START_TEST(test_ipc_dispatch_us_native_prio_dlock)
START_TEST(test_ipc_us_native_prio_dlock)
{
pid_t server_pid, alphaclient_pid;
struct dispatch_data data;
Expand Down Expand Up @@ -1817,7 +1817,7 @@ START_TEST(test_ipc_dispatch_us_native_prio_dlock)
END_TEST

#if HAVE_GLIB
START_TEST(test_ipc_dispatch_us_glib_prio_dlock)
START_TEST(test_ipc_us_glib_prio_dlock)
{
pid_t server_pid, alphaclient_pid;
struct dispatch_data data;
Expand Down Expand Up @@ -2407,9 +2407,9 @@ make_soc_suite(void)
add_tcase(s, tc, test_ipc_disconnect_after_created_us, 9);
add_tcase(s, tc, test_ipc_service_ref_count_us, 9);
add_tcase(s, tc, test_ipc_stress_connections_us, 3600 /* ? */);
add_tcase(s, tc, test_ipc_dispatch_us_native_prio_dlock, 15);
add_tcase(s, tc, test_ipc_us_native_prio_dlock, 15);
#if HAVE_GLIB
add_tcase(s, tc, test_ipc_dispatch_us_glib_prio_dlock, 15);
add_tcase(s, tc, test_ipc_us_glib_prio_dlock, 15);
#endif

return s;
Expand Down
2 changes: 1 addition & 1 deletion tests/check_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ static void *loop_timer_thread(void *arg)
qb_loop_t *l = (qb_loop_t *)arg;
qb_loop_timer_handle test_tht;

res = qb_loop_timer_add(l, QB_LOOP_LOW, 5*QB_TIME_NS_IN_MSEC, l, one_shot_tmo, &test_tht);
res = qb_loop_timer_add(l, QB_LOOP_LOW, 10*QB_TIME_NS_IN_MSEC, l, one_shot_tmo, &test_tht);
ck_assert_int_eq(res, 0);

res = qb_loop_timer_is_running(l, test_tht);
Expand Down
8 changes: 4 additions & 4 deletions tests/resources.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ IPC_NAME=`cat ipc-test-name 2>/dev/null`
for d in /dev/shm /var/run $SOCKETDIR; do

# Tidy up the deadlock checker sockets first
dlocks=$(find $d -name qb-*-test_*dlock*${IPC_NAME}* -size +0c 2>/dev/null)
if [ `echo $dlocks|wc -w` -eq $(($SOCKS_PER_PROCESS * 6)) ]; then
dlocks=$(find $d -name "qb-*-test_*dlock*${IPC_NAME}*" -size +0c 2>/dev/null)
if [ "`echo $dlocks|wc -w`" -eq $(($SOCKS_PER_PROCESS * 6)) ]; then
rm $dlocks
elif [ -n "${dlocks}" ]; then
echo
Expand All @@ -17,14 +17,14 @@ for d in /dev/shm /var/run $SOCKETDIR; do
fi

# Now look for other leftovers
leftovers=$(find $d -name qb-*-test_*${IPC_NAME}* -size +0c 2>/dev/null | wc -l)
leftovers=$(find $d -name "qb-*-test_*${IPC_NAME}*" -size +0c 2>/dev/null | wc -l)
if [ "${leftovers}" -gt 0 ]; then
echo
echo "Error: shared memory segments not closed/unlinked"
echo
RETURN=1
fi
leftovers="$(find $d -name qb-*-test_*${IPC_NAME}* -size 0c 2>/dev/null)"
leftovers="$(find $d -name "qb-*-test_*${IPC_NAME}*" -size 0c 2>/dev/null)"
if [ "$(printf '%s\n' "${leftovers}" | wc -l)" -eq $(($SOCKS_PER_PROCESS * 2)) ]; then
echo
echo "There were some empty leftovers (expected), removing them"
Expand Down
6 changes: 4 additions & 2 deletions tests/start.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# which sockets are our and which we can ignore.
# The test programs all add "qb-test-<name>-" to the front of this.
#
NAME="$$-`date +%N`"
echo -n "$NAME" > ipc-test-name

NAME="$$-`date +%s`"

printf "$NAME" > ipc-test-name
mkdir -p $SOCKETDIR