pacemaker  2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
set_working_set_defaults_test.c
Go to the documentation of this file.
1 /*
2  * Copyright 2023 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 
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 
26 
30 
31  if (!strcmp(PCMK__CONCURRENT_FENCING_DEFAULT, "true")) {
33  }
34 
35 
36  assert_null(scheduler->priv);
37  assert_int_equal(scheduler->order_id, 1);
38  assert_int_equal(scheduler->action_id, 1);
40  assert_int_equal(scheduler->flags, flags);
41 
42  /* Avoid calling pe_free_working_set here so we don't artificially
43  * inflate the coverage numbers.
44  */
45  free(scheduler);
46 }
47 
48 PCMK__UNIT_TEST(NULL, NULL,
49  cmocka_unit_test(check_defaults))
enum pe_quorum_policy no_quorum_policy
Response to loss of quorum.
Definition: scheduler.h:186
Whether cluster is symmetric (via symmetric-cluster property)
Definition: scheduler.h:74
Whether concurrent fencing is allowed (via concurrent-fencing property)
Definition: scheduler.h:89
int order_id
ID to use for next created ordering.
Definition: scheduler.h:210
PCMK__UNIT_TEST(NULL, NULL, cmocka_unit_test(bad_input), cmocka_unit_test(not_found), cmocka_unit_test(find_attrB), cmocka_unit_test(find_attrA_matching))
Implementation of pcmk_scheduler_t.
Definition: scheduler.h:172
#define PCMK__CONCURRENT_FENCING_DEFAULT
Definition: config.h:556
Scheduler API.
void * priv
For Pacemaker use only.
Definition: scheduler.h:229
int action_id
ID to use for next created action.
Definition: scheduler.h:211
void set_working_set_defaults(pcmk_scheduler_t *scheduler)
Definition: status.c:368
Cluster status and scheduling.
pcmk_scheduler_t * scheduler
unsigned long long flags
Group of enum pcmk_scheduler_flags.
Definition: scheduler.h:183
uint64_t flags
Definition: remote.c:215