X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=test%2Fblackbox%2Frun_blackbox_tests%2Fexecute_tests.h;fp=test%2Fblackbox%2Frun_blackbox_tests%2Fexecute_tests.h;h=bdf28ea52bc93f56eff9093cda92a5fd580df5f1;hb=4108810af455f463dfbcdac0e2e0b2ba0312bf26;hp=03880f5345d1eaa798c3d47b3a3a3c2dbb684ef3;hpb=026aa799bdccd860575e4ce228b750f47abd31e2;p=meshlink diff --git a/test/blackbox/run_blackbox_tests/execute_tests.h b/test/blackbox/run_blackbox_tests/execute_tests.h index 03880f53..bdf28ea5 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 wheather 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