pacemaker 2.1.1-77db578727
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
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 Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10#include <crm_internal.h>
11
12#include <glib.h>
13
14#include <crm/common/agents.h>
15
16static void
17is_stonith_param(void)
18{
19 g_assert_false(pcmk_stonith_param(NULL));
20 g_assert_false(pcmk_stonith_param(""));
21 g_assert_false(pcmk_stonith_param("unrecognized"));
22 g_assert_false(pcmk_stonith_param("pcmk_unrecognized"));
25
35}
36
37static void
38is_stonith_action_param(void)
39{
40 /* Currently, the function accepts any string not containing underbars as
41 * the action name, so we do not need to verify particular action names.
42 */
43 g_assert_false(pcmk_stonith_param("pcmk_on_unrecognized"));
44 g_assert_true(pcmk_stonith_param("pcmk_on_action"));
45 g_assert_true(pcmk_stonith_param("pcmk_on_timeout"));
46 g_assert_true(pcmk_stonith_param("pcmk_on_retries"));
47}
48
49int
50main(int argc, char **argv)
51{
52 g_test_init(&argc, &argv, NULL);
53
54 g_test_add_func("/common/utils/parse_op_key/is_stonith_param",
55 is_stonith_param);
56 g_test_add_func("/common/utils/parse_op_key/is_stonith_action_param",
57 is_stonith_action_param);
58 return g_test_run();
59}
API related to resource agents.
#define PCMK_STONITH_HOST_LIST
Definition agents.h:34
#define PCMK_STONITH_STONITH_TIMEOUT
Definition agents.h:37
#define PCMK_STONITH_HOST_ARGUMENT
Definition agents.h:32
bool pcmk_stonith_param(const char *param)
Check whether a given stonith parameter is handled by Pacemaker.
Definition agents.c:170
#define PCMK_STONITH_HOST_MAP
Definition agents.h:35
#define PCMK_STONITH_DELAY_BASE
Definition agents.h:30
#define PCMK_STONITH_ACTION_LIMIT
Definition agents.h:29
#define PCMK_STONITH_HOST_CHECK
Definition agents.h:33
#define PCMK_STONITH_PROVIDES
Definition agents.h:36
#define PCMK_STONITH_DELAY_MAX
Definition agents.h:31
int main(int argc, char **argv)