diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-02-25 09:22:17 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-02-25 09:22:17 +0100 |
commit | 03e45f67ce326c004008516e35fd5b9e8c17cd08 (patch) | |
tree | 231439863e825c4914bbdd93ef1a13beba962795 /src | |
parent | 5e4cbb92beb575ad5b072334b42d66feb0f0c331 (diff) | |
download | gnunet-03e45f67ce326c004008516e35fd5b9e8c17cd08.tar.gz gnunet-03e45f67ce326c004008516e35fd5b9e8c17cd08.zip |
-fix namestore tests
Diffstat (limited to 'src')
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 1 | ||||
-rw-r--r-- | src/namestore/plugin_namestore_sqlite.c | 10 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_lookup_nick.c | 4 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_zone_to_name.c | 4 | ||||
-rwxr-xr-x | src/namestore/test_plugin_rest_namestore.sh | 2 |
5 files changed, 16 insertions, 5 deletions
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)" | |||
85 | name=$TEST_ID | 85 | name=$TEST_ID |
86 | public="$(gnunet-identity -d -c test_namestore_api.conf | grep $TEST_ID | awk 'NR==1{print $3}')" | 86 | public="$(gnunet-identity -d -c test_namestore_api.conf | grep $TEST_ID | awk 'NR==1{print $3}')" |
87 | echo "$name $public" | 87 | echo "$name $public" |
88 | valgrind gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "000G006WVZ8HQ5YTVFNX09HK0VJVVQ9ZCBYDSCH3ERT04N5ZRBKEB82EP8" -t "PKEY" -c test_namestore_api.conf | 88 | gnunet-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" |
90 | curl_get "${namestore_link}/$name" "HTTP/1.1 200 OK" | 90 | curl_get "${namestore_link}/$name" "HTTP/1.1 200 OK" |
91 | curl_get "${namestore_link}/$public" "error" | 91 | curl_get "${namestore_link}/$public" "error" |