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 bad_arguments(
void **state)
66 no_attrs(
void **state)
70 xmlNode *xml_search = NULL;
83 assert_null(xml_search);
103 assert_null(xml_search);
110 remove_missing_attrs(
void **state)
114 xmlNode *xml_search = NULL;
117 attrs = g_list_append(attrs, strdup(
"XYZ"));
133 g_list_free_full(attrs, free);
138 remove_existing_attr(
void **state)
142 xmlNode *xml_search = NULL;
145 attrs = g_list_append(attrs, strdup(
"owner"));
159 g_list_free_full(attrs, free);
164 remove_granted_without_force(
void **state)
168 xmlNode *xml_search = NULL;
185 g_list_free_full(attrs, free);
190 remove_granted_with_force(
void **state)
194 xmlNode *xml_search = NULL;
211 g_list_free_full(attrs, free);
225 cmocka_unit_test(cib_not_connected),
226 cmocka_unit_test_setup_teardown(bad_arguments, setup_test, teardown_test),
227 cmocka_unit_test_setup_teardown(no_attrs, setup_test, teardown_test),
228 cmocka_unit_test_setup_teardown(remove_missing_attrs, setup_test, teardown_test),
229 cmocka_unit_test_setup_teardown(remove_existing_attr, setup_test, teardown_test),
230 cmocka_unit_test_setup_teardown(remove_granted_without_force, setup_test, teardown_test),
231 cmocka_unit_test_setup_teardown(remove_granted_with_force, 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_ticket_remove_attr(xmlNodePtr *xml, const char *ticket_id, GList *attr_delete, bool force)
Remove the given attribute(s) from a ticket.
int pcmk__xml_test_setup_group(void **state)
Wrappers for and extensions to libxml2.
int(* query)(cib_t *cib, const char *section, xmlNode **output_data, int call_options)
void free_xml(xmlNode *child)
int cib__clean_up_connection(cib_t **cib)
void pcmk__cib_test_cleanup(char *out_path)
void pcmk__assert_validates(xmlNode *xml)
char * pcmk__cib_test_copy_cib(const char *in_file)