GNUnet 0.22.2
testing_api_loop.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet
3 Copyright (C) 2022 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
26#ifndef TESTING_API_LOOP_H
27#define TESTING_API_LOOP_H
28
29#include "testing_api_barrier.h"
30
31
37typedef void
39 const struct GNUNET_MessageHeader *message);
40
41
46{
47
51 void *cls;
52
67 (*start_testcase) (
68 void *cls,
69 const char *topology_data,
70 uint32_t barrier_count,
71 const struct GNUNET_ShortHashCode *barriers,
74 void *finish_cb_cls);
75
76};
77
78
85void
88 const struct GNUNET_MessageHeader *hdr);
89
90
97void
100 const struct GNUNET_MessageHeader *hdr);
101
102
106void
108
109
110void
113 struct GNUNET_TESTING_Command *cmd);
114
121void
124 struct GNUNET_HELPER_Handle *helper);
125
126
134void
137 struct GNUNET_TESTING_Barrier *barrier);
138
139
143 const struct GNUNET_ShortHashCode *create_key);
144
145
149 const char *barrier_name);
150
151
152unsigned int
155
156
157void
161 void *cb_cls);
162
163#endif
static struct GNUNET_TESTING_Interpreter * is
static void write_message(const struct GNUNET_MessageHeader *message)
Callback to write a message to the parent process.
void(* GNUNET_TESTING_ResultCallback)(void *cls, enum GNUNET_GenericReturnValue rv)
Function called with the final result of the test.
enum GNUNET_GenericReturnValue(* GNUNET_CONTAINER_ShortmapIterator)(void *cls, const struct GNUNET_ShortHashCode *key, void *value)
Iterator over hash map entries.
The handle to a helper process.
Definition: helper.c:77
Header for all communications.
A 256-bit hashcode.
An entry for a barrier list.
A command to be run by the interpreter.
Global state of the interpreter, used by a command to access information about other commands.
The plugin API every test case plugin has to implement.
void * cls
Closure to pass to start_testcase.
struct GNUNET_TESTING_Barrier * GNUNET_TESTING_get_barrier2_(struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_ShortHashCode *create_key)
struct GNUNET_TESTING_Barrier * GNUNET_TESTING_get_barrier_(struct GNUNET_TESTING_Interpreter *is, const char *barrier_name)
unsigned int GNUNET_TESTING_barrier_count_(struct GNUNET_TESTING_Interpreter *is)
void GNUNET_TESTING_barrier_iterate_(struct GNUNET_TESTING_Interpreter *is, GNUNET_CONTAINER_ShortmapIterator cb, void *cb_cls)
void GNUNET_TESTING_add_netjail_helper_(struct GNUNET_TESTING_Interpreter *is, struct GNUNET_HELPER_Handle *helper)
Adding a helper handle to the interpreter.
void GNUNET_TESTING_loop_notify_parent_(struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_MessageHeader *hdr)
Send message to our parent.
void GNUNET_TESTING_interpreter_run_cmd_(struct GNUNET_TESTING_Interpreter *is, struct GNUNET_TESTING_Command *cmd)
void(* GNUNET_TESTING_cmd_helper_write_cb)(const struct GNUNET_MessageHeader *message)
Callback function to write messages from the helper process running on a netjail node to the master p...
void GNUNET_TESTING_loop_notify_children_(struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_MessageHeader *hdr)
Send message to all netjail children (if there are any).
void GNUNET_TESTING_add_barrier_(struct GNUNET_TESTING_Interpreter *is, struct GNUNET_TESTING_Barrier *barrier)
Add a barrier to the interpreter to share it with all children as an inherited barrier.
void GNUNET_TESTING_interpreter_next_(void *cls)
Current command is done, run the next one.