aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/test_namestore_api_lookup_nick.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/test_namestore_api_lookup_nick.c')
-rw-r--r--src/namestore/test_namestore_api_lookup_nick.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/namestore/test_namestore_api_lookup_nick.c b/src/namestore/test_namestore_api_lookup_nick.c
index 145a3e885..628e76254 100644
--- a/src/namestore/test_namestore_api_lookup_nick.c
+++ b/src/namestore/test_namestore_api_lookup_nick.c
@@ -23,6 +23,7 @@
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_namestore_service.h" 25#include "gnunet_namestore_service.h"
26#include "gnunet_gns_service.h"
26#include "gnunet_testing_lib.h" 27#include "gnunet_testing_lib.h"
27#include "gnunet_dnsparser_lib.h" 28#include "gnunet_dnsparser_lib.h"
28 29
@@ -280,6 +281,8 @@ run (void *cls,
280 const struct GNUNET_CONFIGURATION_Handle *cfg, 281 const struct GNUNET_CONFIGURATION_Handle *cfg,
281 struct GNUNET_TESTING_Peer *peer) 282 struct GNUNET_TESTING_Peer *peer)
282{ 283{
284 struct GNUNET_GNSRECORD_Data rd;
285
283 endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, 286 endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
284 &endbadly, 287 &endbadly,
285 NULL); 288 NULL);
@@ -290,11 +293,20 @@ run (void *cls,
290 nsh = GNUNET_NAMESTORE_connect (cfg); 293 nsh = GNUNET_NAMESTORE_connect (cfg);
291 GNUNET_break (NULL != nsh); 294 GNUNET_break (NULL != nsh);
292 295
293 nsqe = GNUNET_NAMESTORE_set_nick (nsh, 296 memset (&rd, 0, sizeof(rd));
294 &privkey, 297 rd.data = TEST_NICK;
295 TEST_NICK, 298 rd.data_size = strlen (TEST_NICK) + 1;
296 &nick_cont, 299 rd.record_type = GNUNET_GNSRECORD_TYPE_NICK;
297 (void *) name); 300 rd.expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
301 rd.flags |= GNUNET_GNSRECORD_RF_PRIVATE;
302 nsqe = GNUNET_NAMESTORE_records_store (nsh,
303 &privkey,
304 GNUNET_GNS_EMPTY_LABEL_AT,
305 1,
306 &rd,
307 &nick_cont,
308 (void *) name);
309
298 if (NULL == nsqe) 310 if (NULL == nsqe)
299 { 311 {
300 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 312 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,