#include "platform.h"
#include "gnunet_common.h"
#include "gnunet_namestore_service.h"
-#include "gnunet_testing_lib-new.h"
+#include "gnunet_testing_lib.h"
#include "namestore.h"
#include "gnunet_signatures.h"
#define TEST_RECORD_DATA 'a'
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100)
static struct GNUNET_NAMESTORE_Handle * nsh;
endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
if (nsh != NULL)
- GNUNET_NAMESTORE_disconnect (nsh, GNUNET_YES);
+ GNUNET_NAMESTORE_disconnect (nsh);
nsh = NULL;
if (privkey != NULL)
GNUNET_CRYPTO_rsa_key_free (privkey);
GNUNET_CRYPTO_rsa_key_free (privkey);
privkey = NULL;
if (nsh != NULL)
- GNUNET_NAMESTORE_disconnect (nsh, GNUNET_YES);
+ GNUNET_NAMESTORE_disconnect (nsh);
nsh = NULL;
}
static void
run (void *cls,
- const struct GNUNET_CONFIGURATION_Handle *cfg)
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TESTING_Peer *peer)
{
+ struct GNUNET_TIME_Absolute et;
+
endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL);
GNUNET_asprintf(&s_name, "dummy");
/* load privat key */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_short_h2s (&s_zone_value));
struct GNUNET_NAMESTORE_RecordData rd;
- rd.expiration = GNUNET_TIME_absolute_get();
+ rd.expiration_time = GNUNET_TIME_absolute_get().abs_value;
rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY;
rd.data_size = sizeof (struct GNUNET_CRYPTO_ShortHashCode);
rd.data = GNUNET_malloc(sizeof (struct GNUNET_CRYPTO_ShortHashCode));
GNUNET_break (NULL != nsh);
expire = GNUNET_TIME_absolute_get ();
- s_signature = GNUNET_NAMESTORE_create_signature(privkey, rd.expiration, s_name, &rd, 1);
+ et.abs_value = rd.expiration_time;
+ s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, &rd, 1);
GNUNET_NAMESTORE_record_put(nsh, &pubkey, s_name, expire, 1, &rd, s_signature, put_cont, NULL);
GNUNET_free ((void *) rd.data);