55 if (strcmp(rsc->
id,
"dummy") == 0) {
57 }
else if (strcmp(rsc->
id,
"exim-group") == 0) {
59 }
else if (strcmp(rsc->
id,
"httpd-bundle") == 0) {
61 }
else if (strcmp(rsc->
id,
"mysql-clone-group") == 0) {
62 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
65 if (strcmp(child->
id,
"mysql-group:0") == 0) {
67 }
else if (strcmp(child->
id,
"mysql-group:1") == 0) {
71 }
else if (strcmp(rsc->
id,
"promotable-clone") == 0) {
72 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
75 if (strcmp(child->
id,
"promotable-rsc:0") == 0) {
77 }
else if (strcmp(child->
id,
"promotable-rsc:1") == 0) {
88 teardown(
void **state) {
95 bad_args(
void **state) {
98 assert_false(pe_base_name_eq(NULL,
"dummy"));
99 assert_false(pe_base_name_eq(
dummy, NULL));
102 assert_false(pe_base_name_eq(
dummy,
"dummy"));
107 primitive_rsc(
void **state) {
108 assert_true(pe_base_name_eq(
dummy,
"dummy"));
109 assert_false(pe_base_name_eq(
dummy,
"DUMMY"));
110 assert_false(pe_base_name_eq(
dummy,
"dUmMy"));
111 assert_false(pe_base_name_eq(
dummy,
"dummy0"));
112 assert_false(pe_base_name_eq(
dummy,
"dummy:0"));
116 group_rsc(
void **state) {
117 assert_true(pe_base_name_eq(
exim_group,
"exim-group"));
118 assert_false(pe_base_name_eq(
exim_group,
"EXIM-GROUP"));
119 assert_false(pe_base_name_eq(
exim_group,
"exim-group0"));
120 assert_false(pe_base_name_eq(
exim_group,
"exim-group:0"));
121 assert_false(pe_base_name_eq(
exim_group,
"Public-IP"));
125 clone_rsc(
void **state) {
126 assert_true(pe_base_name_eq(
promotable_0,
"promotable-rsc"));
127 assert_true(pe_base_name_eq(
promotable_1,
"promotable-rsc"));
129 assert_false(pe_base_name_eq(
promotable_0,
"promotable-rsc:0"));
130 assert_false(pe_base_name_eq(
promotable_1,
"promotable-rsc:1"));
131 assert_false(pe_base_name_eq(
promotable_0,
"PROMOTABLE-RSC"));
132 assert_false(pe_base_name_eq(
promotable_1,
"PROMOTABLE-RSC"));
133 assert_false(pe_base_name_eq(
promotable_0,
"Promotable-rsc"));
134 assert_false(pe_base_name_eq(
promotable_1,
"Promotable-rsc"));
138 bundle_rsc(
void **state) {
139 assert_true(pe_base_name_eq(
httpd_bundle,
"httpd-bundle"));
140 assert_false(pe_base_name_eq(
httpd_bundle,
"HTTPD-BUNDLE"));
142 assert_false(pe_base_name_eq(
httpd_bundle,
"httpd-docker-0"));
146 cmocka_unit_test(bad_args),
147 cmocka_unit_test(primitive_rsc),
148 cmocka_unit_test(group_rsc),
149 cmocka_unit_test(clone_rsc),
150 cmocka_unit_test(bundle_rsc))
pcmk_resource_t * exim_group
pcmk_resource_t * httpd_bundle
GList * children
Resource's child resources, if any.
void crm_xml_init(void)
Initialize the CRM XML subsystem.
#define pe__set_working_set_flags(scheduler, flags_to_set)
xmlNode * filename2xml(const char *filename)
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.
gboolean cluster_status(pcmk_scheduler_t *scheduler)
GList * resources
Resources in cluster.
Implementation of pcmk_resource_t.
pcmk_resource_t * promotable_0
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
Wrappers for and extensions to libxml2.
pcmk_scheduler_t * scheduler
pcmk_scheduler_t * pe_new_working_set(void)
Create a new object to hold scheduler data.
void pe_free_working_set(pcmk_scheduler_t *scheduler)
Free scheduler data.
pcmk_resource_t * mysql_group_1
Cluster status and scheduling.
Skip counting of total, disabled, and blocked resource instances.
pcmk_resource_t * promotable_1
pcmk_resource_t * mysql_group_0
char * id
Resource ID in configuration.