X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Fblackbox%2Frun_blackbox_tests%2Fexecute_tests.h;h=cafc83f0fdd7ccc6d20270c935a4391313da5c69;hb=49ddbd4e0febb4ca44ee22711eafec3c4b9c4fd1;hp=03880f5345d1eaa798c3d47b3a3a3c2dbb684ef3;hpb=dc68da94af8fca91748579c84ef5ed798db7efab;p=meshlink diff --git a/test/blackbox/run_blackbox_tests/execute_tests.h b/test/blackbox/run_blackbox_tests/execute_tests.h index 03880f53..cafc83f0 100644 --- a/test/blackbox/run_blackbox_tests/execute_tests.h +++ b/test/blackbox/run_blackbox_tests/execute_tests.h @@ -21,6 +21,13 @@ */ #include +#include "../common/mesh_event_handler.h" + +typedef struct { + const mesh_event_t *expected_events; + int current_index; + int max_events; +} node_status_t; typedef bool (*test_step_func_t)(void); @@ -28,4 +35,36 @@ int setup_test(void **state); void execute_test(test_step_func_t step_func, void **state); int teardown_test(void **state); +/// Changes the state of the node state machine. +/** This function changes the current state of the node + * + * @param status Pointer to status handle of that node. + * @param currentEv Current event triggered by the node. + * + * @return This function returns true if state change is successful else returns false + */ +extern bool change_state(node_status_t *status, mesh_event_t currentEv); + +/// Sends SIGIO signal to all the nodes in the container. +/** This function Triggers SIGIO signal to all the target applications running inside the container + * + * @param status Pointer to array of status handles of target nodes. + * @param start Starting index from which to start in the array. + * @param end Ending index of the array + * @param node_ids Pointer to array of node id strings + * + * @return Void + */ +extern void signal_node_start(node_status_t *node_status, int start, int end, char *node_ids[]); + +/// Checks for the completion of nodes state machines. +/** This function checks whether the nodes state machines have reached their maximum state indexes + * + * @param status Pointer to array of status handles of target nodes. + * @param length Number of nodes to check. + * + * @return This function returns true if all the nodes reached their max states + */ +extern bool check_nodes_finished(node_status_t *node_status, int length); + #endif // TEST_STEP_H