17 static char *cib_path = NULL;
20 cib_not_connected(
void **state)
34 setup_test(
void **state)
38 if (cib_path == NULL) {
46 teardown_test(
void **state)
54 invalid_argument(
void **state)
60 unknown_ticket(
void **state)
70 ticket_exists(
void **state)
73 xmlXPathObject *xpath_obj = NULL;
84 assert_int_equal(numXpathResults(xpath_obj), 1);
90 multiple_tickets(
void **state)
93 xmlNode *ticket_node = NULL;
94 xmlXPathObject *xpath_obj = NULL;
104 assert_int_equal(numXpathResults(xpath_obj), 2);
126 cmocka_unit_test(cib_not_connected),
127 cmocka_unit_test_setup_teardown(invalid_argument, setup_test, teardown_test),
128 cmocka_unit_test_setup_teardown(unknown_ticket, setup_test, teardown_test),
129 cmocka_unit_test_setup_teardown(ticket_exists, setup_test, teardown_test),
130 cmocka_unit_test_setup_teardown(multiple_tickets, setup_test, teardown_test))
int pcmk_ticket_constraints(xmlNodePtr *xml, const char *ticket_id)
Return constraints that apply to the given ticket.
#define PCMK_XE_PACEMAKER_RESULT
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
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)