pacemaker 3.0.1-16e74fc4da
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 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
15static void
16is_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
36static void
37is_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
48PCMK__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_LIST
Definition agents.h:42
#define PCMK_STONITH_STONITH_TIMEOUT
Definition agents.h:45
#define PCMK_STONITH_HOST_ARGUMENT
Definition agents.h:40
bool pcmk_stonith_param(const char *param)
Check whether a given stonith parameter is handled by Pacemaker.
Definition agents.c:166
#define PCMK_STONITH_HOST_MAP
Definition agents.h:43
#define PCMK_STONITH_DELAY_BASE
Definition agents.h:38
#define PCMK_STONITH_ACTION_LIMIT
Definition agents.h:37
#define PCMK_STONITH_HOST_CHECK
Definition agents.h:41
#define PCMK_STONITH_PROVIDES
Definition agents.h:44
#define PCMK_STONITH_DELAY_MAX
Definition agents.h:39
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)