diff options
-rw-r--r-- | src/testing/testing.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c index ab85db4d5..70eebc3cc 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -1164,20 +1164,6 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system, | |||
1164 | ss_instances = NULL; | 1164 | ss_instances = NULL; |
1165 | if (NULL != emsg) | 1165 | if (NULL != emsg) |
1166 | *emsg = NULL; | 1166 | *emsg = NULL; |
1167 | /* Remove sections for shared services */ | ||
1168 | for (cnt = 0; cnt < system->n_shared_services; cnt++) | ||
1169 | { | ||
1170 | ss = system->shared_services[cnt]; | ||
1171 | GNUNET_CONFIGURATION_remove_section (cfg, ss->sname); | ||
1172 | } | ||
1173 | if (GNUNET_OK != GNUNET_TESTING_configuration_create_ (system, cfg, | ||
1174 | &ports, &nports)) | ||
1175 | { | ||
1176 | GNUNET_asprintf (&emsg_, | ||
1177 | _("Failed to create configuration for peer " | ||
1178 | "(not enough free ports?)\n")); | ||
1179 | goto err_ret; | ||
1180 | } | ||
1181 | if (key_number >= system->total_hostkeys) | 1167 | if (key_number >= system->total_hostkeys) |
1182 | { | 1168 | { |
1183 | GNUNET_asprintf (&emsg_, | 1169 | GNUNET_asprintf (&emsg_, |
@@ -1193,9 +1179,30 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system, | |||
1193 | _("Failed to initialize hostkey for peer %u\n"), | 1179 | _("Failed to initialize hostkey for peer %u\n"), |
1194 | (unsigned int) key_number); | 1180 | (unsigned int) key_number); |
1195 | goto err_ret; | 1181 | goto err_ret; |
1196 | } | 1182 | } |
1197 | if (NULL != pk) | 1183 | if (NULL != pk) |
1198 | GNUNET_CRYPTO_ecc_key_free (pk); | 1184 | GNUNET_CRYPTO_ecc_key_free (pk); |
1185 | if (GNUNET_NO == | ||
1186 | GNUNET_CONFIGURATION_have_value (cfg, "PEER", "PRIVATE_KEY")) | ||
1187 | { | ||
1188 | GNUNET_asprintf (&emsg_, | ||
1189 | _("PRIVATE_KEY option in PEER section missing in configuration\n")); | ||
1190 | goto err_ret; | ||
1191 | } | ||
1192 | /* Remove sections for shared services */ | ||
1193 | for (cnt = 0; cnt < system->n_shared_services; cnt++) | ||
1194 | { | ||
1195 | ss = system->shared_services[cnt]; | ||
1196 | GNUNET_CONFIGURATION_remove_section (cfg, ss->sname); | ||
1197 | } | ||
1198 | if (GNUNET_OK != GNUNET_TESTING_configuration_create_ (system, cfg, | ||
1199 | &ports, &nports)) | ||
1200 | { | ||
1201 | GNUNET_asprintf (&emsg_, | ||
1202 | _("Failed to create configuration for peer " | ||
1203 | "(not enough free ports?)\n")); | ||
1204 | goto err_ret; | ||
1205 | } | ||
1199 | GNUNET_assert (GNUNET_OK == | 1206 | GNUNET_assert (GNUNET_OK == |
1200 | GNUNET_CONFIGURATION_get_value_filename (cfg, "PEER", | 1207 | GNUNET_CONFIGURATION_get_value_filename (cfg, "PEER", |
1201 | "PRIVATE_KEY", | 1208 | "PRIVATE_KEY", |