diff options
author | t3sserakt <t3ss@posteo.de> | 2021-08-17 19:57:12 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2021-08-17 19:57:12 +0200 |
commit | 32a8c505c1fa27bb43c4e7c8d288566d51417f56 (patch) | |
tree | 0328fe50b6a099b5020fe6d1e01cbd6b96ecd18a /src/include | |
parent | 1e063cd73452396778cf00127346b9b08a922317 (diff) | |
download | gnunet-32a8c505c1fa27bb43c4e7c8d288566d51417f56.tar.gz gnunet-32a8c505c1fa27bb43c4e7c8d288566d51417f56.zip |
- moved test code from testbed to testing
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/Makefile.am | 1 | ||||
-rw-r--r-- | src/include/gnunet_testbed_ng_service.h | 110 | ||||
-rw-r--r-- | src/include/gnunet_testing_ng_lib.h | 68 |
3 files changed, 68 insertions, 111 deletions
diff --git a/src/include/Makefile.am b/src/include/Makefile.am index 16ff25350..9c22b5977 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am | |||
@@ -115,7 +115,6 @@ gnunetinclude_HEADERS = \ | |||
115 | gnunet_strings_lib.h \ | 115 | gnunet_strings_lib.h \ |
116 | gnunet_testbed_service.h \ | 116 | gnunet_testbed_service.h \ |
117 | gnunet_testbed_logger_service.h \ | 117 | gnunet_testbed_logger_service.h \ |
118 | gnunet_testbed_ng_service.h \ | ||
119 | gnunet_testing_lib.h \ | 118 | gnunet_testing_lib.h \ |
120 | gnunet_testing_plugin.h \ | 119 | gnunet_testing_plugin.h \ |
121 | gnunet_testing_ng_lib.h \ | 120 | gnunet_testing_ng_lib.h \ |
diff --git a/src/include/gnunet_testbed_ng_service.h b/src/include/gnunet_testbed_ng_service.h deleted file mode 100644 index 5979cd85a..000000000 --- a/src/include/gnunet_testbed_ng_service.h +++ /dev/null | |||
@@ -1,110 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2021 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @author t3sserakt | ||
23 | * | ||
24 | * @file | ||
25 | * API for writing tests and creating large-scale emulation testbeds for GNUnet with command pattern. | ||
26 | * | ||
27 | * @defgroup testbed Testbed service | ||
28 | * Writing tests and creating large-scale emulation testbeds for GNUnet with command pattern. | ||
29 | * | ||
30 | * @see [Documentation](https://docs.gnunet.org/handbook/gnunet.html#TESTBED-NG-Subsystem) | ||
31 | * | ||
32 | * @{ | ||
33 | */ | ||
34 | |||
35 | #ifndef GNUNET_TESTBED_NG_SERVICE_H | ||
36 | #define GNUNET_TESTBED_NG_SERVICE_H | ||
37 | |||
38 | #include "gnunet_util_lib.h" | ||
39 | #include "gnunet_testing_ng_lib.h" | ||
40 | |||
41 | |||
42 | /** | ||
43 | * Create command. | ||
44 | * | ||
45 | * @param label name for command. | ||
46 | * @param binaryname to start. | ||
47 | * @return command. | ||
48 | */ | ||
49 | struct GNUNET_TESTING_Command | ||
50 | GNUNET_TESTING_cmd_netjail_start (const char *label, | ||
51 | char *local_m, | ||
52 | char *global_n); | ||
53 | |||
54 | |||
55 | /** | ||
56 | * Create command. | ||
57 | * | ||
58 | * @param label name for command. | ||
59 | * @param binaryname to exec. | ||
60 | * @return command. | ||
61 | */ | ||
62 | struct GNUNET_TESTING_Command | ||
63 | GNUNET_TESTING_cmd_netjail_start_testing_system (const char *label, | ||
64 | char *local_m, | ||
65 | char *global_n, | ||
66 | char *plugin_name, | ||
67 | unsigned int *rv); | ||
68 | |||
69 | |||
70 | /** | ||
71 | * Create command. | ||
72 | * | ||
73 | * @param label name for command. | ||
74 | * @param binaryname to stop. | ||
75 | * @return command. | ||
76 | */ | ||
77 | struct GNUNET_TESTING_Command | ||
78 | GNUNET_TESTING_cmd_netjail_stop (const char *label, | ||
79 | char *local_m, | ||
80 | char *global_n); | ||
81 | |||
82 | |||
83 | struct GNUNET_TESTING_Command | ||
84 | GNUNET_TESTING_cmd_stop_testing_system (const char *label, | ||
85 | const char *helper_start_label, | ||
86 | char *local_m, | ||
87 | char *global_n); | ||
88 | |||
89 | |||
90 | int | ||
91 | GNUNET_TESTING_get_trait_helper_handles (const struct | ||
92 | GNUNET_TESTING_Command *cmd, | ||
93 | struct GNUNET_HELPER_Handle ***helper); | ||
94 | |||
95 | |||
96 | struct GNUNET_TESTING_Command | ||
97 | GNUNET_TESTING_cmd_block_until_all_peers_started (const char *label, | ||
98 | unsigned int * | ||
99 | all_peers_started); | ||
100 | |||
101 | struct GNUNET_TESTING_Command | ||
102 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, | ||
103 | TESTING_CMD_HELPER_write_cb write_message); | ||
104 | |||
105 | struct GNUNET_TESTING_Command | ||
106 | GNUNET_TESTING_cmd_local_test_finished (const char *label, | ||
107 | TESTING_CMD_HELPER_write_cb | ||
108 | write_message); | ||
109 | |||
110 | #endif | ||
diff --git a/src/include/gnunet_testing_ng_lib.h b/src/include/gnunet_testing_ng_lib.h index aad7ddec2..035d1bcad 100644 --- a/src/include/gnunet_testing_ng_lib.h +++ b/src/include/gnunet_testing_ng_lib.h | |||
@@ -842,4 +842,72 @@ struct GNUNET_TESTING_Command | |||
842 | GNUNET_TESTING_cmd_system_create (const char *label, | 842 | GNUNET_TESTING_cmd_system_create (const char *label, |
843 | const char *testdir); | 843 | const char *testdir); |
844 | 844 | ||
845 | |||
846 | /** | ||
847 | * Create command. | ||
848 | * | ||
849 | * @param label name for command. | ||
850 | * @param binaryname to start. | ||
851 | * @return command. | ||
852 | */ | ||
853 | struct GNUNET_TESTING_Command | ||
854 | GNUNET_TESTING_cmd_netjail_start (const char *label, | ||
855 | char *local_m, | ||
856 | char *global_n); | ||
857 | |||
858 | |||
859 | /** | ||
860 | * Create command. | ||
861 | * | ||
862 | * @param label name for command. | ||
863 | * @param binaryname to exec. | ||
864 | * @return command. | ||
865 | */ | ||
866 | struct GNUNET_TESTING_Command | ||
867 | GNUNET_TESTING_cmd_netjail_start_testing_system (const char *label, | ||
868 | char *local_m, | ||
869 | char *global_n, | ||
870 | char *plugin_name, | ||
871 | unsigned int *rv); | ||
872 | |||
873 | |||
874 | /** | ||
875 | * Create command. | ||
876 | * | ||
877 | * @param label name for command. | ||
878 | * @param binaryname to stop. | ||
879 | * @return command. | ||
880 | */ | ||
881 | struct GNUNET_TESTING_Command | ||
882 | GNUNET_TESTING_cmd_netjail_stop (const char *label, | ||
883 | char *local_m, | ||
884 | char *global_n); | ||
885 | |||
886 | |||
887 | struct GNUNET_TESTING_Command | ||
888 | GNUNET_TESTING_cmd_stop_testing_system (const char *label, | ||
889 | const char *helper_start_label, | ||
890 | char *local_m, | ||
891 | char *global_n); | ||
892 | |||
893 | |||
894 | int | ||
895 | GNUNET_TESTING_get_trait_helper_handles (const struct | ||
896 | GNUNET_TESTING_Command *cmd, | ||
897 | struct GNUNET_HELPER_Handle ***helper); | ||
898 | |||
899 | |||
900 | struct GNUNET_TESTING_Command | ||
901 | GNUNET_TESTING_cmd_block_until_all_peers_started (const char *label, | ||
902 | unsigned int * | ||
903 | all_peers_started); | ||
904 | |||
905 | struct GNUNET_TESTING_Command | ||
906 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, | ||
907 | TESTING_CMD_HELPER_write_cb write_message); | ||
908 | |||
909 | struct GNUNET_TESTING_Command | ||
910 | GNUNET_TESTING_cmd_local_test_finished (const char *label, | ||
911 | TESTING_CMD_HELPER_write_cb | ||
912 | write_message); | ||
845 | #endif | 913 | #endif |