pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
pcmk_stonith_param_test.c
Go to the documentation of this file.
1 /*
2  * Copyright 2020-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 
13 #include <crm/common/agents.h>
14 
15 static void
16 is_stonith_param(void **state)
17 {
18  assert_false(pcmk_stonith_param(NULL));
19  assert_false(pcmk_stonith_param(""));
20  assert_false(pcmk_stonith_param("unrecognized"));
21  assert_false(pcmk_stonith_param("pcmk_unrecognized"));
24 
34 }
35 
36 static void
37 is_stonith_action_param(void **state)
38 {
39  /* Currently, the function accepts any string not containing underbars as
40  * the action name, so we do not need to verify particular action names.
41  */
42  assert_false(pcmk_stonith_param("pcmk_on_unrecognized"));
43  assert_true(pcmk_stonith_param("pcmk_on_action"));
44  assert_true(pcmk_stonith_param("pcmk_on_timeout"));
45  assert_true(pcmk_stonith_param("pcmk_on_retries"));
46 }
47 
48 PCMK__UNIT_TEST(NULL, NULL,
49  cmocka_unit_test(is_stonith_param),
50  cmocka_unit_test(is_stonith_action_param))
API related to resource agents.
#define PCMK_STONITH_HOST_CHECK
Definition: agents.h:45
#define PCMK_STONITH_PROVIDES
Definition: agents.h:48
#define PCMK_STONITH_HOST_MAP
Definition: agents.h:47
bool pcmk_stonith_param(const char *param)
Check whether a given stonith parameter is handled by Pacemaker.
Definition: agents.c:175
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
#define PCMK_STONITH_STONITH_TIMEOUT
Definition: agents.h:49
#define PCMK_STONITH_HOST_LIST
Definition: agents.h:46
#define PCMK_STONITH_ACTION_LIMIT
Definition: agents.h:41
#define PCMK_STONITH_HOST_ARGUMENT
Definition: agents.h:44
#define PCMK_STONITH_DELAY_BASE
Definition: agents.h:42
#define PCMK_STONITH_DELAY_MAX
Definition: agents.h:43