19 #define PE__VARIANT_BUNDLE 1 63 if (strcmp(rsc->
id,
"exim-group") == 0) {
65 }
else if (strcmp(rsc->
id,
"httpd-bundle") == 0) {
67 }
else if (strcmp(rsc->
id,
"inactive-clone") == 0) {
69 }
else if (strcmp(rsc->
id,
"inactive-group") == 0) {
71 }
else if (strcmp(rsc->
id,
"mysql-clone-group") == 0) {
73 }
else if (strcmp(rsc->
id,
"promotable-clone") == 0) {
82 teardown(
void **state) {
89 bad_args(
void **state) {
108 name = g_ascii_strup(rsc->
id, -1);
119 primitive_rsc(
void **state) {
126 if (strcmp(rsc->
id,
"dummy") == 0) {
132 assert_non_null(
dummy);
153 group_rsc(
void **state) {
175 inactive_group_rsc(
void **state) {
198 group_member_rsc(
void **state) {
205 if (strcmp(rsc->
id,
"Public-IP") == 0) {
211 assert_non_null(public_ip);
214 assert_ptr_equal(public_ip,
native_find_rsc(public_ip,
"Public-IP", NULL, 0));
232 inactive_group_member_rsc(
void **state) {
239 if (strcmp(rsc->
id,
"inactive-dummy-1") == 0) {
240 inactive_dummy_1 = rsc;
245 assert_non_null(inactive_dummy_1);
248 assert_ptr_equal(inactive_dummy_1,
native_find_rsc(inactive_dummy_1,
"inactive-dummy-1", NULL, 0));
266 clone_rsc(
void **state) {
292 inactive_clone_rsc(
void **state) {
312 clone_instance_rsc(
void **state) {
320 if (strcmp(rsc->
id,
"promotable-rsc:0") == 0) {
322 }
else if (strcmp(rsc->
id,
"promotable-rsc:1") == 0) {
389 renamed_rsc(
void **state) {
397 if (strcmp(rsc->
id,
"promotable-rsc:0") == 0) {
399 }
else if (strcmp(rsc->
id,
"promotable-rsc:1") == 0) {
413 bundle_rsc(
void **state) {
432 bundle_replica_rsc(
void **state) {
433 pe__bundle_variant_data_t *bundle_data = NULL;
434 pe__bundle_replica_t *replica_0 = NULL;
442 replica_0 = (pe__bundle_replica_t *) bundle_data->replicas->data;
444 ip_0 = replica_0->ip;
445 child_0 = replica_0->child;
446 container_0 = replica_0->container;
447 remote_0 = replica_0->remote;
449 assert_non_null(ip_0);
450 assert_non_null(child_0);
451 assert_non_null(container_0);
452 assert_non_null(remote_0);
455 assert_ptr_equal(ip_0,
native_find_rsc(ip_0,
"httpd-bundle-ip-192.168.122.131", NULL, 0));
456 assert_ptr_equal(child_0,
native_find_rsc(child_0,
"httpd:0", NULL, 0));
457 assert_ptr_equal(container_0,
native_find_rsc(container_0,
"httpd-bundle-docker-0", NULL, 0));
458 assert_ptr_equal(remote_0,
native_find_rsc(remote_0,
"httpd-bundle-0", NULL, 0));
515 clone_group_rsc(
void **rsc) {
541 clone_group_instance_rsc(
void **rsc) {
549 if (strcmp(rsc->
id,
"mysql-group:0") == 0) {
551 }
else if (strcmp(rsc->
id,
"mysql-group:1") == 0) {
618 clone_group_member_rsc(
void **state) {
625 if (strcmp(rsc->
id,
"mysql-group:0") == 0) {
626 for (GList *iter2 = rsc->
children; iter2 != NULL; iter2 = iter2->next) {
629 if (strcmp(child->
id,
"mysql-proxy:0") == 0) {
639 assert_non_null(mysql_proxy);
642 assert_ptr_equal(mysql_proxy,
native_find_rsc(mysql_proxy,
"mysql-proxy:0", NULL, 0));
663 cmocka_unit_test(bad_args),
664 cmocka_unit_test(primitive_rsc),
665 cmocka_unit_test(group_rsc),
666 cmocka_unit_test(inactive_group_rsc),
667 cmocka_unit_test(group_member_rsc),
668 cmocka_unit_test(inactive_group_member_rsc),
669 cmocka_unit_test(clone_rsc),
670 cmocka_unit_test(inactive_clone_rsc),
671 cmocka_unit_test(clone_instance_rsc),
672 cmocka_unit_test(renamed_rsc),
673 cmocka_unit_test(bundle_rsc),
674 cmocka_unit_test(bundle_replica_rsc),
675 cmocka_unit_test(clone_group_rsc),
676 cmocka_unit_test(clone_group_instance_rsc),
677 cmocka_unit_test(clone_group_member_rsc))
pe_resource_t * inactive_clone
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
match resource not running anywhere
void crm_xml_init(void)
Initialize the CRM XML subsystem.
pe_resource_t * httpd_bundle
#define pe_flag_no_counts
Don't count total, disabled and blocked resource instances.
pe_resource_t * exim_group
pe_resource_t * inactive_group
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))
pe_resource_t * promotable_0
match only clone instances
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
pe_working_set_t * data_set
Wrappers for and extensions to libxml2.
pe_node_t * httpd_bundle_0
pe_resource_t * mysql_clone_group
match base name of any clone instance
pe_resource_t * promotable_clone
match resource ID or LRM history ID
Cluster status and scheduling.
pe_resource_t * native_find_rsc(pe_resource_t *rsc, const char *id, const pe_node_t *node, int flags)
pe_resource_t * mysql_group_0
gboolean cluster_status(pe_working_set_t *data_set)
pe_node_t * pe_find_node(const GList *node_list, const char *node_name)
Find a node by name in a list of nodes.
#define pe__set_working_set_flags(working_set, flags_to_set)
Data types for cluster status.
pe_resource_t * mysql_group_1
match resource active on specified node
match base name of anonymous clone instances