This source file includes following definitions.
- check_defaults
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <crm/common/unittest_internal.h>
13
14 #include <crm/common/scheduler.h>
15 #include <crm/pengine/internal.h>
16 #include <crm/pengine/status.h>
17
18 #include "mock_private.h"
19
20 static void
21 check_defaults(void **state) {
22 uint32_t flags;
23 pcmk_scheduler_t *scheduler = calloc(1, sizeof(pcmk_scheduler_t));
24
25 set_working_set_defaults(scheduler);
26
27 flags = pcmk_sched_symmetric_cluster
28 |pcmk_sched_stop_removed_resources
29 |pcmk_sched_cancel_removed_actions;
30
31 if (!strcmp(PCMK__CONCURRENT_FENCING_DEFAULT, "true")) {
32 flags |= pcmk_sched_concurrent_fencing;
33 }
34
35
36 assert_null(scheduler->priv);
37 assert_int_equal(scheduler->order_id, 1);
38 assert_int_equal(scheduler->action_id, 1);
39 assert_int_equal(scheduler->no_quorum_policy, pcmk_no_quorum_stop);
40 assert_int_equal(scheduler->flags, flags);
41
42
43
44
45 free(scheduler);
46 }
47
48 PCMK__UNIT_TEST(NULL, NULL,
49 cmocka_unit_test(check_defaults))