aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-02-25 09:22:17 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2022-02-25 09:22:17 +0100
commit03e45f67ce326c004008516e35fd5b9e8c17cd08 (patch)
tree231439863e825c4914bbdd93ef1a13beba962795
parent5e4cbb92beb575ad5b072334b42d66feb0f0c331 (diff)
downloadgnunet-03e45f67ce326c004008516e35fd5b9e8c17cd08.tar.gz
gnunet-03e45f67ce326c004008516e35fd5b9e8c17cd08.zip
-fix namestore tests
m---------contrib/gana0
-rw-r--r--po/POTFILES.in3
-rw-r--r--src/namestore/gnunet-service-namestore.c1
-rw-r--r--src/namestore/plugin_namestore_sqlite.c10
-rw-r--r--src/namestore/test_namestore_api_lookup_nick.c4
-rw-r--r--src/namestore/test_namestore_api_zone_to_name.c4
-rwxr-xr-xsrc/namestore/test_plugin_rest_namestore.sh2
7 files changed, 19 insertions, 5 deletions
diff --git a/contrib/gana b/contrib/gana
Subproject 24eb905bac48869b4184801571c0728c772b299 Subproject ca97ba9b2ba3d47197456dec2ec4a4c9358329f
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 5c1152e7c..d2e44dec1 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -175,6 +175,7 @@ src/gns/nss/nss_gns_query.c
175src/gns/plugin_block_gns.c 175src/gns/plugin_block_gns.c
176src/gns/plugin_gnsrecord_gns.c 176src/gns/plugin_gnsrecord_gns.c
177src/gns/plugin_rest_gns.c 177src/gns/plugin_rest_gns.c
178src/gns/test.c
178src/gnsrecord/gnsrecord.c 179src/gnsrecord/gnsrecord.c
179src/gnsrecord/gnsrecord_crypto.c 180src/gnsrecord/gnsrecord_crypto.c
180src/gnsrecord/gnsrecord_misc.c 181src/gnsrecord/gnsrecord_misc.c
@@ -182,6 +183,7 @@ src/gnsrecord/gnsrecord_serialization.c
182src/gnsrecord/gnunet-gnsrecord-tvg.c 183src/gnsrecord/gnunet-gnsrecord-tvg.c
183src/gnsrecord/json_gnsrecord.c 184src/gnsrecord/json_gnsrecord.c
184src/gnsrecord/plugin_gnsrecord_dns.c 185src/gnsrecord/plugin_gnsrecord_dns.c
186src/gnsrecord/test.c
185src/hello/address.c 187src/hello/address.c
186src/hello/gnunet-hello.c 188src/hello/gnunet-hello.c
187src/hello/hello-ng.c 189src/hello/hello-ng.c
@@ -314,6 +316,7 @@ src/reclaim/plugin_rest_reclaim.c
314src/reclaim/reclaim_api.c 316src/reclaim/reclaim_api.c
315src/reclaim/reclaim_attribute.c 317src/reclaim/reclaim_attribute.c
316src/reclaim/reclaim_credential.c 318src/reclaim/reclaim_credential.c
319src/reclaim/test.c
317src/regex/gnunet-daemon-regexprofiler.c 320src/regex/gnunet-daemon-regexprofiler.c
318src/regex/gnunet-regex-profiler.c 321src/regex/gnunet-regex-profiler.c
319src/regex/gnunet-regex-simulation-profiler.c 322src/regex/gnunet-regex-simulation-profiler.c
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index 57147879f..ab8771e3f 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -1668,6 +1668,7 @@ handle_record_store (void *cls, const struct RecordStoreMessage *rp_msg)
1668 send_store_response (nc, res, _("Store failed"), rid); 1668 send_store_response (nc, res, _("Store failed"), rid);
1669 GNUNET_SERVICE_client_continue (nc->client); 1669 GNUNET_SERVICE_client_continue (nc->client);
1670 GNUNET_free (conv_name); 1670 GNUNET_free (conv_name);
1671 return;
1671 } 1672 }
1672 1673
1673 sa = GNUNET_malloc (sizeof(struct StoreActivity) 1674 sa = GNUNET_malloc (sizeof(struct StoreActivity)
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c
index 7cb9b7ed0..0b3aac84f 100644
--- a/src/namestore/plugin_namestore_sqlite.c
+++ b/src/namestore/plugin_namestore_sqlite.c
@@ -329,6 +329,11 @@ namestore_sqlite_store_records (void *cls,
329 0, 329 0,
330 sizeof(pkey)); 330 sizeof(pkey));
331 for (unsigned int i = 0; i < rd_count; i++) 331 for (unsigned int i = 0; i < rd_count; i++)
332 {
333 LOG (GNUNET_ERROR_TYPE_DEBUG,
334 "Checking if `%d' is zonekey type\n",
335 rd[i].record_type);
336
332 if (GNUNET_YES == GNUNET_GNSRECORD_is_zonekey_type (rd[i].record_type)) 337 if (GNUNET_YES == GNUNET_GNSRECORD_is_zonekey_type (rd[i].record_type))
333 { 338 {
334 GNUNET_break (GNUNET_YES == 339 GNUNET_break (GNUNET_YES ==
@@ -336,8 +341,13 @@ namestore_sqlite_store_records (void *cls,
336 rd[i].data_size, 341 rd[i].data_size,
337 rd[i].record_type, 342 rd[i].record_type,
338 &pkey)); 343 &pkey));
344 LOG (GNUNET_ERROR_TYPE_DEBUG,
345 "Storing delegation zone record value `%s'\n",
346 GNUNET_GNSRECORD_z2s (&pkey));
347
339 break; 348 break;
340 } 349 }
350 }
341 rvalue = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 351 rvalue = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
342 UINT64_MAX); 352 UINT64_MAX);
343 data_size = GNUNET_GNSRECORD_records_get_size (rd_count, 353 data_size = GNUNET_GNSRECORD_records_get_size (rd_count,
diff --git a/src/namestore/test_namestore_api_lookup_nick.c b/src/namestore/test_namestore_api_lookup_nick.c
index 6ce969c9b..7decf39f8 100644
--- a/src/namestore/test_namestore_api_lookup_nick.c
+++ b/src/namestore/test_namestore_api_lookup_nick.c
@@ -262,12 +262,12 @@ nick_cont (void *cls, int32_t success, const char *emsg)
262 "Nick added : %s\n", 262 "Nick added : %s\n",
263 (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); 263 (success == GNUNET_OK) ? "SUCCESS" : "FAIL");
264 264
265 rd_orig.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; 265 rd_orig.expiration_time = GNUNET_TIME_UNIT_HOURS.rel_value_us;
266 rd_orig.record_type = TEST_RECORD_TYPE; 266 rd_orig.record_type = TEST_RECORD_TYPE;
267 rd_orig.data_size = TEST_RECORD_DATALEN; 267 rd_orig.data_size = TEST_RECORD_DATALEN;
268 record_data = GNUNET_malloc (TEST_RECORD_DATALEN); 268 record_data = GNUNET_malloc (TEST_RECORD_DATALEN);
269 rd_orig.data = record_data; 269 rd_orig.data = record_data;
270 rd_orig.flags = 0; 270 rd_orig.flags = GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
271 memset ((char *) rd_orig.data, 'a', TEST_RECORD_DATALEN); 271 memset ((char *) rd_orig.data, 'a', TEST_RECORD_DATALEN);
272 272
273 nsqe = GNUNET_NAMESTORE_records_store (nsh, &privkey, 273 nsqe = GNUNET_NAMESTORE_records_store (nsh, &privkey,
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c
index 8efdba453..1e2f8248b 100644
--- a/src/namestore/test_namestore_api_zone_to_name.c
+++ b/src/namestore/test_namestore_api_zone_to_name.c
@@ -216,11 +216,11 @@ run (void *cls,
216 { 216 {
217 struct GNUNET_GNSRECORD_Data rd; 217 struct GNUNET_GNSRECORD_Data rd;
218 218
219 rd.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; 219 rd.expiration_time = GNUNET_TIME_UNIT_HOURS.rel_value_us;
220 rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY; 220 rd.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
221 rd.data_size = sizeof (s_zone_value.ecdsa_key); 221 rd.data_size = sizeof (s_zone_value.ecdsa_key);
222 rd.data = &s_zone_value.ecdsa_key; 222 rd.data = &s_zone_value.ecdsa_key;
223 rd.flags = 0; 223 rd.flags = GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
224 224
225 nsh = GNUNET_NAMESTORE_connect (cfg); 225 nsh = GNUNET_NAMESTORE_connect (cfg);
226 GNUNET_break (NULL != nsh); 226 GNUNET_break (NULL != nsh);
diff --git a/src/namestore/test_plugin_rest_namestore.sh b/src/namestore/test_plugin_rest_namestore.sh
index 8a45cebf5..3c559a0b3 100755
--- a/src/namestore/test_plugin_rest_namestore.sh
+++ b/src/namestore/test_plugin_rest_namestore.sh
@@ -85,7 +85,7 @@ test="$(gnunet-namestore -D -z $TEST_ID -c test_namestore_api.conf)"
85name=$TEST_ID 85name=$TEST_ID
86public="$(gnunet-identity -d -c test_namestore_api.conf | grep $TEST_ID | awk 'NR==1{print $3}')" 86public="$(gnunet-identity -d -c test_namestore_api.conf | grep $TEST_ID | awk 'NR==1{print $3}')"
87echo "$name $public" 87echo "$name $public"
88valgrind gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8" -t "PKEY" -c test_namestore_api.conf 88gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8" -t "PKEY" -c test_namestore_api.conf
89#curl_get "${namestore_link}" "HTTP/1.1 200 OK" 89#curl_get "${namestore_link}" "HTTP/1.1 200 OK"
90curl_get "${namestore_link}/$name" "HTTP/1.1 200 OK" 90curl_get "${namestore_link}/$name" "HTTP/1.1 200 OK"
91curl_get "${namestore_link}/$public" "error" 91curl_get "${namestore_link}/$public" "error"