19 static char *cib_path = NULL;
22 cib_not_connected(
void **state)
36 setup_test(
void **state)
40 if (cib_path == NULL) {
48 teardown_test(
void **state)
56 bad_arguments(
void **state)
70 unknown_ticket(
void **state)
84 ticket_exists(
void **state)
87 xmlXPathObject *xpath_obj = NULL;
98 assert_int_equal(numXpathResults(xpath_obj), 1);
106 multiple_tickets(
void **state)
109 xmlNode *ticket_node = NULL;
110 xmlXPathObject *xpath_obj = NULL;
122 assert_int_equal(numXpathResults(xpath_obj), 4);
142 duplicate_tickets(
void **state)
145 xmlXPathObject *xpath_obj = NULL;
157 assert_int_equal(numXpathResults(xpath_obj), 2);
173 cmocka_unit_test_setup_teardown(cib_not_connected, setup_test, teardown_test),
174 cmocka_unit_test_setup_teardown(bad_arguments, setup_test, teardown_test),
175 cmocka_unit_test_setup_teardown(unknown_ticket, setup_test, teardown_test),
176 cmocka_unit_test_setup_teardown(ticket_exists, setup_test, teardown_test),
177 cmocka_unit_test_setup_teardown(multiple_tickets, setup_test, teardown_test),
178 cmocka_unit_test_setup_teardown(duplicate_tickets, setup_test, teardown_test))
#define PCMK__XE_TICKET_STATE
cib_t * cib_new(void)
Create a new CIB connection object.
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
cib_api_operations_t * cmds
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
int pcmk__xml_test_setup_group(void **state)
Wrappers for and extensions to libxml2.
#define pcmk__assert_asserts(stmt)
int pcmk__get_ticket_state(cib_t *cib, const char *ticket_id, xmlNode **state)
void free_xml(xmlNode *child)
int cib__clean_up_connection(cib_t **cib)
void pcmk__cib_test_cleanup(char *out_path)
xmlXPathObjectPtr xpath_search(const xmlNode *xml_top, const char *path)
char * pcmk__cib_test_copy_cib(const char *in_file)
xmlNode * getXpathResult(xmlXPathObjectPtr xpathObj, int index)
void freeXpathObject(xmlXPathObjectPtr xpathObj)