check_PROGRAMS = \
test_lockmanager_api \
test_lockmanager_api_lockrelease \
- test_lockmanager_api_servercrash
+ test_lockmanager_api_servercrash \
+ test_lockmanager_api_acquireretry
EXTRA_DIST = \
test_lockmanager_api.conf
if ENABLE_TEST_RUN
-TESTS = $(check_PROGRAMS)
+ TESTS = $(check_PROGRAMS)
endif
test_lockmanager_api_SOURCES = \
test_lockmanager_api_servercrash_LDADD = \
$(top_builddir)/src/util/libgnunetutil.la \
libgnunetlockmanager.la
+
+test_lockmanager_api_acquireretry_SOURCES = \
+ test_lockmanager_api_acquireretry.c
+test_lockmanager_api_acquireretry_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ libgnunetlockmanager.la
\ No newline at end of file
struct GNUNET_LOCKMANAGER_Handle *h = cls;
struct GNUNET_LOCKMANAGER_Message *msg;
+ msg = generate_acquire_msg (r->domain, r->lock);
+ queue_message (h, msg);
if (GNUNET_LOCKMANAGER_RELEASE == r->status)
return GNUNET_YES;
if (NULL != r->status_cb)
r->status_cb (r->status_cb_cls,
r->domain,
r->lock,
- GNUNET_LOCKMANAGER_RELEASE);
+ GNUNET_LOCKMANAGER_RELEASE);
}
- msg = generate_acquire_msg (r->domain, r->lock);
- queue_message (h, msg);
return GNUNET_YES;
}
/**
* Client has successfully acquired the lock
*/
- TEST_CLIENT_LOCK_SUCESS,
+ TEST_CLIENT_LOCK_SUCCESS,
/**
* Client has lost the lock
/**
* Configuration Handle
*/
-static struct GNUNET_CONFIGURATION_Handle *config;
+static const struct GNUNET_CONFIGURATION_Handle *config;
/**
* The handle to the lockmanager service
GNUNET_OS_process_wait (arm_pid);
GNUNET_OS_process_destroy (arm_pid);
}
- if (NULL != config)
- GNUNET_CONFIGURATION_destroy (config);
}
/**
GNUNET_assert (NULL != arm_pid);
break;
case TEST_CLIENT_LOCK_RELEASE:
- GNUNET_asset (handle == cls);
+ GNUNET_assert (handle == cls);
GNUNET_assert (GNUNET_LOCKMANAGER_SUCCESS == status);
result = TEST_CLIENT_LOCK_AGAIN_SUCCESS;
GNUNET_LOCKMANAGER_cancel_request (request);
&status_cb,
handle);
GNUNET_assert (NULL != request);
- abort_task_id = GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS (10),
+ abort_task_id = GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS (30),
&do_abort,
NULL);
}