pacemaker  2.1.6-802a72226b
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 General Public License version 2
7  * or later (GPLv2+) WITHOUT ANY WARRANTY.
8  */
9 
10 #include <crm_internal.h>
11 
13 #include <crm/pengine/internal.h>
14 #include <crm/pengine/pe_types.h>
15 #include <crm/pengine/status.h>
16 
17 #include "mock_private.h"
18 
19 static void
20 check_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 
45 PCMK__UNIT_TEST(NULL, NULL,
46  cmocka_unit_test(check_defaults))
enum pe_quorum_policy no_quorum_policy
Definition: pe_types.h:172
#define pe_flag_stop_action_orphans
Definition: pe_types.h:121
#define pe_flag_concurrent_fencing
Definition: pe_types.h:118
#define pe_flag_symmetric_cluster
Definition: pe_types.h:112
int order_id
Deprecated (will be removed in a future release)
Definition: pe_types.h:195
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))
#define PCMK__CONCURRENT_FENCING_DEFAULT
Definition: config.h:541
void set_working_set_defaults(pe_working_set_t *data_set)
Definition: status.c:368
pe_working_set_t * data_set
Cluster status and scheduling.
Data types for cluster status.
unsigned long long flags
Definition: pe_types.h:169
uint64_t flags
Definition: remote.c:215
#define pe_flag_stop_rsc_orphans
Definition: pe_types.h:120