58 iter != NULL; iter = iter->next) {
62 if (strcmp(rsc->
id,
"exim-group") == 0) {
64 }
else if (strcmp(rsc->
id,
"httpd-bundle") == 0) {
66 }
else if (strcmp(rsc->
id,
"inactive-clone") == 0) {
68 }
else if (strcmp(rsc->
id,
"inactive-group") == 0) {
70 }
else if (strcmp(rsc->
id,
"mysql-clone-group") == 0) {
72 }
else if (strcmp(rsc->
id,
"promotable-clone") == 0) {
81 teardown(
void **state) {
88 bad_args(
void **state) {
107 name = g_ascii_strup(rsc->
id, -1);
118 primitive_rsc(
void **state) {
123 iter != NULL; iter = iter->next) {
127 if (strcmp(rsc->
id,
"dummy") == 0) {
133 assert_non_null(
dummy);
137 assert_ptr_equal(
dummy,
155 assert_ptr_equal(
dummy,
161 group_rsc(
void **state) {
190 inactive_group_rsc(
void **state) {
213 group_member_rsc(
void **state) {
218 iter != NULL; iter = iter->next) {
222 if (strcmp(rsc->
id,
"Public-IP") == 0) {
228 assert_non_null(public_ip);
231 assert_ptr_equal(public_ip,
native_find_rsc(public_ip,
"Public-IP", NULL, 0));
232 assert_ptr_equal(public_ip,
250 assert_ptr_equal(public_ip,
256 inactive_group_member_rsc(
void **state) {
261 iter != NULL; iter = iter->next) {
265 if (strcmp(rsc->
id,
"inactive-dummy-1") == 0) {
266 inactive_dummy_1 = rsc;
271 assert_non_null(inactive_dummy_1);
274 assert_ptr_equal(inactive_dummy_1,
native_find_rsc(inactive_dummy_1,
"inactive-dummy-1", NULL, 0));
275 assert_ptr_equal(inactive_dummy_1,
280 assert_null(
native_find_rsc(inactive_dummy_1,
"inactive-dummy-1", NULL,
293 clone_rsc(
void **state) {
335 inactive_clone_rsc(
void **state) {
357 clone_instance_rsc(
void **state) {
363 iter != NULL; iter = iter->next) {
367 if (strcmp(rsc->
id,
"promotable-rsc:0") == 0) {
369 }
else if (strcmp(rsc->
id,
"promotable-rsc:1") == 0) {
498 renamed_rsc(
void **state) {
504 iter != NULL; iter = iter->next) {
508 if (strcmp(rsc->
id,
"promotable-rsc:0") == 0) {
510 }
else if (strcmp(rsc->
id,
"promotable-rsc:1") == 0) {
528 bundle_rsc(
void **state) {
560 assert_non_null(ip_0);
561 assert_non_null(child_0);
562 assert_non_null(container_0);
563 assert_non_null(remote_0);
566 assert_ptr_equal(ip_0,
native_find_rsc(ip_0,
"httpd-bundle-ip-192.168.122.131", NULL, 0));
567 assert_ptr_equal(child_0,
native_find_rsc(child_0,
"httpd:0", NULL, 0));
568 assert_ptr_equal(container_0,
native_find_rsc(container_0,
"httpd-bundle-docker-0", NULL, 0));
569 assert_ptr_equal(remote_0,
native_find_rsc(remote_0,
"httpd-bundle-0", NULL, 0));
578 assert_ptr_equal(ip_0,
585 assert_ptr_equal(child_0,
592 assert_ptr_equal(container_0,
599 assert_ptr_equal(remote_0,
608 assert_ptr_equal(child_0,
613 assert_ptr_equal(child_0,
618 assert_ptr_equal(child_0,
622 assert_ptr_equal(child_0,
654 assert_ptr_equal(ip_0,
656 "httpd-bundle-ip-192.168.122.131",
658 assert_ptr_equal(child_0,
661 assert_ptr_equal(container_0,
664 assert_ptr_equal(remote_0,
671 bundle_replica_rsc(
void **state)
677 clone_group_rsc(
void **rsc) {
719 clone_group_instance_rsc(
void **rsc) {
725 iter != NULL; iter = iter->next) {
729 if (strcmp(rsc->
id,
"mysql-group:0") == 0) {
731 }
else if (strcmp(rsc->
id,
"mysql-group:1") == 0) {
860 clone_group_member_rsc(
void **state) {
865 iter != NULL; iter = iter->next) {
869 if (strcmp(rsc->
id,
"mysql-group:0") == 0) {
871 iter2 != NULL; iter2 = iter2->next) {
874 if (strcmp(child->
id,
"mysql-proxy:0") == 0) {
884 assert_non_null(mysql_proxy);
887 assert_ptr_equal(mysql_proxy,
native_find_rsc(mysql_proxy,
"mysql-proxy:0", NULL, 0));
888 assert_ptr_equal(mysql_proxy,
893 assert_ptr_equal(mysql_proxy,
896 assert_ptr_equal(mysql_proxy,
909 assert_ptr_equal(mysql_proxy,
919 cmocka_unit_test(bad_args),
920 cmocka_unit_test(primitive_rsc),
921 cmocka_unit_test(group_rsc),
922 cmocka_unit_test(inactive_group_rsc),
923 cmocka_unit_test(group_member_rsc),
924 cmocka_unit_test(inactive_group_member_rsc),
925 cmocka_unit_test(clone_rsc),
926 cmocka_unit_test(inactive_clone_rsc),
927 cmocka_unit_test(clone_instance_rsc),
928 cmocka_unit_test(renamed_rsc),
929 cmocka_unit_test(bundle_rsc),
930 cmocka_unit_test(bundle_replica_rsc),
931 cmocka_unit_test(clone_group_rsc),
932 cmocka_unit_test(clone_group_instance_rsc),
933 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)
void pcmk__xml_init(void)
pcmk_resource_t * ip
IP address resource for ipaddr.
pcmk__scheduler_private_t * priv
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.
void pcmk__xml_cleanup(void)
pcmk_resource_t * promotable_0
pcmk__resource_private_t * priv
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
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1