61 if (strcmp(rsc->
id,
"exim-group") == 0) {
63 }
else if (strcmp(rsc->
id,
"httpd-bundle") == 0) {
65 }
else if (strcmp(rsc->
id,
"inactive-clone") == 0) {
67 }
else if (strcmp(rsc->
id,
"inactive-group") == 0) {
69 }
else if (strcmp(rsc->
id,
"mysql-clone-group") == 0) {
71 }
else if (strcmp(rsc->
id,
"promotable-clone") == 0) {
80 teardown(
void **state) {
87 bad_args(
void **state) {
106 name = g_ascii_strup(rsc->
id, -1);
117 primitive_rsc(
void **state) {
124 if (strcmp(rsc->
id,
"dummy") == 0) {
130 assert_non_null(
dummy);
134 assert_ptr_equal(
dummy,
152 assert_ptr_equal(
dummy,
158 group_rsc(
void **state) {
187 inactive_group_rsc(
void **state) {
210 group_member_rsc(
void **state) {
217 if (strcmp(rsc->
id,
"Public-IP") == 0) {
223 assert_non_null(public_ip);
226 assert_ptr_equal(public_ip,
native_find_rsc(public_ip,
"Public-IP", NULL, 0));
227 assert_ptr_equal(public_ip,
245 assert_ptr_equal(public_ip,
251 inactive_group_member_rsc(
void **state) {
258 if (strcmp(rsc->
id,
"inactive-dummy-1") == 0) {
259 inactive_dummy_1 = rsc;
264 assert_non_null(inactive_dummy_1);
267 assert_ptr_equal(inactive_dummy_1,
native_find_rsc(inactive_dummy_1,
"inactive-dummy-1", NULL, 0));
268 assert_ptr_equal(inactive_dummy_1,
273 assert_null(
native_find_rsc(inactive_dummy_1,
"inactive-dummy-1", NULL,
286 clone_rsc(
void **state) {
328 inactive_clone_rsc(
void **state) {
350 clone_instance_rsc(
void **state) {
358 if (strcmp(rsc->
id,
"promotable-rsc:0") == 0) {
360 }
else if (strcmp(rsc->
id,
"promotable-rsc:1") == 0) {
489 renamed_rsc(
void **state) {
497 if (strcmp(rsc->
id,
"promotable-rsc:0") == 0) {
499 }
else if (strcmp(rsc->
id,
"promotable-rsc:1") == 0) {
517 bundle_rsc(
void **state) {
549 assert_non_null(ip_0);
550 assert_non_null(child_0);
551 assert_non_null(container_0);
552 assert_non_null(remote_0);
555 assert_ptr_equal(ip_0,
native_find_rsc(ip_0,
"httpd-bundle-ip-192.168.122.131", NULL, 0));
556 assert_ptr_equal(child_0,
native_find_rsc(child_0,
"httpd:0", NULL, 0));
557 assert_ptr_equal(container_0,
native_find_rsc(container_0,
"httpd-bundle-docker-0", NULL, 0));
558 assert_ptr_equal(remote_0,
native_find_rsc(remote_0,
"httpd-bundle-0", NULL, 0));
567 assert_ptr_equal(ip_0,
574 assert_ptr_equal(child_0,
581 assert_ptr_equal(container_0,
588 assert_ptr_equal(remote_0,
597 assert_ptr_equal(child_0,
602 assert_ptr_equal(child_0,
607 assert_ptr_equal(child_0,
611 assert_ptr_equal(child_0,
643 assert_ptr_equal(ip_0,
645 "httpd-bundle-ip-192.168.122.131",
647 assert_ptr_equal(child_0,
650 assert_ptr_equal(container_0,
653 assert_ptr_equal(remote_0,
660 bundle_replica_rsc(
void **state)
666 clone_group_rsc(
void **rsc) {
708 clone_group_instance_rsc(
void **rsc) {
716 if (strcmp(rsc->
id,
"mysql-group:0") == 0) {
718 }
else if (strcmp(rsc->
id,
"mysql-group:1") == 0) {
847 clone_group_member_rsc(
void **state) {
854 if (strcmp(rsc->
id,
"mysql-group:0") == 0) {
855 for (GList *iter2 = rsc->
children; iter2 != NULL; iter2 = iter2->next) {
858 if (strcmp(child->
id,
"mysql-proxy:0") == 0) {
868 assert_non_null(mysql_proxy);
871 assert_ptr_equal(mysql_proxy,
native_find_rsc(mysql_proxy,
"mysql-proxy:0", NULL, 0));
872 assert_ptr_equal(mysql_proxy,
877 assert_ptr_equal(mysql_proxy,
880 assert_ptr_equal(mysql_proxy,
893 assert_ptr_equal(mysql_proxy,
903 cmocka_unit_test(bad_args),
904 cmocka_unit_test(primitive_rsc),
905 cmocka_unit_test(group_rsc),
906 cmocka_unit_test(inactive_group_rsc),
907 cmocka_unit_test(group_member_rsc),
908 cmocka_unit_test(inactive_group_member_rsc),
909 cmocka_unit_test(clone_rsc),
910 cmocka_unit_test(inactive_clone_rsc),
911 cmocka_unit_test(clone_instance_rsc),
912 cmocka_unit_test(renamed_rsc),
913 cmocka_unit_test(bundle_rsc),
914 cmocka_unit_test(bundle_replica_rsc),
915 cmocka_unit_test(clone_group_rsc),
916 cmocka_unit_test(clone_group_instance_rsc),
917 cmocka_unit_test(clone_group_member_rsc))
pcmk_resource_t * inactive_group
pcmk_node_t * pcmk_find_node(const pcmk_scheduler_t *scheduler, const char *node_name)
Find a node by name in scheduler data.
Also match anonymous clone instances by base name.
Match only clones and their instances, by either clone or instance ID.
void pe__foreach_bundle_replica(pcmk_resource_t *bundle, bool(*fn)(pcmk__bundle_replica_t *, void *), void *user_data)
pcmk_resource_t * ip
IP address resource for ipaddr.
void crm_xml_init(void)
Initialize the CRM XML subsystem.
pcmk_resource_t * inactive_clone
#define PCMK__UNIT_TEST(group_setup, group_teardown,...)
gboolean cluster_status(pcmk_scheduler_t *scheduler)
Also match clone instance ID from resource history.
pcmk_resource_t * promotable_0
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
Wrappers for and extensions to libxml2.
Match clone instances (even unique) by base name as well as exact ID.
pcmk_resource_t * mysql_clone_group
pcmk_resource_t * child
Instance of bundled resource.
pcmk_scheduler_t * pe_new_working_set(void)
Create a new object to hold scheduler data.
pcmk_node_t * httpd_bundle_0
A single instance of a bundle.
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
pcmk_resource_t * native_find_rsc(pcmk_resource_t *rsc, const char *id, const pcmk_node_t *node, int flags)
pcmk_resource_t * container
Container associated with this instance.
Cluster status and scheduling.
pcmk_scheduler_t * scheduler
If matching by node, compare current node instead of assigned node.
pcmk_resource_t * httpd_bundle
pcmk_resource_t * promotable_1
pcmk_resource_t * promotable_clone
pcmk_resource_t * exim_group
pcmk_resource_t * remote
Pacemaker Remote connection into container.
#define pcmk__set_scheduler_flags(scheduler, flags_to_set)
pcmk_resource_t * mysql_group_0