54 if (strcmp(rsc->
id,
"dummy") == 0) {
56 }
else if (strcmp(rsc->
id,
"exim-group") == 0) {
58 }
else if (strcmp(rsc->
id,
"httpd-bundle") == 0) {
60 }
else if (strcmp(rsc->
id,
"mysql-clone-group") == 0) {
61 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
64 if (strcmp(child->
id,
"mysql-group:0") == 0) {
66 }
else if (strcmp(child->
id,
"mysql-group:1") == 0) {
70 }
else if (strcmp(rsc->
id,
"promotable-clone") == 0) {
71 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
74 if (strcmp(child->
id,
"promotable-rsc:0") == 0) {
76 }
else if (strcmp(child->
id,
"promotable-rsc:1") == 0) {
87 teardown(
void **state) {
94 bad_args(
void **state) {
97 assert_false(pe_base_name_eq(NULL,
"dummy"));
98 assert_false(pe_base_name_eq(
dummy, NULL));
101 assert_false(pe_base_name_eq(
dummy,
"dummy"));
106 primitive_rsc(
void **state) {
107 assert_true(pe_base_name_eq(
dummy,
"dummy"));
108 assert_false(pe_base_name_eq(
dummy,
"DUMMY"));
109 assert_false(pe_base_name_eq(
dummy,
"dUmMy"));
110 assert_false(pe_base_name_eq(
dummy,
"dummy0"));
111 assert_false(pe_base_name_eq(
dummy,
"dummy:0"));
115 group_rsc(
void **state) {
116 assert_true(pe_base_name_eq(
exim_group,
"exim-group"));
117 assert_false(pe_base_name_eq(
exim_group,
"EXIM-GROUP"));
118 assert_false(pe_base_name_eq(
exim_group,
"exim-group0"));
119 assert_false(pe_base_name_eq(
exim_group,
"exim-group:0"));
120 assert_false(pe_base_name_eq(
exim_group,
"Public-IP"));
124 clone_rsc(
void **state) {
125 assert_true(pe_base_name_eq(
promotable_0,
"promotable-rsc"));
126 assert_true(pe_base_name_eq(
promotable_1,
"promotable-rsc"));
128 assert_false(pe_base_name_eq(
promotable_0,
"promotable-rsc:0"));
129 assert_false(pe_base_name_eq(
promotable_1,
"promotable-rsc:1"));
130 assert_false(pe_base_name_eq(
promotable_0,
"PROMOTABLE-RSC"));
131 assert_false(pe_base_name_eq(
promotable_1,
"PROMOTABLE-RSC"));
132 assert_false(pe_base_name_eq(
promotable_0,
"Promotable-rsc"));
133 assert_false(pe_base_name_eq(
promotable_1,
"Promotable-rsc"));
137 bundle_rsc(
void **state) {
138 assert_true(pe_base_name_eq(
httpd_bundle,
"httpd-bundle"));
139 assert_false(pe_base_name_eq(
httpd_bundle,
"HTTPD-BUNDLE"));
141 assert_false(pe_base_name_eq(
httpd_bundle,
"httpd-docker-0"));
145 cmocka_unit_test(bad_args),
146 cmocka_unit_test(primitive_rsc),
147 cmocka_unit_test(group_rsc),
148 cmocka_unit_test(clone_rsc),
149 cmocka_unit_test(bundle_rsc))
void pe_free_working_set(pe_working_set_t *data_set)
Free a working set.
pe_resource_t * promotable_1
pe_working_set_t * pe_new_working_set(void)
Create a new working set.
#define pe_flag_no_compat
void crm_xml_init(void)
Initialize the CRM XML subsystem.
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
#define pe_flag_no_counts
Don't count total, disabled and blocked resource instances.
xmlNode * filename2xml(const char *filename)
pe_working_set_t * data_set
pe_resource_t * promotable_0
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
Wrappers for and extensions to libxml2.
Cluster status and scheduling.
pe_resource_t * mysql_group_0
gboolean cluster_status(pe_working_set_t *data_set)
#define pe__set_working_set_flags(working_set, flags_to_set)
pe_resource_t * httpd_bundle
pe_resource_t * exim_group
Data types for cluster status.
pe_resource_t * mysql_group_1