diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-05-01 12:44:39 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-05-01 12:44:39 +0200 |
commit | a5e3e870f27c8ef3a3cd5d59a686a3050f9c64fb (patch) | |
tree | 6eec8a07a9a932d3c7b36f196ad01428e4f0ed63 /src/namestore/test_namestore_api_remove.c | |
parent | 8f2f5bc2ee8ebf9b059b7b7e3104f25c5c363458 (diff) | |
download | gnunet-a5e3e870f27c8ef3a3cd5d59a686a3050f9c64fb.tar.gz gnunet-a5e3e870f27c8ef3a3cd5d59a686a3050f9c64fb.zip |
more extensive namestore tests for the non-sqlite plugins, with bugfixes
Diffstat (limited to 'src/namestore/test_namestore_api_remove.c')
-rw-r--r-- | src/namestore/test_namestore_api_remove.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index 2d670c1ee..532a751da 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c | |||
@@ -120,7 +120,8 @@ remove_cont (void *cls, | |||
120 | 120 | ||
121 | 121 | ||
122 | static void | 122 | static void |
123 | put_cont (void *cls, int32_t success, | 123 | put_cont (void *cls, |
124 | int32_t success, | ||
124 | const char *emsg) | 125 | const char *emsg) |
125 | { | 126 | { |
126 | const char *name = cls; | 127 | const char *name = cls; |
@@ -161,20 +162,27 @@ run (void *cls, | |||
161 | 162 | ||
162 | directory = NULL; | 163 | directory = NULL; |
163 | GNUNET_assert (GNUNET_OK == | 164 | GNUNET_assert (GNUNET_OK == |
164 | GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "GNUNET_TEST_HOME", &directory)); | 165 | GNUNET_CONFIGURATION_get_value_string(cfg, |
166 | "PATHS", | ||
167 | "GNUNET_TEST_HOME", | ||
168 | &directory)); | ||
165 | GNUNET_DISK_directory_remove (directory); | 169 | GNUNET_DISK_directory_remove (directory); |
166 | 170 | ||
167 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 171 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
168 | &endbadly, NULL); | 172 | &endbadly, |
173 | NULL); | ||
169 | GNUNET_asprintf (&hostkey_file, | 174 | GNUNET_asprintf (&hostkey_file, |
170 | "zonefiles%s%s", | 175 | "zonefiles%s%s", |
171 | DIR_SEPARATOR_STR, | 176 | DIR_SEPARATOR_STR, |
172 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); | 177 | "N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey"); |
173 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using zonekey file `%s' \n", hostkey_file); | 178 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
179 | "Using zonekey file `%s' \n", | ||
180 | hostkey_file); | ||
174 | privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file (hostkey_file); | 181 | privkey = GNUNET_CRYPTO_ecdsa_key_create_from_file (hostkey_file); |
175 | GNUNET_free (hostkey_file); | 182 | GNUNET_free (hostkey_file); |
176 | GNUNET_assert (privkey != NULL); | 183 | GNUNET_assert (privkey != NULL); |
177 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, &pubkey); | 184 | GNUNET_CRYPTO_ecdsa_key_get_public (privkey, |
185 | &pubkey); | ||
178 | 186 | ||
179 | removed = GNUNET_NO; | 187 | removed = GNUNET_NO; |
180 | 188 | ||
@@ -201,15 +209,23 @@ run (void *cls, | |||
201 | int | 209 | int |
202 | main (int argc, char *argv[]) | 210 | main (int argc, char *argv[]) |
203 | { | 211 | { |
212 | const char *plugin_name; | ||
213 | char *cfg_name; | ||
214 | |||
215 | plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]); | ||
216 | GNUNET_asprintf (&cfg_name, | ||
217 | "test_namestore_api_%s.conf", | ||
218 | plugin_name); | ||
204 | res = 1; | 219 | res = 1; |
205 | if (0 != | 220 | if (0 != |
206 | GNUNET_TESTING_peer_run ("test-namestore-api", | 221 | GNUNET_TESTING_peer_run ("test-namestore-api-remove", |
207 | "test_namestore_api.conf", | 222 | cfg_name, |
208 | &run, | 223 | &run, |
209 | NULL)) | 224 | NULL)) |
210 | { | 225 | { |
211 | res = 1; | 226 | res = 1; |
212 | } | 227 | } |
228 | GNUNET_free (cfg_name); | ||
213 | if (NULL != directory) | 229 | if (NULL != directory) |
214 | { | 230 | { |
215 | GNUNET_DISK_directory_remove (directory); | 231 | GNUNET_DISK_directory_remove (directory); |