diff options
author | t3sserakt <t3ss@posteo.de> | 2021-10-07 13:07:30 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2021-10-07 13:07:30 +0200 |
commit | d7fa0579995790840199ec86cb4d518f9d372fcd (patch) | |
tree | b41accedea6cd0fb78d75afee61911b94a1099fb /src/include/gnunet_testing_ng_lib.h | |
parent | 658bceab7ba3aab5121e8874d8508264d3f63ce3 (diff) | |
download | gnunet-d7fa0579995790840199ec86cb4d518f9d372fcd.tar.gz gnunet-d7fa0579995790840199ec86cb4d518f9d372fcd.zip |
- add generic topology configuration by file
- cmd simple send using file configuration from file
- added cmd to check the logs for backchannel encapsulation
- added cmd which notifies the master loop of local loop being prepared to finish
- added logging to helper.c
- moved code from connecting peers cmd into global functions
- added parameters given to the connecting peers cmd
- added assertion when notifying the transport service about a new queue, if the communicator has no intial capacity
- added optional valgrind cmd to test script
- added flag für queues with unlimited length
- added check for queues with higher priority
- added attribute queue_capacity to struct Queue
- bug fixing worker task for kce generation and transport notification about available queue in udp communicator
- change value for unlimited queue length from 0 to UINT16_MAX in tcp communicator and service
- added loop to stop the test system for the globally known peers in stop testsystem cmd
- refactored endless growing array to handle further messages from the local loops, and added logic to handle the local test prepare msg
- added utility methods in testing.c
- added forwarding of all tests prepared msg in gnunet-cmds-helper.c
- added cmd to end loop without shutdown
- added without shutdown cmd to simple send testcase
- added backchannel check, without shutdown and prepared cmd to udp backchannel testcase.
Diffstat (limited to 'src/include/gnunet_testing_ng_lib.h')
-rw-r--r-- | src/include/gnunet_testing_ng_lib.h | 97 |
1 files changed, 92 insertions, 5 deletions
diff --git a/src/include/gnunet_testing_ng_lib.h b/src/include/gnunet_testing_ng_lib.h index 31665f8f7..6138f567b 100644 --- a/src/include/gnunet_testing_ng_lib.h +++ b/src/include/gnunet_testing_ng_lib.h | |||
@@ -79,17 +79,17 @@ enum GNUNET_TESTING_NODE_TYPE | |||
79 | GNUNET_TESTING_GLOBAL_NODE | 79 | GNUNET_TESTING_GLOBAL_NODE |
80 | }; | 80 | }; |
81 | 81 | ||
82 | struct GNUNET_TESTING_ADDRESS_PREFIX | 82 | struct GNUNET_TESTING_AddressPrefix |
83 | { | 83 | { |
84 | /** | 84 | /** |
85 | * Pointer to the previous prefix in the DLL. | 85 | * Pointer to the previous prefix in the DLL. |
86 | */ | 86 | */ |
87 | struct GNUNET_TESTING_ADDRESS_PREFIX *prev; | 87 | struct GNUNET_TESTING_AddressPrefix *prev; |
88 | 88 | ||
89 | /** | 89 | /** |
90 | * Pointer to the next prefix in the DLL. | 90 | * Pointer to the next prefix in the DLL. |
91 | */ | 91 | */ |
92 | struct GNUNET_TESTING_ADDRESS_PREFIX *next; | 92 | struct GNUNET_TESTING_AddressPrefix *next; |
93 | 93 | ||
94 | /** | 94 | /** |
95 | * The address prefix. | 95 | * The address prefix. |
@@ -138,12 +138,12 @@ struct GNUNET_TESTING_NodeConnection | |||
138 | /** | 138 | /** |
139 | * Head of the DLL with the address prefixes for the protocolls this node is reachable. | 139 | * Head of the DLL with the address prefixes for the protocolls this node is reachable. |
140 | */ | 140 | */ |
141 | struct GNUNET_TESTING_ADDRESS_PREFIX *address_prefixes_head; | 141 | struct GNUNET_TESTING_AddressPrefix *address_prefixes_head; |
142 | 142 | ||
143 | /** | 143 | /** |
144 | * Tail of the DLL with the address prefixes for the protocolls this node is reachable. | 144 | * Tail of the DLL with the address prefixes for the protocolls this node is reachable. |
145 | */ | 145 | */ |
146 | struct GNUNET_TESTING_ADDRESS_PREFIX *address_prefixes_tail; | 146 | struct GNUNET_TESTING_AddressPrefix *address_prefixes_tail; |
147 | }; | 147 | }; |
148 | 148 | ||
149 | /** | 149 | /** |
@@ -379,6 +379,11 @@ struct GNUNET_TESTING_Command | |||
379 | */ | 379 | */ |
380 | bool asynchronous_finish; | 380 | bool asynchronous_finish; |
381 | 381 | ||
382 | /** | ||
383 | * Shall the scheduler shutdown, when end cmd is reach? | ||
384 | */ | ||
385 | bool shutdown_on_end; | ||
386 | |||
382 | }; | 387 | }; |
383 | 388 | ||
384 | 389 | ||
@@ -450,6 +455,15 @@ GNUNET_TESTING_cmd_end (void); | |||
450 | 455 | ||
451 | 456 | ||
452 | /** | 457 | /** |
458 | * Create command array terminator without shutdown. | ||
459 | * | ||
460 | * @return a end-command. | ||
461 | */ | ||
462 | struct GNUNET_TESTING_Command | ||
463 | GNUNET_TESTING_cmd_end_without_shutdown (void); | ||
464 | |||
465 | |||
466 | /** | ||
453 | * Turn asynchronous command into non blocking command by setting asynchronous_finish to true. | 467 | * Turn asynchronous command into non blocking command by setting asynchronous_finish to true. |
454 | * | 468 | * |
455 | * @param cmd command to make synchronous. | 469 | * @param cmd command to make synchronous. |
@@ -661,6 +675,55 @@ GNUNET_TESTING_get_topo_from_file (const char *filename); | |||
661 | 675 | ||
662 | 676 | ||
663 | /** | 677 | /** |
678 | * Get the connections to other nodes for a specific node. | ||
679 | * | ||
680 | * @param num The specific node we want the connections for. | ||
681 | * @param topology The topology we get the connections from. | ||
682 | * @return The connections of the node. | ||
683 | */ | ||
684 | struct GNUNET_TESTING_NodeConnection * | ||
685 | GNUNET_TESTING_get_connections (unsigned int num, struct | ||
686 | GNUNET_TESTING_NetjailTopology *topology); | ||
687 | |||
688 | |||
689 | /** | ||
690 | * Get the address for a specific communicator from a connection. | ||
691 | * | ||
692 | * @param connection The connection we like to have the address from. | ||
693 | * @param prefix The communicator protocol prefix. | ||
694 | * @return The address of the communicator. | ||
695 | */ | ||
696 | char * | ||
697 | GNUNET_TESTING_get_address (struct GNUNET_TESTING_NodeConnection *connection, | ||
698 | char *prefix); | ||
699 | |||
700 | |||
701 | /** | ||
702 | * Calculate the unique id identifying a node from a given connction. | ||
703 | * | ||
704 | * @param node_connection The connection we calculate the id from. | ||
705 | * @param topology The topology we get all needed information from. | ||
706 | * @return The unique id of the node from the connection. | ||
707 | */ | ||
708 | unsigned int | ||
709 | GNUNET_TESTING_calculate_num (struct | ||
710 | GNUNET_TESTING_NodeConnection *node_connection, | ||
711 | struct GNUNET_TESTING_NetjailTopology *topology); | ||
712 | |||
713 | |||
714 | /** | ||
715 | * Retrieve the public key from the test system with the unique node id. | ||
716 | * | ||
717 | * @param num The unique node id. | ||
718 | * @param tl_system The test system. | ||
719 | * @return The peer identity wrapping the public key. | ||
720 | */ | ||
721 | struct GNUNET_PeerIdentity * | ||
722 | GNUNET_TESTING_get_pub_key (unsigned int num, struct | ||
723 | GNUNET_TESTING_System *tl_system); | ||
724 | |||
725 | |||
726 | /** | ||
664 | * Obtain performance data from the interpreter. | 727 | * Obtain performance data from the interpreter. |
665 | * | 728 | * |
666 | * @param timers what commands (by label) to obtain runtimes for | 729 | * @param timers what commands (by label) to obtain runtimes for |
@@ -1183,12 +1246,36 @@ GNUNET_TESTING_cmd_block_until_external_trigger (const char *label, | |||
1183 | unsigned int * | 1246 | unsigned int * |
1184 | stop_blocking); | 1247 | stop_blocking); |
1185 | 1248 | ||
1249 | |||
1186 | struct GNUNET_TESTING_Command | 1250 | struct GNUNET_TESTING_Command |
1187 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, | 1251 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, |
1188 | TESTING_CMD_HELPER_write_cb write_message); | 1252 | TESTING_CMD_HELPER_write_cb write_message); |
1189 | 1253 | ||
1254 | |||
1255 | /** | ||
1256 | * Create command. | ||
1257 | * | ||
1258 | * @param label name for command. | ||
1259 | * @param write_message Callback to write messages to the master loop. | ||
1260 | * @return command. | ||
1261 | */ | ||
1190 | struct GNUNET_TESTING_Command | 1262 | struct GNUNET_TESTING_Command |
1191 | GNUNET_TESTING_cmd_local_test_finished (const char *label, | 1263 | GNUNET_TESTING_cmd_local_test_finished (const char *label, |
1192 | TESTING_CMD_HELPER_write_cb | 1264 | TESTING_CMD_HELPER_write_cb |
1193 | write_message); | 1265 | write_message); |
1266 | |||
1267 | /** | ||
1268 | * Create command. | ||
1269 | * | ||
1270 | * @param label name for command. | ||
1271 | * @param write_message Callback to write messages to the master loop. | ||
1272 | * @param all_local_tests_prepared Flag which will be set from outside. | ||
1273 | * @return command. | ||
1274 | */ | ||
1275 | struct GNUNET_TESTING_Command | ||
1276 | GNUNET_TESTING_cmd_local_test_prepared (const char *label, | ||
1277 | TESTING_CMD_HELPER_write_cb | ||
1278 | write_message, | ||
1279 | unsigned int * | ||
1280 | all_local_tests_prepared); | ||
1194 | #endif | 1281 | #endif |