This source file includes following definitions.
- null_is_not_in_maintenance
- node_is_in_maintenance
- node_is_not_in_maintenance
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <stdio.h>
13 #include <glib.h>
14
15 #include <crm/common/nodes.h>
16 #include <crm/common/unittest_internal.h>
17
18 static void
19 null_is_not_in_maintenance(void **state)
20 {
21 assert_false(pcmk_node_is_in_maintenance(NULL));
22 }
23
24 static void
25 node_is_in_maintenance(void **state)
26 {
27 struct pe_node_shared_s shared = {
28 .maintenance = TRUE,
29 };
30
31 pcmk_node_t node = {
32 .details = &shared,
33 };
34
35 assert_true(pcmk_node_is_in_maintenance(&node));
36 }
37
38 static void
39 node_is_not_in_maintenance(void **state)
40 {
41 struct pe_node_shared_s shared = {
42 .maintenance = FALSE,
43 };
44 pcmk_node_t node = {
45 .details = &shared,
46 };
47
48 assert_false(pcmk_node_is_in_maintenance(&node));
49 }
50
51 PCMK__UNIT_TEST(NULL, NULL,
52 cmocka_unit_test(null_is_not_in_maintenance),
53 cmocka_unit_test(node_is_in_maintenance),
54 cmocka_unit_test(node_is_not_in_maintenance))