root/lib/common/tests/operations/pcmk_xe_is_probe_test.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. op_is_probe_test

   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 General Public License version 2
   7  * or later (GPLv2+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #include <crm_internal.h>
  11 
  12 #include <crm/common/unittest_internal.h>
  13 
  14 static void
  15 op_is_probe_test(void **state)
     /* [previous][next][first][last][top][bottom][index][help] */
  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 
  42 PCMK__UNIT_TEST(NULL, NULL,
  43                 cmocka_unit_test(op_is_probe_test))

/* [previous][next][first][last][top][bottom][index][help] */