This source file includes following definitions.
- is_stonith_param
- is_stonith_action_param
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <crm/common/unittest_internal.h>
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"));
22 assert_false(pcmk_stonith_param("x" PCMK_STONITH_ACTION_LIMIT));
23 assert_false(pcmk_stonith_param(PCMK_STONITH_ACTION_LIMIT "x"));
24
25 assert_true(pcmk_stonith_param(PCMK_STONITH_ACTION_LIMIT));
26 assert_true(pcmk_stonith_param(PCMK_STONITH_DELAY_BASE));
27 assert_true(pcmk_stonith_param(PCMK_STONITH_DELAY_MAX));
28 assert_true(pcmk_stonith_param(PCMK_STONITH_HOST_ARGUMENT));
29 assert_true(pcmk_stonith_param(PCMK_STONITH_HOST_CHECK));
30 assert_true(pcmk_stonith_param(PCMK_STONITH_HOST_LIST));
31 assert_true(pcmk_stonith_param(PCMK_STONITH_HOST_MAP));
32 assert_true(pcmk_stonith_param(PCMK_STONITH_PROVIDES));
33 assert_true(pcmk_stonith_param(PCMK_STONITH_STONITH_TIMEOUT));
34 }
35
36 static void
37 is_stonith_action_param(void **state)
38 {
39
40
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))