27 .op_interval_ms = 10000,
38 assert_op_expression(
const char *xml_string,
int reference_rc)
52 #define EXPR_FAIL_BOTH \ 53 "<" PCMK_XE_OP_EXPRESSION " " PCMK_XA_ID "='e' " \ 54 PCMK_XA_NAME "='" PCMK_ACTION_START "' " \ 55 PCMK_XA_INTERVAL "='0' />" 58 null_invalid(
void **state)
68 assert_op_expression(NULL, EINVAL);
76 #define EXPR_ID_MISSING \ 77 "<" PCMK_XE_OP_EXPRESSION " " \ 78 PCMK_XA_NAME "='" PCMK_ACTION_MONITOR "' " \ 79 PCMK_XA_INTERVAL "='10s' />" 81 #define EXPR_ID_EMPTY \ 82 "<" PCMK_XE_OP_EXPRESSION " " PCMK_XA_ID "='' " \ 83 PCMK_XA_NAME "='" PCMK_ACTION_MONITOR "' " \ 84 PCMK_XA_INTERVAL "='10s' />" 87 id_missing(
void **state)
99 #define EXPR_NAME_MISSING \ 100 "<" PCMK_XE_OP_EXPRESSION " " PCMK_XA_ID "='e' " \ 101 PCMK_XA_INTERVAL "='10s' />" 104 name_missing(
void **state)
109 #define EXPR_MATCH_BOTH \ 110 "<" PCMK_XE_OP_EXPRESSION " " PCMK_XA_ID "='e' " \ 111 PCMK_XA_NAME "='" PCMK_ACTION_MONITOR "' " \ 112 PCMK_XA_INTERVAL "='10s' />" 114 #define EXPR_EMPTY_NAME \ 115 "<" PCMK_XE_OP_EXPRESSION " " PCMK_XA_ID "='e' " \ 116 PCMK_XA_NAME "='' " PCMK_XA_INTERVAL "='10s' />" 119 input_name_missing(
void **state)
127 #define EXPR_FAIL_NAME \ 128 "<" PCMK_XE_OP_EXPRESSION " " PCMK_XA_ID "='e' " \ 129 PCMK_XA_NAME "='" PCMK_ACTION_START "' " \ 130 PCMK_XA_INTERVAL "='10s' />" 133 fail_name(
void **state)
146 #define EXPR_EMPTY_INTERVAL \ 147 "<" PCMK_XE_OP_EXPRESSION " " PCMK_XA_ID "='e' " \ 148 PCMK_XA_NAME "='" PCMK_ACTION_MONITOR "' " \ 149 PCMK_XA_INTERVAL "='' />" 151 #define EXPR_INVALID_INTERVAL \ 152 "<" PCMK_XE_OP_EXPRESSION " " PCMK_XA_ID "='e' " \ 153 PCMK_XA_NAME "='" PCMK_ACTION_MONITOR "' " \ 154 PCMK_XA_INTERVAL "='not-an-interval' />" 157 invalid_interval(
void **state)
163 #define EXPR_DEFAULT_INTERVAL \ 164 "<" PCMK_XE_OP_EXPRESSION " " PCMK_XA_ID "='e' " \ 165 PCMK_XA_NAME "='" PCMK_ACTION_MONITOR "' />" 168 default_interval(
void **state)
173 #define EXPR_FAIL_INTERVAL \ 174 "<" PCMK_XE_OP_EXPRESSION " " PCMK_XA_ID "='e' " \ 175 PCMK_XA_NAME "='" PCMK_ACTION_MONITOR "' " \ 176 PCMK_XA_INTERVAL "='9s' />" 179 fail_interval(
void **state)
186 match_both(
void **state)
192 fail_both(
void **state)
198 cmocka_unit_test(null_invalid),
199 cmocka_unit_test(id_missing),
200 cmocka_unit_test(name_missing),
201 cmocka_unit_test(input_name_missing),
202 cmocka_unit_test(fail_name),
203 cmocka_unit_test(invalid_interval),
204 cmocka_unit_test(default_interval),
205 cmocka_unit_test(fail_interval),
206 cmocka_unit_test(match_both),
207 cmocka_unit_test(fail_both))
#define PCMK_ACTION_MONITOR
G_GNUC_INTERNAL int pcmk__evaluate_op_expression(const xmlNode *expr, const pcmk_rule_input_t *rule_input)
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
#define EXPR_NAME_MISSING
#define EXPR_DEFAULT_INTERVAL
int pcmk__xml_test_setup_group(void **state)
Wrappers for and extensions to libxml2.
void free_xml(xmlNode *child)
int pcmk__xml_test_teardown_group(void **state)
xmlNode * pcmk__xml_parse(const char *input)
#define EXPR_FAIL_INTERVAL
#define EXPR_INVALID_INTERVAL
#define EXPR_EMPTY_INTERVAL