aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/Makefile.am1
-rw-r--r--src/transport/test_plugin_hostkeybin0 -> 914 bytes
-rw-r--r--src/transport/test_plugin_transport.c21
3 files changed, 22 insertions, 0 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index df238d338..b8d220e72 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -839,6 +839,7 @@ test_transport_api_multi_LDADD = \
839 839
840 840
841EXTRA_DIST = \ 841EXTRA_DIST = \
842test_plugin_hostkey \
842gnunet-transport-certificate-creation \ 843gnunet-transport-certificate-creation \
843template_cfg_peer1.conf\ 844template_cfg_peer1.conf\
844template_cfg_peer2.conf\ 845template_cfg_peer2.conf\
diff --git a/src/transport/test_plugin_hostkey b/src/transport/test_plugin_hostkey
new file mode 100644
index 000000000..13f1dc9b3
--- /dev/null
+++ b/src/transport/test_plugin_hostkey
Binary files differ
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c
index e512716bc..07a20adad 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -43,6 +43,8 @@
43#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 43#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
44#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 44#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
45 45
46#define HOSTKEY_FILE "test_plugin_hostkey"
47
46/** 48/**
47 * Our public key. 49 * Our public key.
48 */ 50 */
@@ -547,6 +549,23 @@ run (void *cls, char *const *args, const char *cfgfile,
547 return; 549 return;
548 } 550 }
549 551
552 if (GNUNET_OK != GNUNET_DISK_file_test (HOSTKEY_FILE))
553 {
554 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
555 _("Hostkey `%s' missing. Exiting.\n"),
556 HOSTKEY_FILE);
557 }
558
559 if (GNUNET_OK != GNUNET_DISK_file_copy (HOSTKEY_FILE, keyfile))
560 {
561 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
562 _("Could not copy hostkey `%s' to destination `%s'. Exiting.\n"),
563 HOSTKEY_FILE, keyfile);
564 end_badly_now ();
565 return;
566 }
567
568
550 max_connect_per_transport = (uint32_t) tneigh; 569 max_connect_per_transport = (uint32_t) tneigh;
551 my_private_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile); 570 my_private_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile);
552 GNUNET_free (keyfile); 571 GNUNET_free (keyfile);
@@ -674,6 +693,8 @@ main (int argc, char *const *argv)
674 }; 693 };
675 int ret; 694 int ret;
676 695
696 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-plugin-transport");
697
677 char *const argv_prog[] = { 698 char *const argv_prog[] = {
678 "test_plugin_transport", 699 "test_plugin_transport",
679 "-c", 700 "-c",