pacemaker
2.1.8-3980678f03
Scalable High-Availability cluster resource manager
lib
pengine
tests
status
set_working_set_defaults_test.c
Go to the documentation of this file.
1
/*
2
* Copyright 2024 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
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
=
pcmk__assert_alloc
(1,
24
sizeof
(
pcmk_scheduler_t
));
25
26
set_working_set_defaults
(
scheduler
);
27
28
flags
=
pcmk_sched_symmetric_cluster
29
|
pcmk_sched_stop_removed_resources
30
|
pcmk_sched_cancel_removed_actions
;
31
32
if
(!strcmp(
PCMK__CONCURRENT_FENCING_DEFAULT
,
PCMK_VALUE_TRUE
)) {
33
flags
|=
pcmk_sched_concurrent_fencing
;
34
}
35
36
37
assert_null(
scheduler
->
priv
);
38
assert_int_equal(
scheduler
->
order_id
, 1);
39
assert_int_equal(
scheduler
->
action_id
, 1);
40
assert_int_equal(
scheduler
->
no_quorum_policy
,
pcmk_no_quorum_stop
);
41
assert_int_equal(
scheduler
->
flags
,
flags
);
42
43
/* Avoid calling pe_free_working_set here so we don't artificially
44
* inflate the coverage numbers.
45
*/
46
free(
scheduler
);
47
}
48
49
PCMK__UNIT_TEST
(NULL, NULL,
50
cmocka_unit_test(check_defaults))
pe_working_set_s::no_quorum_policy
enum pe_quorum_policy no_quorum_policy
Definition:
scheduler.h:217
mock_private.h
internal.h
pcmk_sched_symmetric_cluster
Definition:
scheduler.h:83
PCMK__UNIT_TEST
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
Definition:
unittest_internal.h:196
pcmk_no_quorum_stop
Definition:
scheduler.h:42
pcmk_sched_concurrent_fencing
Definition:
scheduler.h:102
pe_working_set_s::order_id
int order_id
Definition:
scheduler.h:245
pe_working_set_s
Definition:
scheduler.h:191
PCMK__CONCURRENT_FENCING_DEFAULT
#define PCMK__CONCURRENT_FENCING_DEFAULT
Definition:
config.h:556
scheduler.h
Scheduler API.
crm_internal.h
pe_working_set_s::priv
void * priv
Definition:
scheduler.h:264
pe_working_set_s::action_id
int action_id
Definition:
scheduler.h:246
set_working_set_defaults
void set_working_set_defaults(pcmk_scheduler_t *scheduler)
Definition:
status.c:407
PCMK_VALUE_TRUE
#define PCMK_VALUE_TRUE
Definition:
options.h:215
pcmk_sched_cancel_removed_actions
Definition:
scheduler.h:114
status.h
Cluster status and scheduling.
scheduler
pcmk_scheduler_t * scheduler
Definition:
native_find_rsc_test.c:19
unittest_internal.h
pcmk_sched_stop_removed_resources
Definition:
scheduler.h:108
pe_working_set_s::flags
unsigned long long flags
Definition:
scheduler.h:211
pcmk__assert_alloc
#define pcmk__assert_alloc(nmemb, size)
Definition:
internal.h:297
flags
uint64_t flags
Definition:
remote.c:215
Generated on Thu Aug 8 2024 18:08:11 for pacemaker by
1.8.14