pacemaker 2.1.5-a3f44794f94
Scalable High-Availability cluster resource manager
pcmk_xe_is_probe_test.c
Go to the documentation of this file.
1/*
2 * Copyright 2021 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This source code is licensed under the GNU Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10#include <crm_internal.h>
11
13
14static void
15op_is_probe_test(void **state)
16{
17 xmlNode *node = NULL;
18
19 assert_false(pcmk_xe_is_probe(NULL));
20
21 node = string2xml("<lrm_rsc_op/>");
22 assert_false(pcmk_xe_is_probe(node));
23 free_xml(node);
24
25 node = string2xml("<lrm_rsc_op operation_key=\"blah\" interval=\"30s\"/>");
26 assert_false(pcmk_xe_is_probe(node));
27 free_xml(node);
28
29 node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"30s\"/>");
30 assert_false(pcmk_xe_is_probe(node));
31 free_xml(node);
32
33 node = string2xml("<lrm_rsc_op operation=\"start\" interval=\"0\"/>");
34 assert_false(pcmk_xe_is_probe(node));
35 free_xml(node);
36
37 node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\"/>");
38 assert_true(pcmk_xe_is_probe(node));
39 free_xml(node);
40}
41
42PCMK__UNIT_TEST(NULL, NULL,
43 cmocka_unit_test(op_is_probe_test))
bool pcmk_xe_is_probe(xmlNode *xml_op)
Definition: operations.c:551
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
xmlNode * string2xml(const char *input)
Definition: xml.c:930
void free_xml(xmlNode *child)
Definition: xml.c:885