libctdb: test: add database save and restore
[metze/ctdb/wip.git] / libctdb / test / ctdb-test.h
1 #ifndef __HAVE_CTDB_TEST_H
2 #define __HAVE_CTDB_TEST_H
3 #include <stdlib.h>
4
5 /* We hang all libctdb allocations off this talloc tree. */
6 extern void *allocations;
7
8 void check_allocations(void);
9
10 /* Our own working state gets hung off this tree. */
11 extern void *working;
12
13 /* The ctdb connection; created by 'connect' command. */
14 struct ctdb_connection *get_ctdb(void);
15
16 /* Talloc bytes from an fd until EOF.  Nul terminate. */
17 void *grab_fd(int fd, size_t *size);
18
19 /* Check the databases are still ok. */
20 void check_databases(void);
21
22 /* Save and restore databases, in case children do damage. */
23 void *save_databases(void);
24 void restore_databases(void *);
25
26 #endif /* __HAVE_CTDB_TEST_H */