52 iter != NULL; iter = iter->next) {
56 if (strcmp(rsc->
id,
"dummy") == 0) {
59 }
else if (strcmp(rsc->
id,
"exim-group") == 0) {
62 }
else if (strcmp(rsc->
id,
"httpd-bundle") == 0) {
65 }
else if (strcmp(rsc->
id,
"mysql-clone-group") == 0) {
67 iter != NULL; iter = iter->next) {
71 if (strcmp(child->
id,
"mysql-group:0") == 0) {
73 }
else if (strcmp(child->
id,
"mysql-group:1") == 0) {
78 }
else if (strcmp(rsc->
id,
"promotable-clone") == 0) {
80 iter != NULL; iter = iter->next) {
84 if (strcmp(child->
id,
"promotable-rsc:0") == 0) {
86 }
else if (strcmp(child->
id,
"promotable-rsc:1") == 0) {
97 teardown(
void **state) {
104 bad_args(
void **state) {
107 assert_false(pe_base_name_eq(NULL,
"dummy"));
108 assert_false(pe_base_name_eq(
dummy, NULL));
111 assert_false(pe_base_name_eq(
dummy,
"dummy"));
116 primitive_rsc(
void **state) {
117 assert_true(pe_base_name_eq(
dummy,
"dummy"));
118 assert_false(pe_base_name_eq(
dummy,
"DUMMY"));
119 assert_false(pe_base_name_eq(
dummy,
"dUmMy"));
120 assert_false(pe_base_name_eq(
dummy,
"dummy0"));
121 assert_false(pe_base_name_eq(
dummy,
"dummy:0"));
125 group_rsc(
void **state) {
126 assert_true(pe_base_name_eq(
exim_group,
"exim-group"));
127 assert_false(pe_base_name_eq(
exim_group,
"EXIM-GROUP"));
128 assert_false(pe_base_name_eq(
exim_group,
"exim-group0"));
129 assert_false(pe_base_name_eq(
exim_group,
"exim-group:0"));
130 assert_false(pe_base_name_eq(
exim_group,
"Public-IP"));
134 clone_rsc(
void **state) {
135 assert_true(pe_base_name_eq(
promotable_0,
"promotable-rsc"));
136 assert_true(pe_base_name_eq(
promotable_1,
"promotable-rsc"));
138 assert_false(pe_base_name_eq(
promotable_0,
"promotable-rsc:0"));
139 assert_false(pe_base_name_eq(
promotable_1,
"promotable-rsc:1"));
140 assert_false(pe_base_name_eq(
promotable_0,
"PROMOTABLE-RSC"));
141 assert_false(pe_base_name_eq(
promotable_1,
"PROMOTABLE-RSC"));
142 assert_false(pe_base_name_eq(
promotable_0,
"Promotable-rsc"));
143 assert_false(pe_base_name_eq(
promotable_1,
"Promotable-rsc"));
147 bundle_rsc(
void **state) {
148 assert_true(pe_base_name_eq(
httpd_bundle,
"httpd-bundle"));
149 assert_false(pe_base_name_eq(
httpd_bundle,
"HTTPD-BUNDLE"));
151 assert_false(pe_base_name_eq(
httpd_bundle,
"httpd-docker-0"));
155 cmocka_unit_test(bad_args),
156 cmocka_unit_test(primitive_rsc),
157 cmocka_unit_test(group_rsc),
158 cmocka_unit_test(clone_rsc),
159 cmocka_unit_test(bundle_rsc))
pcmk_resource_t * exim_group
pcmk_resource_t * httpd_bundle
void pcmk__xml_init(void)
pcmk__scheduler_private_t * priv
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
gboolean cluster_status(pcmk_scheduler_t *scheduler)
void pcmk__xml_cleanup(void)
pcmk_resource_t * promotable_0
pcmk__resource_private_t * priv
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.
xmlNode * pcmk__xml_read(const char *filename)
void pe_free_working_set(pcmk_scheduler_t *scheduler)
Free scheduler data.
pcmk_resource_t * mysql_group_1
Cluster status and scheduling.
pcmk_resource_t * promotable_1
#define pcmk__set_scheduler_flags(scheduler, flags_to_set)
pcmk_resource_t * mysql_group_0
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1