summaryrefslogtreecommitdiffstats
path: root/lib/common/tests/actions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common/tests/actions')
-rw-r--r--lib/common/tests/actions/Makefile.am10
-rw-r--r--lib/common/tests/actions/copy_in_properties_test.c62
-rw-r--r--lib/common/tests/actions/expand_plus_plus_test.c256
-rw-r--r--lib/common/tests/actions/fix_plus_plus_recursive_test.c47
-rw-r--r--lib/common/tests/actions/pcmk_is_probe_test.c25
-rw-r--r--lib/common/tests/actions/pcmk_xe_is_probe_test.c43
-rw-r--r--lib/common/tests/actions/pcmk_xe_mask_probe_failure_test.c150
7 files changed, 2 insertions, 591 deletions
diff --git a/lib/common/tests/actions/Makefile.am b/lib/common/tests/actions/Makefile.am
index 6890b84..0dfe521 100644
--- a/lib/common/tests/actions/Makefile.am
+++ b/lib/common/tests/actions/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2020-2023 the Pacemaker project contributors
+# Copyright 2020-2024 the Pacemaker project contributors
#
# The version control history for this file may have further details.
#
@@ -11,12 +11,6 @@ include $(top_srcdir)/mk/tap.mk
include $(top_srcdir)/mk/unittest.mk
# Add "_test" to the end of all test program names to simplify .gitignore.
-check_PROGRAMS = copy_in_properties_test \
- expand_plus_plus_test \
- fix_plus_plus_recursive_test \
- parse_op_key_test \
- pcmk_is_probe_test \
- pcmk_xe_is_probe_test \
- pcmk_xe_mask_probe_failure_test
+check_PROGRAMS = parse_op_key_test
TESTS = $(check_PROGRAMS)
diff --git a/lib/common/tests/actions/copy_in_properties_test.c b/lib/common/tests/actions/copy_in_properties_test.c
deleted file mode 100644
index 7882551..0000000
--- a/lib/common/tests/actions/copy_in_properties_test.c
+++ /dev/null
@@ -1,62 +0,0 @@
- /*
- * Copyright 2022 the Pacemaker project contributors
- *
- * The version control history for this file may have further details.
- *
- * This source code is licensed under the GNU General Public License version 2
- * or later (GPLv2+) WITHOUT ANY WARRANTY.
- */
-
-#include <crm_internal.h>
-
-#include <crm/common/unittest_internal.h>
-
-#include <glib.h>
-
-static void
-target_is_NULL(void **state)
-{
- xmlNode *test_xml_1 = create_xml_node(NULL, "test_xml_1");
- xmlNode *test_xml_2 = NULL;
-
- pcmk__xe_set_props(test_xml_1, "test_prop", "test_value", NULL);
-
- copy_in_properties(test_xml_2, test_xml_1);
-
- assert_ptr_equal(test_xml_2, NULL);
-}
-
-static void
-src_is_NULL(void **state)
-{
- xmlNode *test_xml_1 = NULL;
- xmlNode *test_xml_2 = create_xml_node(NULL, "test_xml_2");
-
- copy_in_properties(test_xml_2, test_xml_1);
-
- assert_ptr_equal(test_xml_2->properties, NULL);
-}
-
-static void
-copying_is_successful(void **state)
-{
- const char *xml_1_value;
- const char *xml_2_value;
-
- xmlNode *test_xml_1 = create_xml_node(NULL, "test_xml_1");
- xmlNode *test_xml_2 = create_xml_node(NULL, "test_xml_2");
-
- pcmk__xe_set_props(test_xml_1, "test_prop", "test_value", NULL);
-
- copy_in_properties(test_xml_2, test_xml_1);
-
- xml_1_value = crm_element_value(test_xml_1, "test_prop");
- xml_2_value = crm_element_value(test_xml_2, "test_prop");
-
- assert_string_equal(xml_1_value, xml_2_value);
-}
-
-PCMK__UNIT_TEST(NULL, NULL,
- cmocka_unit_test(target_is_NULL),
- cmocka_unit_test(src_is_NULL),
- cmocka_unit_test(copying_is_successful))
diff --git a/lib/common/tests/actions/expand_plus_plus_test.c b/lib/common/tests/actions/expand_plus_plus_test.c
deleted file mode 100644
index 41471f9..0000000
--- a/lib/common/tests/actions/expand_plus_plus_test.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright 2022 the Pacemaker project contributors
- *
- * The version control history for this file may have further details.
- *
- * This source code is licensed under the GNU General Public License version 2
- * or later (GPLv2+) WITHOUT ANY WARRANTY.
- */
-
-#include <crm_internal.h>
-
-#include <crm/common/unittest_internal.h>
-
-#include <glib.h>
-
-static void
-value_is_name_plus_plus(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(test_xml, "X", "X++");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "6");
-}
-
-static void
-value_is_name_plus_equals_integer(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(test_xml, "X", "X+=2");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "7");
-}
-
-// NULL input
-
-static void
-target_is_NULL(void **state)
-{
-
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(NULL, "X", "X++");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "5");
-}
-
-static void
-name_is_NULL(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(test_xml, NULL, "X++");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "5");
-}
-
-static void
-value_is_NULL(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(test_xml, "X", NULL);
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "5");
-}
-
-// the value input doesn't start with the name input
-
-static void
-value_is_wrong_name(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(test_xml, "X", "Y++");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "Y++");
-}
-
-static void
-value_is_only_an_integer(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(test_xml, "X", "2");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "2");
-}
-
-// non-integers
-
-static void
-variable_is_initialized_to_be_NULL(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", NULL);
- expand_plus_plus(test_xml, "X", "X++");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "X++");
-}
-
-static void
-variable_is_initialized_to_be_non_numeric(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "hello");
- expand_plus_plus(test_xml, "X", "X++");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "1");
-}
-
-static void
-variable_is_initialized_to_be_non_numeric_2(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "hello");
- expand_plus_plus(test_xml, "X", "X+=2");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "2");
-}
-
-static void
-variable_is_initialized_to_be_numeric_and_decimal_point_containing(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5.01");
- expand_plus_plus(test_xml, "X", "X++");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "6");
-}
-
-static void
-variable_is_initialized_to_be_numeric_and_decimal_point_containing_2(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5.50");
- expand_plus_plus(test_xml, "X", "X++");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "6");
-}
-
-static void
-variable_is_initialized_to_be_numeric_and_decimal_point_containing_3(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5.99");
- expand_plus_plus(test_xml, "X", "X++");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "6");
-}
-
-static void
-value_is_non_numeric(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(test_xml, "X", "X+=hello");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "5");
-}
-
-static void
-value_is_numeric_and_decimal_point_containing(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(test_xml, "X", "X+=2.01");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "7");
-}
-
-static void
-value_is_numeric_and_decimal_point_containing_2(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(test_xml, "X", "X+=1.50");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "6");
-}
-
-static void
-value_is_numeric_and_decimal_point_containing_3(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(test_xml, "X", "X+=1.99");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "6");
-}
-
-// undefined input
-
-static void
-name_is_undefined(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "Y", "5");
- expand_plus_plus(test_xml, "X", "X++");
- new_value = crm_element_value(test_xml, "X");
- assert_string_equal(new_value, "X++");
-}
-
-// large input
-
-static void
-assignment_result_is_too_large(void **state)
-{
- const char *new_value;
- xmlNode *test_xml = create_xml_node(NULL, "test_xml");
- crm_xml_add(test_xml, "X", "5");
- expand_plus_plus(test_xml, "X", "X+=100000000000");
- new_value = crm_element_value(test_xml, "X");
- printf("assignment result is too large %s\n", new_value);
- assert_string_equal(new_value, "1000000");
-}
-
-PCMK__UNIT_TEST(NULL, NULL,
- cmocka_unit_test(value_is_name_plus_plus),
- cmocka_unit_test(value_is_name_plus_equals_integer),
- cmocka_unit_test(target_is_NULL),
- cmocka_unit_test(name_is_NULL),
- cmocka_unit_test(value_is_NULL),
- cmocka_unit_test(value_is_wrong_name),
- cmocka_unit_test(value_is_only_an_integer),
- cmocka_unit_test(variable_is_initialized_to_be_NULL),
- cmocka_unit_test(variable_is_initialized_to_be_non_numeric),
- cmocka_unit_test(variable_is_initialized_to_be_non_numeric_2),
- cmocka_unit_test(variable_is_initialized_to_be_numeric_and_decimal_point_containing),
- cmocka_unit_test(variable_is_initialized_to_be_numeric_and_decimal_point_containing_2),
- cmocka_unit_test(variable_is_initialized_to_be_numeric_and_decimal_point_containing_3),
- cmocka_unit_test(value_is_non_numeric),
- cmocka_unit_test(value_is_numeric_and_decimal_point_containing),
- cmocka_unit_test(value_is_numeric_and_decimal_point_containing_2),
- cmocka_unit_test(value_is_numeric_and_decimal_point_containing_3),
- cmocka_unit_test(name_is_undefined),
- cmocka_unit_test(assignment_result_is_too_large))
diff --git a/lib/common/tests/actions/fix_plus_plus_recursive_test.c b/lib/common/tests/actions/fix_plus_plus_recursive_test.c
deleted file mode 100644
index b3c7cc2..0000000
--- a/lib/common/tests/actions/fix_plus_plus_recursive_test.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2022 the Pacemaker project contributors
- *
- * The version control history for this file may have further details.
- *
- * This source code is licensed under the GNU General Public License version 2
- * or later (GPLv2+) WITHOUT ANY WARRANTY.
- */
-
-#include <crm_internal.h>
-
-#include <crm/common/unittest_internal.h>
-
-#include <glib.h>
-
-static void
-element_nodes(void **state)
-{
- const char *new_value_root;
- const char *new_value_child;
- const char *new_value_grandchild;
-
- xmlNode *test_xml_root = create_xml_node(NULL, "test_xml_root");
- xmlNode *test_xml_child = create_xml_node(test_xml_root, "test_xml_child");
- xmlNode *test_xml_grandchild = create_xml_node(test_xml_child, "test_xml_grandchild");
- xmlNode *test_xml_text = pcmk_create_xml_text_node(test_xml_root, "text_xml_text", "content");
- xmlNode *test_xml_comment = string2xml("<!-- a comment -->");
-
- crm_xml_add(test_xml_root, "X", "5");
- crm_xml_add(test_xml_child, "X", "X++");
- crm_xml_add(test_xml_grandchild, "X", "X+=2");
- crm_xml_add(test_xml_text, "X", "X++");
-
- fix_plus_plus_recursive(test_xml_root);
- fix_plus_plus_recursive(test_xml_comment);
-
- new_value_root = crm_element_value(test_xml_root, "X");
- new_value_child = crm_element_value(test_xml_child, "X");
- new_value_grandchild = crm_element_value(test_xml_grandchild, "X");
-
- assert_string_equal(new_value_root, "5");
- assert_string_equal(new_value_child, "1");
- assert_string_equal(new_value_grandchild, "2");
-}
-
-PCMK__UNIT_TEST(NULL, NULL,
- cmocka_unit_test(element_nodes))
diff --git a/lib/common/tests/actions/pcmk_is_probe_test.c b/lib/common/tests/actions/pcmk_is_probe_test.c
deleted file mode 100644
index 4a65e3f..0000000
--- a/lib/common/tests/actions/pcmk_is_probe_test.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2021 the Pacemaker project contributors
- *
- * The version control history for this file may have further details.
- *
- * This source code is licensed under the GNU General Public License version 2
- * or later (GPLv2+) WITHOUT ANY WARRANTY.
- */
-
-#include <crm_internal.h>
-
-#include <crm/common/unittest_internal.h>
-
-static void
-is_probe_test(void **state)
-{
- assert_false(pcmk_is_probe(NULL, 0));
- assert_false(pcmk_is_probe("", 0));
- assert_false(pcmk_is_probe("blahblah", 0));
- assert_false(pcmk_is_probe("monitor", 1));
- assert_true(pcmk_is_probe("monitor", 0));
-}
-
-PCMK__UNIT_TEST(NULL, NULL,
- cmocka_unit_test(is_probe_test))
diff --git a/lib/common/tests/actions/pcmk_xe_is_probe_test.c b/lib/common/tests/actions/pcmk_xe_is_probe_test.c
deleted file mode 100644
index 62b21d9..0000000
--- a/lib/common/tests/actions/pcmk_xe_is_probe_test.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2021 the Pacemaker project contributors
- *
- * The version control history for this file may have further details.
- *
- * This source code is licensed under the GNU General Public License version 2
- * or later (GPLv2+) WITHOUT ANY WARRANTY.
- */
-
-#include <crm_internal.h>
-
-#include <crm/common/unittest_internal.h>
-
-static void
-op_is_probe_test(void **state)
-{
- xmlNode *node = NULL;
-
- assert_false(pcmk_xe_is_probe(NULL));
-
- node = string2xml("<lrm_rsc_op/>");
- assert_false(pcmk_xe_is_probe(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation_key=\"blah\" interval=\"30s\"/>");
- assert_false(pcmk_xe_is_probe(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"30s\"/>");
- assert_false(pcmk_xe_is_probe(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"start\" interval=\"0\"/>");
- assert_false(pcmk_xe_is_probe(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\"/>");
- assert_true(pcmk_xe_is_probe(node));
- free_xml(node);
-}
-
-PCMK__UNIT_TEST(NULL, NULL,
- cmocka_unit_test(op_is_probe_test))
diff --git a/lib/common/tests/actions/pcmk_xe_mask_probe_failure_test.c b/lib/common/tests/actions/pcmk_xe_mask_probe_failure_test.c
deleted file mode 100644
index 9e38019..0000000
--- a/lib/common/tests/actions/pcmk_xe_mask_probe_failure_test.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright 2021 the Pacemaker project contributors
- *
- * The version control history for this file may have further details.
- *
- * This source code is licensed under the GNU General Public License version 2
- * or later (GPLv2+) WITHOUT ANY WARRANTY.
- */
-
-#include <crm_internal.h>
-
-#include <crm/common/unittest_internal.h>
-
-static void
-op_is_not_probe_test(void **state) {
- xmlNode *node = NULL;
-
- /* Not worth testing this thoroughly since it's just a duplicate of whether
- * pcmk_op_is_probe works or not.
- */
-
- node = string2xml("<lrm_rsc_op operation=\"start\" interval=\"0\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-}
-
-static void
-op_does_not_have_right_values_test(void **state) {
- xmlNode *node = NULL;
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"0\" op-status=\"\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-}
-
-static void
-check_values_test(void **state) {
- xmlNode *node = NULL;
-
- /* PCMK_EXEC_NOT_SUPPORTED */
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"0\" op-status=\"3\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"5\" op-status=\"3\"/>");
- assert_true(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- /* PCMK_EXEC_DONE */
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"0\" op-status=\"0\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"2\" op-status=\"0\"/>");
- assert_true(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"5\" op-status=\"0\"/>");
- assert_true(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"6\" op-status=\"0\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"7\" op-status=\"0\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- /* PCMK_EXEC_NOT_INSTALLED */
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"0\" op-status=\"7\"/>");
- assert_true(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"5\" op-status=\"7\"/>");
- assert_true(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- /* PCMK_EXEC_ERROR */
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"0\" op-status=\"4\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"2\" op-status=\"4\"/>");
- assert_true(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"5\" op-status=\"4\"/>");
- assert_true(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"6\" op-status=\"4\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"7\" op-status=\"4\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- /* PCMK_EXEC_ERROR_HARD */
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"0\" op-status=\"5\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"2\" op-status=\"5\"/>");
- assert_true(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"5\" op-status=\"5\"/>");
- assert_true(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"6\" op-status=\"5\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"7\" op-status=\"5\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- /* PCMK_EXEC_ERROR_FATAL */
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"0\" op-status=\"6\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"2\" op-status=\"6\"/>");
- assert_true(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"5\" op-status=\"6\"/>");
- assert_true(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"6\" op-status=\"6\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-
- node = string2xml("<lrm_rsc_op operation=\"monitor\" interval=\"0\" rc-code=\"7\" op-status=\"6\"/>");
- assert_false(pcmk_xe_mask_probe_failure(node));
- free_xml(node);
-}
-
-PCMK__UNIT_TEST(NULL, NULL,
- cmocka_unit_test(op_is_not_probe_test),
- cmocka_unit_test(op_does_not_have_right_values_test),
- cmocka_unit_test(check_values_test))