diff options
author | t3sserakt <t3ss@posteo.de> | 2020-12-08 10:47:51 +0100 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2020-12-08 10:47:51 +0100 |
commit | 6e3ca264f69ea03520c5855161d1c8487c1e4e01 (patch) | |
tree | 5a2c0a6b1993986c9d9bf361e24dfae5f48a94a4 /src/transport/transport-testing2.c | |
parent | 97782d1a85e43d55626b150c06b6479afd8d20d6 (diff) | |
download | gnunet-6e3ca264f69ea03520c5855161d1c8487c1e4e01.tar.gz gnunet-6e3ca264f69ea03520c5855161d1c8487c1e4e01.zip |
- added testing logic for backchannel and rekey tests. Fixed bugs for rekey logic.
Diffstat (limited to 'src/transport/transport-testing2.c')
-rw-r--r-- | src/transport/transport-testing2.c | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c index 076fbf331..70f68d3f8 100644 --- a/src/transport/transport-testing2.c +++ b/src/transport/transport-testing2.c | |||
@@ -827,9 +827,9 @@ communicator_start ( | |||
827 | 827 | ||
828 | 828 | ||
829 | /** | 829 | /** |
830 | * @brief Task run at shutdown to kill communicator and clean up | 830 | * @brief Task run at shutdown to kill NAT and clean up |
831 | * | 831 | * |
832 | * @param cls Closure - Process of communicator | 832 | * @param cls Closure - Process of NAT |
833 | */ | 833 | */ |
834 | static void | 834 | static void |
835 | shutdown_nat (void *cls) | 835 | shutdown_nat (void *cls) |
@@ -838,6 +838,17 @@ shutdown_nat (void *cls) | |||
838 | shutdown_process (proc); | 838 | shutdown_process (proc); |
839 | } | 839 | } |
840 | 840 | ||
841 | /** | ||
842 | * @brief Task run at shutdown to kill statistics service and clean up | ||
843 | * | ||
844 | * @param cls Closure - Process of statistics service | ||
845 | */ | ||
846 | static void | ||
847 | shutdown_statistics (void *cls) | ||
848 | { | ||
849 | struct GNUNET_OS_Process *proc = cls; | ||
850 | shutdown_process (proc); | ||
851 | } | ||
841 | 852 | ||
842 | /** | 853 | /** |
843 | * @brief Task run at shutdown to kill the resolver process | 854 | * @brief Task run at shutdown to kill the resolver process |
@@ -942,6 +953,38 @@ nat_start ( | |||
942 | GNUNET_free (binary); | 953 | GNUNET_free (binary); |
943 | } | 954 | } |
944 | 955 | ||
956 | /** | ||
957 | * @brief Start statistics | ||
958 | * | ||
959 | */ | ||
960 | static void | ||
961 | statistics_start ( | ||
962 | struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h) | ||
963 | { | ||
964 | char *binary; | ||
965 | |||
966 | LOG (GNUNET_ERROR_TYPE_DEBUG, "statistics_start\n"); | ||
967 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); | ||
968 | tc_h->statistics_proc = GNUNET_OS_start_process ( | ||
969 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR | ||
970 | | GNUNET_OS_USE_PIPE_CONTROL, | ||
971 | NULL, | ||
972 | NULL, | ||
973 | NULL, | ||
974 | binary, | ||
975 | "gnunet-service-statistics", | ||
976 | "-c", | ||
977 | tc_h->cfg_filename, | ||
978 | NULL); | ||
979 | if (NULL == tc_h->statistics_proc) | ||
980 | { | ||
981 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start statistics service!"); | ||
982 | return; | ||
983 | } | ||
984 | LOG (GNUNET_ERROR_TYPE_INFO, "started statistics service\n"); | ||
985 | GNUNET_free (binary); | ||
986 | } | ||
987 | |||
945 | 988 | ||
946 | /** | 989 | /** |
947 | * @brief Start communicator part of transport service and communicator | 990 | * @brief Start communicator part of transport service and communicator |
@@ -1009,6 +1052,8 @@ GNUNET_TRANSPORT_TESTING_transport_communicator_service_start ( | |||
1009 | resolver_start (tc_h); | 1052 | resolver_start (tc_h); |
1010 | /* Start peerstore service */ | 1053 | /* Start peerstore service */ |
1011 | peerstore_start (tc_h); | 1054 | peerstore_start (tc_h); |
1055 | /* Start statistics service */ | ||
1056 | statistics_start (tc_h); | ||
1012 | /* Schedule start communicator */ | 1057 | /* Schedule start communicator */ |
1013 | communicator_start (tc_h, | 1058 | communicator_start (tc_h, |
1014 | binary_name); | 1059 | binary_name); |
@@ -1025,6 +1070,7 @@ GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop ( | |||
1025 | shutdown_nat (tc_h->nat_proc); | 1070 | shutdown_nat (tc_h->nat_proc); |
1026 | shutdown_resolver (tc_h->resolver_proc); | 1071 | shutdown_resolver (tc_h->resolver_proc); |
1027 | shutdown_peerstore (tc_h->ps_proc); | 1072 | shutdown_peerstore (tc_h->ps_proc); |
1073 | shutdown_statistics (tc_h->statistics_proc); | ||
1028 | GNUNET_CONFIGURATION_destroy (tc_h->cfg); | 1074 | GNUNET_CONFIGURATION_destroy (tc_h->cfg); |
1029 | GNUNET_free (tc_h); | 1075 | GNUNET_free (tc_h); |
1030 | } | 1076 | } |