aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_zone_iteration_stop.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-19 22:17:25 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-19 22:17:25 +0000
commit808ef8ab410b486c5cca7515389f608e965d53b1 (patch)
tree2a9476225227e3e550d95294db1c1b676bd23264 /src/namestore/test_namestore_api_zone_iteration_stop.c
parent50114769c42140782b3955e416d61837fe570d0b (diff)
downloadgnunet-808ef8ab410b486c5cca7515389f608e965d53b1.tar.gz
gnunet-808ef8ab410b486c5cca7515389f608e965d53b1.zip
-fixing testcases with new expiration code
Diffstat (limited to 'src/namestore/test_namestore_api_zone_iteration_stop.c')
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_stop.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c
index 71ae43362..d68441398 100644
--- a/src/namestore/test_namestore_api_zone_iteration_stop.c
+++ b/src/namestore/test_namestore_api_zone_iteration_stop.c
@@ -353,15 +353,15 @@ put_cont (void *cls, int32_t success, const char *emsg)
353 353
354 354
355static struct GNUNET_NAMESTORE_RecordData * 355static struct GNUNET_NAMESTORE_RecordData *
356create_record (int count) 356create_record (unsigned int count)
357{ 357{
358 int c; 358 unsigned int c;
359 struct GNUNET_NAMESTORE_RecordData * rd; 359 struct GNUNET_NAMESTORE_RecordData * rd;
360 rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
361 360
361 rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData));
362 for (c = 0; c < count; c++) 362 for (c = 0; c < count; c++)
363 { 363 {
364 rd[c].expiration = GNUNET_TIME_absolute_get(); 364 rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value;
365 rd[c].record_type = 1111; 365 rd[c].record_type = 1111;
366 rd[c].data_size = 50; 366 rd[c].data_size = 50;
367 rd[c].data = GNUNET_malloc(50); 367 rd[c].data = GNUNET_malloc(50);
@@ -376,6 +376,7 @@ run (void *cls,
376 const struct GNUNET_CONFIGURATION_Handle *cfg) 376 const struct GNUNET_CONFIGURATION_Handle *cfg)
377{ 377{
378 char *hostkey_file; 378 char *hostkey_file;
379 struct GNUNET_TIME_Absolute et;
379 380
380 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL); 381 endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL);
381 GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, 382 GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR,
@@ -403,7 +404,8 @@ run (void *cls,
403 404
404 GNUNET_asprintf(&s_name_1, "dummy1"); 405 GNUNET_asprintf(&s_name_1, "dummy1");
405 s_rd_1 = create_record(1); 406 s_rd_1 = create_record(1);
406 sig_1 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_1[0].expiration, s_name_1, s_rd_1, 1); 407 et.abs_value = s_rd_1[0].expiration_time;
408 sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1);
407 GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL); 409 GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL);
408 410
409 411
@@ -411,14 +413,16 @@ run (void *cls,
411 GNUNET_asprintf(&s_name_2, "dummy2"); 413 GNUNET_asprintf(&s_name_2, "dummy2");
412 s_rd_2 = create_record(1); 414 s_rd_2 = create_record(1);
413 415
414 sig_2 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_2[0].expiration, s_name_2, s_rd_2, 1); 416 et.abs_value = s_rd_2[0].expiration_time;
417 sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1);
415 GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL); 418 GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL);
416 419
417 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n"); 420 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n");
418 /* name in different zone */ 421 /* name in different zone */
419 GNUNET_asprintf(&s_name_3, "dummy3"); 422 GNUNET_asprintf(&s_name_3, "dummy3");
420 s_rd_3 = create_record(1); 423 s_rd_3 = create_record(1);
421 sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_rd_3[0].expiration, s_name_3, s_rd_3, 1); 424 et.abs_value = s_rd_3[0].expiration_time;
425 sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1);
422 GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); 426 GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL);
423} 427}
424 428