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 unknown_ticket_no_attrs(
void **state)
70 xmlNode *xml_search = NULL;
83 assert_null(xml_search);
92 assert_null(xml_search);
94 g_hash_table_destroy(attrs);
99 unknown_ticket_with_attrs(
void **state)
103 xmlNode *xml_search = NULL;
125 g_hash_table_destroy(attrs);
130 overwrite_existing_attr(
void **state)
134 xmlNode *xml_search = NULL;
151 g_hash_table_destroy(attrs);
156 not_granted_to_granted_without_force(
void **state)
160 xmlNode *xml_search = NULL;
178 g_hash_table_destroy(attrs);
183 not_granted_to_granted_with_force(
void **state)
187 xmlNode *xml_search = NULL;
205 g_hash_table_destroy(attrs);
210 granted_to_not_granted_without_force(
void **state)
214 xmlNode *xml_search = NULL;
232 g_hash_table_destroy(attrs);
237 granted_to_not_granted_with_force(
void **state)
241 xmlNode *xml_search = NULL;
259 g_hash_table_destroy(attrs);
273 cmocka_unit_test(cib_not_connected),
274 cmocka_unit_test_setup_teardown(bad_arguments, setup_test, teardown_test),
275 cmocka_unit_test_setup_teardown(unknown_ticket_no_attrs, setup_test, teardown_test),
276 cmocka_unit_test_setup_teardown(unknown_ticket_with_attrs, setup_test, teardown_test),
277 cmocka_unit_test_setup_teardown(overwrite_existing_attr, setup_test, teardown_test),
278 cmocka_unit_test_setup_teardown(not_granted_to_granted_without_force, setup_test, teardown_test),
279 cmocka_unit_test_setup_teardown(not_granted_to_granted_with_force, setup_test, teardown_test),
280 cmocka_unit_test_setup_teardown(granted_to_not_granted_without_force, setup_test, teardown_test),
281 cmocka_unit_test_setup_teardown(granted_to_not_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_set_attr(xmlNodePtr *xml, const char *ticket_id, GHashTable *attr_set, bool force)
Set the given attribute(s) on 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)
GHashTable * pcmk__strkey_table(GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
void pcmk__assert_validates(xmlNode *xml)
char * pcmk__cib_test_copy_cib(const char *in_file)
#define PCMK_XA_LAST_GRANTED
void pcmk__insert_dup(GHashTable *table, const char *name, const char *value)