pacemaker 2.1.5-a3f44794f94
Scalable High-Availability cluster resource manager
set_working_set_defaults_test.c
Go to the documentation of this file.
1/*
2 * Copyright 2022 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 Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10#include <crm_internal.h>
11
15#include <crm/pengine/status.h>
16
17#include "mock_private.h"
18
19static void
20check_defaults(void **state) {
21 uint32_t flags;
22 pe_working_set_t *data_set = calloc(1, sizeof(pe_working_set_t));
23
25
27
28 if (!strcmp(PCMK__CONCURRENT_FENCING_DEFAULT, "true")) {
30 }
31
32
33 assert_null(data_set->priv);
34 assert_int_equal(data_set->order_id, 1);
35 assert_int_equal(data_set->action_id, 1);
36 assert_int_equal(data_set->no_quorum_policy, no_quorum_stop);
37 assert_int_equal(data_set->flags, flags);
38
39 /* Avoid calling pe_free_working_set here so we don't artificially
40 * inflate the coverage numbers.
41 */
42 free(data_set);
43}
44
45PCMK__UNIT_TEST(NULL, NULL,
46 cmocka_unit_test(check_defaults))
uint64_t flags
Definition: remote.c:3
#define PCMK__CONCURRENT_FENCING_DEFAULT
Definition: config.h:535
pe_working_set_t * data_set
Data types for cluster status.
@ no_quorum_stop
Definition: pe_types.h:65
#define pe_flag_symmetric_cluster
Definition: pe_types.h:96
#define pe_flag_concurrent_fencing
Definition: pe_types.h:102
#define pe_flag_stop_rsc_orphans
Definition: pe_types.h:104
#define pe_flag_stop_action_orphans
Definition: pe_types.h:105
Cluster status and scheduling.
void set_working_set_defaults(pe_working_set_t *data_set)
Definition: status.c:368
unsigned long long flags
Definition: pe_types.h:153
enum pe_quorum_policy no_quorum_policy
Definition: pe_types.h:156
int order_id
Deprecated (will be removed in a future release)
Definition: pe_types.h:179
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)