17 static char *cib_path = NULL;
20 setup_test(
void **state)
24 if (cib_path == NULL) {
32 teardown_test(
void **state)
40 bad_arguments(
void **state)
46 unknown_ticket(
void **state)
56 all_tickets(
void **state)
59 xmlXPathObject *xpath_obj = NULL;
71 assert_int_equal(numXpathResults(xpath_obj), 3);
108 single_ticket(
void **state)
110 xmlNode *node = NULL;
111 xmlXPathObject *xpath_obj = NULL;
122 assert_int_equal(numXpathResults(xpath_obj), 1);
135 cmocka_unit_test_setup_teardown(bad_arguments, setup_test, teardown_test),
136 cmocka_unit_test_setup_teardown(unknown_ticket, setup_test, teardown_test),
137 cmocka_unit_test_setup_teardown(all_tickets, setup_test, teardown_test),
138 cmocka_unit_test_setup_teardown(single_ticket, setup_test, teardown_test))
#define PCMK_XE_PACEMAKER_RESULT
#define PCMK_VALUE_GRANTED
int pcmk_ticket_info(xmlNodePtr *xml, const char *ticket_id)
Return information about the given ticket.
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
#define PCMK_VALUE_REVOKED
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.
void free_xml(xmlNode *child)
void pcmk__cib_test_cleanup(char *out_path)
xmlXPathObjectPtr xpath_search(const xmlNode *xml_top, const char *path)
void pcmk__assert_validates(xmlNode *xml)
char * pcmk__cib_test_copy_cib(const char *in_file)
xmlNode * getXpathResult(xmlXPathObjectPtr xpathObj, int index)
void freeXpathObject(xmlXPathObjectPtr xpathObj)