diff options
Diffstat (limited to 'src/lib/testing/testing_cmds.h')
-rw-r--r-- | src/lib/testing/testing_cmds.h | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/src/lib/testing/testing_cmds.h b/src/lib/testing/testing_cmds.h new file mode 100644 index 000000000..79876556b --- /dev/null +++ b/src/lib/testing/testing_cmds.h | |||
@@ -0,0 +1,109 @@ | |||
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 | * @file testing/testing_cmds.h | ||
23 | * @brief Message formats for communication between testing cmds helper and testcase plugins. | ||
24 | * @author t3sserakt | ||
25 | */ | ||
26 | |||
27 | #ifndef TESTING_CMDS_H | ||
28 | #define TESTING_CMDS_H | ||
29 | |||
30 | #include "gnunet_common.h" | ||
31 | |||
32 | #define HELPER_CMDS_BINARY "gnunet-cmds-helper" | ||
33 | |||
34 | #define NETJAIL_EXEC_SCRIPT "netjail_exec.sh" | ||
35 | |||
36 | GNUNET_NETWORK_STRUCT_BEGIN | ||
37 | |||
38 | /** | ||
39 | * Initialization message for gnunet-cmds-testbed to start cmd binary. | ||
40 | */ | ||
41 | struct GNUNET_TESTING_CommandHelperInit | ||
42 | { | ||
43 | /** | ||
44 | * Type is #GNUNET_MESSAGE_TYPE_CMDS_HELPER_INIT | ||
45 | */ | ||
46 | struct GNUNET_MessageHeader header; | ||
47 | |||
48 | /** | ||
49 | * Number of barriers the helper inherits. | ||
50 | */ | ||
51 | uint32_t barrier_count GNUNET_PACKED; | ||
52 | |||
53 | /* Followed by barrier_count barrier hashes */ | ||
54 | |||
55 | /* Followed by topology data */ | ||
56 | }; | ||
57 | |||
58 | |||
59 | struct GNUNET_TESTING_CommandLocalFinished | ||
60 | { | ||
61 | /** | ||
62 | * Type is GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED | ||
63 | */ | ||
64 | struct GNUNET_MessageHeader header; | ||
65 | |||
66 | /** | ||
67 | * The exit status local test return with in NBO. | ||
68 | */ | ||
69 | uint32_t rv GNUNET_PACKED; | ||
70 | }; | ||
71 | |||
72 | |||
73 | /** | ||
74 | * Child to parent: I reached the given barrier, | ||
75 | * increment the counter (or pass to grandparent). | ||
76 | */ | ||
77 | struct GNUNET_TESTING_CommandBarrierReached | ||
78 | { | ||
79 | struct GNUNET_MessageHeader header; | ||
80 | struct GNUNET_ShortHashCode barrier_key; | ||
81 | }; | ||
82 | |||
83 | |||
84 | /** | ||
85 | * Parent to child: you're inheriting a barrier. | ||
86 | * If the barrier was already satisfied, the parent | ||
87 | * must sent a separate barrier satisfied message. | ||
88 | */ | ||
89 | struct GNUNET_TESTING_CommandBarrierInherited | ||
90 | { | ||
91 | struct GNUNET_MessageHeader header; | ||
92 | struct GNUNET_ShortHashCode barrier_key; | ||
93 | }; | ||
94 | |||
95 | |||
96 | /** | ||
97 | * Parent to child: this barrier was satisfied. | ||
98 | */ | ||
99 | struct GNUNET_TESTING_CommandBarrierSatisfied | ||
100 | { | ||
101 | struct GNUNET_MessageHeader header; | ||
102 | struct GNUNET_ShortHashCode barrier_key; | ||
103 | }; | ||
104 | |||
105 | |||
106 | GNUNET_NETWORK_STRUCT_END | ||
107 | |||
108 | #endif | ||
109 | /* end of testing_cmds.h */ | ||