From 1589a3e7c32d3b49ccb7273fa36a99f2996899da396dbda0ef37211677349b3b Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Mon, 23 Apr 2012 11:15:16 +0000 Subject: [PATCH] - Add provides to identify support level for tickets (bnc#752241) - Resolve coverity RESOURCE_LEAK, REVERSE_INULL and UNREACHABLE defects - Tools: crm_simulate - Support to grant/revoke/standby/activate tickets from the new ticket state section (bnc#752241) - Tools: Add crm_ticket to be profiled by valgrind - Tools: crm_ticket - Display the tickets that are referenced in rsc_ticket constraints but have never been granted yet (bnc#752241) - Tools: crm_mon - Support to display tickets (bnc#752242) - PE: Move the ticket state section to "/cib/status/tickets/ticket_state" (bnc#752241) - PE: Support to make tickets standby for relinquishing tickets gracefully (bnc#752241) - Tools: Implement a new crm_ticket (bnc#752241) - Tools: Update CLI regression tests for the new crm_ticket - Tools: Add CLI regression tests for ticket standby state - PE: Update regression tests for the new ticket state section - PE: Support to make tickets standby for relinquishing tickets gracefully (regression tests) - Tools: crm_ticket - Granting/revoking tickets need user to confirm unless "--force" option is used (bnc#752269) - Tools: Implement the support of granting/revoking tickets for crm_simulate (bnc#752241) OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=34 --- pacemaker-coverity-defects.diff | 76 + pacemaker-crm_mon-tickets.diff | 109 + pacemaker-crm_simulate-ticket-state.diff | 206 + pacemaker-crm_ticket-all-tickets.diff | 39 + pacemaker-crm_ticket-force.diff | 143 + pacemaker-crm_ticket-tests-standby.diff | 238 + pacemaker-crm_ticket-tests-update.diff | 91 + pacemaker-crm_ticket-valgrind.diff | 47 + pacemaker-crm_ticket.diff | 1139 +++ pacemaker-log-fix.diff | 23 + pacemaker-ticket-last-granted-prefix.diff | 19 + pacemaker-ticket-standby-tests.diff | 10643 ++++++++++++++++++++ pacemaker-ticket-standby.diff | 96 + pacemaker-ticket-state-tests.diff | 565 ++ pacemaker-ticket-state.diff | 364 + pacemaker-tickets-crm_simulate.diff | 97 + pacemaker.changes | 50 + pacemaker.spec | 46 +- 18 files changed, 13987 insertions(+), 4 deletions(-) create mode 100644 pacemaker-coverity-defects.diff create mode 100644 pacemaker-crm_mon-tickets.diff create mode 100644 pacemaker-crm_simulate-ticket-state.diff create mode 100644 pacemaker-crm_ticket-all-tickets.diff create mode 100644 pacemaker-crm_ticket-force.diff create mode 100644 pacemaker-crm_ticket-tests-standby.diff create mode 100644 pacemaker-crm_ticket-tests-update.diff create mode 100644 pacemaker-crm_ticket-valgrind.diff create mode 100644 pacemaker-crm_ticket.diff create mode 100644 pacemaker-log-fix.diff create mode 100644 pacemaker-ticket-last-granted-prefix.diff create mode 100644 pacemaker-ticket-standby-tests.diff create mode 100644 pacemaker-ticket-standby.diff create mode 100644 pacemaker-ticket-state-tests.diff create mode 100644 pacemaker-ticket-state.diff create mode 100644 pacemaker-tickets-crm_simulate.diff diff --git a/pacemaker-coverity-defects.diff b/pacemaker-coverity-defects.diff new file mode 100644 index 0000000..e16d21b --- /dev/null +++ b/pacemaker-coverity-defects.diff @@ -0,0 +1,76 @@ +commit 54001929bb3faf05d25176cdc84097ec5fa0979f +Author: Gao,Yan +Date: Mon Mar 26 12:22:32 2012 +0800 + + High: Resolve coverity RESOURCE_LEAK, REVERSE_INULL and UNREACHABLE defects + +diff --git a/lib/pengine/unpack.c b/lib/pengine/unpack.c +index 4a8a20f..3485f78 100644 +--- a/lib/pengine/unpack.c ++++ b/lib/pengine/unpack.c +@@ -548,10 +548,12 @@ get_ticket_state_legacy(gpointer key, gpointer value, gpointer user_data) + } + + if (ticket_id == NULL || strlen(ticket_id) == 0) { ++ crm_free(state_key); + return; + } + + if (state_key == NULL || strlen(state_key) == 0) { ++ crm_free(state_key); + return; + } + +@@ -559,6 +561,7 @@ get_ticket_state_legacy(gpointer key, gpointer value, gpointer user_data) + if (ticket == NULL) { + ticket = ticket_new(ticket_id, data_set); + if (ticket == NULL) { ++ crm_free(state_key); + return; + } + } +diff --git a/tools/crm_ticket.c b/tools/crm_ticket.c +index e822de4..aec9e98 100644 +--- a/tools/crm_ticket.c ++++ b/tools/crm_ticket.c +@@ -308,7 +308,7 @@ find_ticket_state_attr_legacy(cib_t * the_cib, const char *attr, const char *tic + + if (attr_name) { + const char *attr_prefix = NULL; +- const char *long_key = NULL; ++ char *long_key = NULL; + + if (crm_str_eq(attr_name, "granted", TRUE)) { + attr_prefix = "granted-ticket"; +@@ -321,6 +321,8 @@ find_ticket_state_attr_legacy(cib_t * the_cib, const char *attr, const char *tic + offset += snprintf(xpath_string + offset, xpath_max - offset, " and "); + } + offset += snprintf(xpath_string + offset, xpath_max - offset, "@name=\"%s\"", long_key); ++ ++ crm_free(long_key); + } + offset += snprintf(xpath_string + offset, xpath_max - offset, "]"); + +@@ -763,6 +765,13 @@ main(int argc, char **argv) + set_working_set_defaults(&data_set); + + cib_conn = cib_new(); ++ if (cib_conn == NULL) { ++ rc = cib_connection; ++ CMD_ERR("Error initiating the connection to the CIB service: %s\n", ++ cib_error2string(rc)); ++ return rc; ++ } ++ + rc = cib_conn->cmds->signon(cib_conn, crm_system_name, cib_command); + if (rc != cib_ok) { + CMD_ERR("Error signing on to the CIB service: %s\n", cib_error2string(rc)); +@@ -933,7 +942,7 @@ main(int argc, char **argv) + + ticket = find_ticket(ticket_id, &data_set); + if (ticket == NULL) { +- return cib_NOTEXISTS; ++ rc = cib_NOTEXISTS; + goto bail; + } + diff --git a/pacemaker-crm_mon-tickets.diff b/pacemaker-crm_mon-tickets.diff new file mode 100644 index 0000000..b8e5ab7 --- /dev/null +++ b/pacemaker-crm_mon-tickets.diff @@ -0,0 +1,109 @@ +commit 147890c8f9200960b3212a4a5acca4240f20451d +Author: Gao,Yan +Date: Sun Mar 25 16:27:38 2012 +0800 + + High: Tools: crm_mon - Support to display tickets (based on Yuusuke Iida's work) + +diff --git a/tools/Makefile.am b/tools/Makefile.am +index 2c2192c..9922bfe 100644 +--- a/tools/Makefile.am ++++ b/tools/Makefile.am +@@ -95,6 +95,7 @@ crm_diff_LDADD = $(COMMONLIBS) + + crm_mon_SOURCES = crm_mon.c + crm_mon_LDADD = $(top_builddir)/lib/pengine/libpe_status.la \ ++ $(top_builddir)/pengine/libpengine.la \ + $(COMMONLIBS) $(SNMPLIBS) $(ESMTPLIBS) -llrm + + # Arguments could be made that this should live in crm/pengine +diff --git a/tools/crm_mon.c b/tools/crm_mon.c +index b71e574..3f6ad37 100644 +--- a/tools/crm_mon.c ++++ b/tools/crm_mon.c +@@ -43,6 +43,7 @@ + #include + #include + #include <../lib/pengine/unpack.h> ++#include <../pengine/pengine.h> + + /* GMainLoop *mainloop = NULL; */ + +@@ -88,6 +89,7 @@ gboolean print_timing = FALSE; + gboolean print_nodes_attr = FALSE; + gboolean print_last_updated = TRUE; + gboolean print_last_change = TRUE; ++gboolean print_tickets = FALSE; + + #define FILTER_STR {"shutdown", "terminate", "standby", "fail-count", \ + "last-failure", "probe_complete", "#id", "#uname", \ +@@ -300,7 +302,8 @@ static struct crm_option long_options[] = { + {"failcounts", 0, 0, 'f', "\tDisplay resource fail counts"}, + {"operations", 0, 0, 'o', "\tDisplay resource operation history" }, + {"timing-details", 0, 0, 't', "\tDisplay resource operation history with timing details" }, +- {"show-node-attributes", 0, 0, 'A', "Display node attributes\n" }, ++ {"show-node-attributes", 0, 0, 'A', "Display node attributes" }, ++ {"tickets", 0, 0, 'c', "\t\tDisplay cluster tickets"}, + + {"-spacer-", 1, 0, '-', "\nAdditional Options:"}, + {"interval", 1, 0, 'i', "\tUpdate frequency in seconds" }, +@@ -400,6 +403,9 @@ main(int argc, char **argv) + case 'A': + print_nodes_attr = TRUE; + break; ++ case 'c': ++ print_tickets = TRUE; ++ break; + case 'p': + crm_free(pid_file); + pid_file = crm_strdup(optarg); +@@ -948,6 +954,38 @@ print_node_summary(pe_working_set_t * data_set, gboolean operations) + } + } + ++static void ++print_ticket(gpointer name, gpointer value, gpointer data) ++{ ++ ticket_t *ticket = (ticket_t *) value; ++ ++ print_as(" %s\t%s%10s", ticket->id, ++ ticket->granted ? "granted":"revoked", ++ ticket->standby ? " [standby]":""); ++ if (ticket->last_granted > -1) { ++ print_as(" last-granted="); ++ print_date(ticket->last_granted); ++ } ++ print_as("\n"); ++ ++ return; ++} ++ ++static void ++print_cluster_tickets(pe_working_set_t * data_set) ++{ ++ xmlNode *cib_constraints = get_object_root(XML_CIB_TAG_CONSTRAINTS, data_set->input); ++ ++ /* For recording the tickets that are referenced in rsc_ticket constraints ++ * but have never been granted yet. */ ++ unpack_constraints(cib_constraints, data_set); ++ ++ print_as("\nTickets:\n"); ++ g_hash_table_foreach(data_set->tickets, print_ticket, NULL); ++ ++ return; ++} ++ + static char * + add_list_element(char *list, const char *value) + { +@@ -1209,6 +1247,11 @@ print_status(pe_working_set_t * data_set) + print_as("): %s\n", execra_code2string(val)); + } + } ++ ++ if (print_tickets) { ++ print_cluster_tickets(data_set); ++ } ++ + #if CURSES_ENABLED + if (as_console) { + refresh(); diff --git a/pacemaker-crm_simulate-ticket-state.diff b/pacemaker-crm_simulate-ticket-state.diff new file mode 100644 index 0000000..37c3a48 --- /dev/null +++ b/pacemaker-crm_simulate-ticket-state.diff @@ -0,0 +1,206 @@ +commit 1631d9396f69ac54f0b4f84a5f7ab6d016026c87 +Author: Gao,Yan +Date: Sun Mar 25 22:34:05 2012 +0800 + + High: Tools: crm_simulate - Support to grant/revoke/standby/activate tickets from the new ticket state section + +diff --git a/tools/crm_inject.c b/tools/crm_inject.c +index 9024e31..c068613 100644 +--- a/tools/crm_inject.c ++++ b/tools/crm_inject.c +@@ -755,10 +755,91 @@ create_dotfile(pe_working_set_t * data_set, const char *dot_file, gboolean all_a + } + } + ++static int ++find_ticket_state(cib_t * the_cib, const char * ticket_id, xmlNode ** ticket_state_xml) ++{ ++ int offset = 0; ++ static int xpath_max = 1024; ++ enum cib_errors rc = cib_ok; ++ xmlNode *xml_search = NULL; ++ ++ char *xpath_string = NULL; ++ ++ CRM_ASSERT(ticket_state_xml != NULL); ++ *ticket_state_xml = NULL; ++ ++ crm_malloc0(xpath_string, xpath_max); ++ offset += ++ snprintf(xpath_string + offset, xpath_max - offset, "%s", "/cib/status/tickets"); ++ ++ if (ticket_id) { ++ offset += snprintf(xpath_string + offset, xpath_max - offset, "/%s[@id=\"%s\"]", ++ XML_CIB_TAG_TICKET_STATE, ticket_id); ++ } ++ ++ rc = the_cib->cmds->query(the_cib, xpath_string, &xml_search, ++ cib_sync_call | cib_scope_local | cib_xpath); ++ ++ if (rc != cib_ok) { ++ goto bail; ++ } ++ ++ crm_log_xml_debug(xml_search, "Match"); ++ if (xml_has_children(xml_search)) { ++ if (ticket_id) { ++ fprintf(stdout, "Multiple ticket_states match ticket_id=%s\n", ticket_id); ++ } ++ *ticket_state_xml = xml_search; ++ } else { ++ *ticket_state_xml = xml_search; ++ } ++ ++ bail: ++ crm_free(xpath_string); ++ return rc; ++} ++ ++static int ++set_ticket_state_attr(const char *ticket_id, const char *attr_name, ++ const char *attr_value, cib_t * cib, int cib_options) ++{ ++ enum cib_errors rc = cib_ok; ++ xmlNode *xml_top = NULL; ++ xmlNode *ticket_state_xml = NULL; ++ ++ rc = find_ticket_state(cib, ticket_id, &ticket_state_xml); ++ if (rc == cib_ok) { ++ crm_debug("Found a match state for ticket: id=%s", ticket_id); ++ xml_top = ticket_state_xml; ++ ++ } else if (rc != cib_NOTEXISTS) { ++ return rc; ++ ++ } else { ++ xmlNode *xml_obj = NULL; ++ ++ xml_top = create_xml_node(NULL, XML_CIB_TAG_STATUS); ++ xml_obj = create_xml_node(xml_top, XML_CIB_TAG_TICKETS); ++ ticket_state_xml = create_xml_node(xml_obj, XML_CIB_TAG_TICKET_STATE); ++ crm_xml_add(ticket_state_xml, XML_ATTR_ID, ticket_id); ++ } ++ ++ crm_xml_add(ticket_state_xml, attr_name, attr_value); ++ ++ crm_log_xml_debug(xml_top, "Update"); ++ ++ rc = cib->cmds->modify(cib, XML_CIB_TAG_STATUS, xml_top, cib_options); ++ ++ free_xml(xml_top); ++ ++ return rc; ++} ++ + static void + modify_configuration(pe_working_set_t * data_set, + const char *quorum, GListPtr node_up, GListPtr node_down, GListPtr node_fail, +- GListPtr op_inject, GListPtr ticket_grant, GListPtr ticket_revoke) ++ GListPtr op_inject, GListPtr ticket_grant, GListPtr ticket_revoke, ++ GListPtr ticket_standby, GListPtr ticket_activate) + { + int rc = cib_ok; + GListPtr gIter = NULL; +@@ -818,29 +899,41 @@ modify_configuration(pe_working_set_t * data_set, + } + + for (gIter = ticket_grant; gIter != NULL; gIter = gIter->next) { +- char *ticket = (char *)gIter->data; +- char *attr_name = crm_concat("granted-ticket", ticket, '-'); +- +- quiet_log(" + Granting ticket %s\n", ticket); +- rc = update_attr(global_cib, cib_sync_call | cib_scope_local, +- XML_CIB_TAG_TICKETS, NULL, NULL, NULL, NULL, +- attr_name, "true", TRUE); ++ char *ticket_id = (char *)gIter->data; + +- crm_free(attr_name); ++ quiet_log(" + Granting ticket %s\n", ticket_id); ++ rc = set_ticket_state_attr(ticket_id, "granted", "true", ++ global_cib, cib_sync_call | cib_scope_local); + + CRM_ASSERT(rc == cib_ok); + } + + for (gIter = ticket_revoke; gIter != NULL; gIter = gIter->next) { +- char *ticket = (char *)gIter->data; +- char *attr_name = crm_concat("granted-ticket", ticket, '-'); ++ char *ticket_id = (char *)gIter->data; ++ ++ quiet_log(" + Revoking ticket %s\n", ticket_id); ++ rc = set_ticket_state_attr(ticket_id, "granted", "false", ++ global_cib, cib_sync_call | cib_scope_local); + +- quiet_log(" + Revoking ticket %s\n", ticket); +- rc = update_attr(global_cib, cib_sync_call | cib_scope_local, +- XML_CIB_TAG_TICKETS, NULL, NULL, NULL, NULL, +- attr_name, "false", TRUE); ++ CRM_ASSERT(rc == cib_ok); ++ } ++ ++ for (gIter = ticket_standby; gIter != NULL; gIter = gIter->next) { ++ char *ticket_id = (char *)gIter->data; ++ ++ quiet_log(" + Making ticket %s standby\n", ticket_id); ++ rc = set_ticket_state_attr(ticket_id, "standby", "true", ++ global_cib, cib_sync_call | cib_scope_local); ++ ++ CRM_ASSERT(rc == cib_ok); ++ } ++ ++ for (gIter = ticket_activate; gIter != NULL; gIter = gIter->next) { ++ char *ticket_id = (char *)gIter->data; + +- crm_free(attr_name); ++ quiet_log(" + Activating ticket %s\n", ticket_id); ++ rc = set_ticket_state_attr(ticket_id, "standby", "false", ++ global_cib, cib_sync_call | cib_scope_local); + + CRM_ASSERT(rc == cib_ok); + } +@@ -999,8 +1092,10 @@ static struct crm_option long_options[] = { + {"op-fail", 1, 0, 'F', "\t$rsc_$task_$interval@$node=$rc - Fail the specified task while running the simulation"}, + {"set-datetime", 1, 0, 't', "Set date/time"}, + {"quorum", 1, 0, 'q', "\tSpecify a value for quorum"}, +- {"ticket-grant", 1, 0, 'g', "Grant a ticket"}, +- {"ticket-revoke",1, 0, 'r', "Revoke a ticket"}, ++ {"ticket-grant", 1, 0, 'g', "Grant a ticket"}, ++ {"ticket-revoke", 1, 0, 'r', "Revoke a ticket"}, ++ {"ticket-standby", 1, 0, 'b', "Make a ticket standby"}, ++ {"ticket-activate", 1, 0, 'e', "Activate a ticket"}, + + {"-spacer-", 0, 0, '-', "\nOutput Options:"}, + +@@ -1122,6 +1217,8 @@ main(int argc, char **argv) + GListPtr op_inject = NULL; + GListPtr ticket_grant = NULL; + GListPtr ticket_revoke = NULL; ++ GListPtr ticket_standby = NULL; ++ GListPtr ticket_activate = NULL; + + xmlNode *input = NULL; + +@@ -1203,6 +1300,14 @@ main(int argc, char **argv) + modified++; + ticket_revoke = g_list_append(ticket_revoke, optarg); + break; ++ case 'b': ++ modified++; ++ ticket_standby = g_list_append(ticket_standby, optarg); ++ break; ++ case 'e': ++ modified++; ++ ticket_activate = g_list_append(ticket_activate, optarg); ++ break; + case 'a': + all_actions = TRUE; + break; +@@ -1290,7 +1395,7 @@ main(int argc, char **argv) + if (modified) { + quiet_log("Performing requested modifications\n"); + modify_configuration(&data_set, quorum, node_up, node_down, node_fail, op_inject, +- ticket_grant, ticket_revoke); ++ ticket_grant, ticket_revoke, ticket_standby, ticket_activate); + + rc = global_cib->cmds->query(global_cib, NULL, &input, cib_sync_call); + if (rc != cib_ok) { diff --git a/pacemaker-crm_ticket-all-tickets.diff b/pacemaker-crm_ticket-all-tickets.diff new file mode 100644 index 0000000..33a2860 --- /dev/null +++ b/pacemaker-crm_ticket-all-tickets.diff @@ -0,0 +1,39 @@ +commit dfdf37641c0bfc405673b4b324bd7d4304004685 +Author: Gao,Yan +Date: Sun Mar 25 15:09:25 2012 +0800 + + Medium: Tools: crm_ticket - Display the tickets that are referenced in rsc_ticket constraints but have never been granted yet. + +diff --git a/tools/crm_ticket.c b/tools/crm_ticket.c +index f90ba23..e822de4 100644 +--- a/tools/crm_ticket.c ++++ b/tools/crm_ticket.c +@@ -40,6 +40,8 @@ + #include + #include + ++#include <../pengine/pengine.h> ++ + gboolean do_force = FALSE; + gboolean BE_QUIET = FALSE; + const char *ticket_id = NULL; +@@ -653,6 +655,7 @@ main(int argc, char **argv) + { + pe_working_set_t data_set; + xmlNode *cib_xml_copy = NULL; ++ xmlNode *cib_constraints = NULL; + + cib_t *cib_conn = NULL; + enum cib_errors rc = cib_ok; +@@ -783,6 +786,11 @@ main(int argc, char **argv) + + cluster_status(&data_set); + ++ /* For recording the tickets that are referenced in rsc_ticket constraints ++ * but have never been granted yet. */ ++ cib_constraints = get_object_root(XML_CIB_TAG_CONSTRAINTS, data_set.input); ++ unpack_constraints(cib_constraints, &data_set); ++ + if (ticket_cmd == 'l' || ticket_cmd == 'L' || ticket_cmd == 'w') { + gboolean raw = FALSE; + gboolean details = FALSE; diff --git a/pacemaker-crm_ticket-force.diff b/pacemaker-crm_ticket-force.diff new file mode 100644 index 0000000..9595f8f --- /dev/null +++ b/pacemaker-crm_ticket-force.diff @@ -0,0 +1,143 @@ +commit e0733a32d39bf673e0ef886dacfbe452f0110967 +Author: Gao,Yan +Date: Wed Mar 14 20:41:34 2012 +0800 + + Medium: Tools: crm_ticket - Granting/revoking tickets need user to confirm unless "--force" option is used + +diff --git a/tools/crm_ticket b/tools/crm_ticket +index 27c6fd2..640a541 100755 +--- a/tools/crm_ticket ++++ b/tools/crm_ticket +@@ -2,10 +2,12 @@ + + options="" + ticket="" +-granted="" ++update_value="" + last_granted="" ++delete_attr="false" ++force="false" + +-TEMP=`getopt -o DGQVThU:v:i:t: --long help,version,ticket:,attr-value:,delete-attr,get-value,attr-id:,quiet,time \ ++TEMP=`getopt -o DGQVThfv:i:t: --long help,version,ticket:,attr-value:,delete-attr,get-value,attr-id:,force,quiet,time \ + -n 'crm_ticket' -- "$@"` + + if [ $? != 0 ] ; then echo "crm_ticket - A convenience wrapper for crm_attribute"; echo ""; crm_attribute -?; exit 1 ; fi +@@ -13,13 +15,39 @@ if [ $? != 0 ] ; then echo "crm_ticket - A convenience wrapper for crm_attribute + # Note the quotes around `$TEMP': they are essential! + eval set -- "$TEMP" + ++confirm() { ++ action=$1 ++ ticket=$2 ++ ++ if [ X$action = X"grant" ]; then ++ warning="The crm_ticket command cannot help you verify if '$ticket' is already granted elsewhere." ++ word="to" ++ else ++ warning="Revoking '$ticket' will trigger the specified 'loss-policy' relating to '$ticket'." ++ word="from" ++ fi ++ ++ while :; do ++ printf "$warning\nAre you sure you want to $action '$ticket' $word this site? (y/n)" ++ read ans ++ if echo $ans | grep -iqs '^[yn]'; then ++ echo $ans | grep -iqs '^y' ++ return $? ++ else ++ echo Please answer with y or n ++ fi ++ done ++} ++ + while true ; do + case "$1" in +- -v|--attr-value) options="$options $1 $2"; granted=$2; shift; shift;; ++ -v|--attr-value) options="$options $1 $2"; update_value=$2; shift; shift;; + -i|--attr-id) options="$options $1 $2"; shift; shift;; +- -Q|--quiet|-D|--delete-attr|-G|--get-value|-V) options="$options $1"; shift;; ++ -D|--delete-attr) options="$options $1"; delete_attr="true"; shift;; ++ -Q|--quiet|-G|--get-value|-V) options="$options $1"; shift;; + -t|--ticket-id) ticket=$2; shift; shift;; + -T|--time) last_granted="time"; shift;; ++ -f|--force) force="true"; shift;; + --version) crm_attribute --version; exit 0;; + -h|--help) + echo "crm_ticket - A convenience wrapper for crm_attribute"; +@@ -43,6 +71,7 @@ while true ; do + echo "" + echo "Additional Options:" + echo " -i, --id=value (Advanced) The ID used to identify the attribute" ++ echo " -f, --force (Advanced) Force the action to be performed" + exit 0;; + --) shift ; break ;; + *) echo "Unknown option: $1. See --help for details." exit 1;; +@@ -58,8 +87,12 @@ else + options="$options -n granted-ticket-$ticket" + fi + +-case "$granted" in ++case "$update_value" in + true|yes|1) ++ if [ X$force != X"true" ]; then ++ confirm "grant" $ticket || exit 1 ++ fi ++ + crm_attribute $options -t tickets >/dev/null 2>&1 + rc=$? + if [ $rc = 0 ]; then +@@ -73,8 +106,17 @@ case "$granted" in + fi + ;; + *) +- crm_attribute $options -t tickets -d false +- rc=$? +- exit $rc ++ if [ X$update_value != X -o X$delete_attr = X"true" ]; then ++ if [ X$force != X"true" ]; then ++ confirm "revoke" $ticket || exit 1 ++ fi ++ crm_attribute $options -t tickets >/dev/null 2>&1 ++ rc=$? ++ exit $rc ++ else ++ crm_attribute $options -t tickets -d false ++ rc=$? ++ exit $rc ++ fi + ;; + esac +diff --git a/tools/regression.exp b/tools/regression.exp +index d277c9d..9c672fb 100755 +--- a/tools/regression.exp ++++ b/tools/regression.exp +@@ -926,8 +926,6 @@ scope=tickets name=granted-ticket-ticketA value=false + + + * Passed: crm_ticket - Query granted-ticket value +-Deleted tickets option: id=status-tickets-granted-ticket-ticketA name=granted-ticket-ticketA +- + + + +diff --git a/tools/regression.sh b/tools/regression.sh +index 3fc9fb1..a6893dc 100755 +--- a/tools/regression.sh ++++ b/tools/regression.sh +@@ -173,13 +173,13 @@ function test_tools() { + crm_ticket -t ticketA -G + assert $? 0 crm_ticket "Default granted-ticket value" + +- crm_ticket -t ticketA -v false ++ crm_ticket -t ticketA -v false --force + assert $? 0 crm_ticket "Set granted-ticket value" + + crm_ticket -t ticketA -G + assert $? 0 crm_ticket "Query granted-ticket value" + +- crm_ticket -t ticketA -D ++ crm_ticket -t ticketA -D --force + assert $? 0 crm_ticket "Delete granted-ticket value" + } + diff --git a/pacemaker-crm_ticket-tests-standby.diff b/pacemaker-crm_ticket-tests-standby.diff new file mode 100644 index 0000000..0e019f3 --- /dev/null +++ b/pacemaker-crm_ticket-tests-standby.diff @@ -0,0 +1,238 @@ +commit 0f60f521e85fac6f185f6f5fb71163f7a3772e2b +Author: Gao,Yan +Date: Sat Mar 24 09:40:00 2012 +0800 + + Low: Tools: Add CLI regression tests for ticket standby state + +diff --git a/tools/regression.exp b/tools/regression.exp +index af3fed9..342a8fa 100755 +--- a/tools/regression.exp ++++ b/tools/regression.exp +@@ -842,7 +842,7 @@ false + + + +-* Passed: crm_ticket - Default granted-ticket value ++* Passed: crm_ticket - Default ticket granted state + + + +@@ -881,7 +881,7 @@ false + + + +-* Passed: crm_ticket - Set granted-ticket value ++* Passed: crm_ticket - Set ticket granted state + false + + +@@ -921,7 +921,7 @@ false + + + +-* Passed: crm_ticket - Query granted-ticket value ++* Passed: crm_ticket - Query ticket granted state + Deleted ticketA state attribute: name=granted + + +@@ -961,4 +961,162 @@ Deleted ticketA state attribute: name=granted + + + +-* Passed: crm_ticket - Delete granted-ticket value ++* Passed: crm_ticket - Delete ticket granted state ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++* Passed: crm_ticket - Make a ticket standby ++true ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++* Passed: crm_ticket - Query ticket standby state ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++* Passed: crm_ticket - Activate a ticket ++Deleted ticketA state attribute: name=standby ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++* Passed: crm_ticket - Delete ticket standby state +diff --git a/tools/regression.sh b/tools/regression.sh +index e8844ec..e7ef151 100755 +--- a/tools/regression.sh ++++ b/tools/regression.sh +@@ -171,16 +171,28 @@ function test_tools() { + assert $? 0 crm_resource "Un-migrate a resource" + + crm_ticket -t ticketA -G granted -d false +- assert $? 0 crm_ticket "Default ticket state attribute" ++ assert $? 0 crm_ticket "Default ticket granted state" + + crm_ticket -t ticketA -r --force +- assert $? 0 crm_ticket "Set ticket state attribute" ++ assert $? 0 crm_ticket "Set ticket granted state" + + crm_ticket -t ticketA -G granted +- assert $? 0 crm_ticket "Query ticket state attribute" ++ assert $? 0 crm_ticket "Query ticket granted state" + + crm_ticket -t ticketA -D granted --force +- assert $? 0 crm_ticket "Delete ticket state attribute" ++ assert $? 0 crm_ticket "Delete ticket granted state" ++ ++ crm_ticket -t ticketA -s ++ assert $? 0 crm_ticket "Make a ticket standby" ++ ++ crm_ticket -t ticketA -G standby ++ assert $? 0 crm_ticket "Query ticket standby state" ++ ++ crm_ticket -t ticketA -a ++ assert $? 0 crm_ticket "Activate a ticket" ++ ++ crm_ticket -t ticketA -D standby ++ assert $? 0 crm_ticket "Delete ticket standby state" + } + + test_tools 2>&1 | sed s/cib-last-written.*\>/\>/ > $test_home/regression.out diff --git a/pacemaker-crm_ticket-tests-update.diff b/pacemaker-crm_ticket-tests-update.diff new file mode 100644 index 0000000..e635203 --- /dev/null +++ b/pacemaker-crm_ticket-tests-update.diff @@ -0,0 +1,91 @@ +commit 729f23fc8b3ba8f11608c5b9f6b44efe89f25db7 +Author: Gao,Yan +Date: Fri Mar 23 18:08:53 2012 +0800 + + Low: Tools: Update CLI regression tests for the new crm_ticket + +diff --git a/tools/regression.exp b/tools/regression.exp +index 9c672fb..af3fed9 100755 +--- a/tools/regression.exp ++++ b/tools/regression.exp +@@ -806,7 +806,7 @@ Error performing operation: The object/attribute does not exist + + + * Passed: crm_resource - Un-migrate a resource +-scope=tickets name=granted-ticket-ticketA value=false ++false + + + +@@ -877,14 +877,12 @@ scope=tickets name=granted-ticket-ticketA value=false + + + +- +- +- ++ + + + + * Passed: crm_ticket - Set granted-ticket value +-scope=tickets name=granted-ticket-ticketA value=false ++false + + + +@@ -919,13 +917,12 @@ scope=tickets name=granted-ticket-ticketA value=false + + + +- +- +- ++ + + + + * Passed: crm_ticket - Query granted-ticket value ++Deleted ticketA state attribute: name=granted + + + +@@ -960,7 +957,7 @@ scope=tickets name=granted-ticket-ticketA value=false + + + +- ++ + + + +diff --git a/tools/regression.sh b/tools/regression.sh +index a6893dc..e8844ec 100755 +--- a/tools/regression.sh ++++ b/tools/regression.sh +@@ -170,17 +170,17 @@ function test_tools() { + $VALGRIND_CMD crm_resource -r dummy -U + assert $? 0 crm_resource "Un-migrate a resource" + +- crm_ticket -t ticketA -G +- assert $? 0 crm_ticket "Default granted-ticket value" ++ crm_ticket -t ticketA -G granted -d false ++ assert $? 0 crm_ticket "Default ticket state attribute" + +- crm_ticket -t ticketA -v false --force +- assert $? 0 crm_ticket "Set granted-ticket value" ++ crm_ticket -t ticketA -r --force ++ assert $? 0 crm_ticket "Set ticket state attribute" + +- crm_ticket -t ticketA -G +- assert $? 0 crm_ticket "Query granted-ticket value" ++ crm_ticket -t ticketA -G granted ++ assert $? 0 crm_ticket "Query ticket state attribute" + +- crm_ticket -t ticketA -D --force +- assert $? 0 crm_ticket "Delete granted-ticket value" ++ crm_ticket -t ticketA -D granted --force ++ assert $? 0 crm_ticket "Delete ticket state attribute" + } + + test_tools 2>&1 | sed s/cib-last-written.*\>/\>/ > $test_home/regression.out diff --git a/pacemaker-crm_ticket-valgrind.diff b/pacemaker-crm_ticket-valgrind.diff new file mode 100644 index 0000000..1244a61 --- /dev/null +++ b/pacemaker-crm_ticket-valgrind.diff @@ -0,0 +1,47 @@ +commit cb823bb47fabc77ececaad3f2ba3de686e908a89 +Author: Gao,Yan +Date: Sun Mar 25 12:58:28 2012 +0800 + + Low: Tools: Add crm_ticket to be profiled by valgrind + +diff --git a/tools/regression.sh b/tools/regression.sh +index e7ef151..7f3c743 100755 +--- a/tools/regression.sh ++++ b/tools/regression.sh +@@ -170,28 +170,28 @@ function test_tools() { + $VALGRIND_CMD crm_resource -r dummy -U + assert $? 0 crm_resource "Un-migrate a resource" + +- crm_ticket -t ticketA -G granted -d false ++ $VALGRIND_CMD crm_ticket -t ticketA -G granted -d false + assert $? 0 crm_ticket "Default ticket granted state" + +- crm_ticket -t ticketA -r --force ++ $VALGRIND_CMD crm_ticket -t ticketA -r --force + assert $? 0 crm_ticket "Set ticket granted state" + +- crm_ticket -t ticketA -G granted ++ $VALGRIND_CMD crm_ticket -t ticketA -G granted + assert $? 0 crm_ticket "Query ticket granted state" + +- crm_ticket -t ticketA -D granted --force ++ $VALGRIND_CMD crm_ticket -t ticketA -D granted --force + assert $? 0 crm_ticket "Delete ticket granted state" + +- crm_ticket -t ticketA -s ++ $VALGRIND_CMD crm_ticket -t ticketA -s + assert $? 0 crm_ticket "Make a ticket standby" + +- crm_ticket -t ticketA -G standby ++ $VALGRIND_CMD crm_ticket -t ticketA -G standby + assert $? 0 crm_ticket "Query ticket standby state" + +- crm_ticket -t ticketA -a ++ $VALGRIND_CMD crm_ticket -t ticketA -a + assert $? 0 crm_ticket "Activate a ticket" + +- crm_ticket -t ticketA -D standby ++ $VALGRIND_CMD crm_ticket -t ticketA -D standby + assert $? 0 crm_ticket "Delete ticket standby state" + } + diff --git a/pacemaker-crm_ticket.diff b/pacemaker-crm_ticket.diff new file mode 100644 index 0000000..409d5d4 --- /dev/null +++ b/pacemaker-crm_ticket.diff @@ -0,0 +1,1139 @@ +commit 1fc6caa4665dacaee97e314ba3a292cfba873762 +Author: Gao,Yan +Date: Fri Mar 23 16:58:00 2012 +0800 + + High: Tools: Implement a new crm_ticket + +diff --git a/tools/Makefile.am b/tools/Makefile.am +index a2b2a87..2c2192c 100644 +--- a/tools/Makefile.am ++++ b/tools/Makefile.am +@@ -31,7 +31,7 @@ header_HEADERS = attrd.h + pcmkdir = $(datadir)/$(PACKAGE) + pcmk_DATA = report.common report.collector + +-sbin_SCRIPTS = crm_report crm_standby crm_master crm_failcount crm_ticket ++sbin_SCRIPTS = crm_report crm_standby crm_master crm_failcount + EXTRA_DIST = $(sbin_SCRIPTS) + + halibdir = $(CRM_DAEMON_DIR) +@@ -40,7 +40,7 @@ halib_PROGRAMS = attrd + halib_PYTHON = crm_primitive.py hb2openais-helper.py + + sbin_PROGRAMS = crm_simulate crmadmin cibadmin crm_node crm_attribute crm_resource crm_verify \ +- crm_uuid crm_shadow attrd_updater crm_diff crm_mon iso8601 ++ crm_uuid crm_shadow attrd_updater crm_diff crm_mon iso8601 crm_ticket + + testdir = $(datadir)/$(PACKAGE)/tests + test_SCRIPTS = coverage.sh +@@ -124,6 +124,12 @@ attrd_LDADD = $(top_builddir)/lib/cluster/libcrmcluster.la $(COMMONLIBS) + attrd_updater_SOURCES = attrd_updater.c + attrd_updater_LDADD = $(COMMONLIBS) + ++crm_ticket_SOURCES = crm_ticket.c ++crm_ticket_LDADD = $(top_builddir)/lib/pengine/libpe_rules.la \ ++ $(top_builddir)/lib/pengine/libpe_status.la \ ++ $(top_builddir)/pengine/libpengine.la \ ++ $(COMMONLIBS) ++ + if BUILD_SERVICELOG + notifyServicelogEvent_SOURCES = notifyServicelogEvent.c + notifyServicelogEvent_CFLAGS = $(SERVICELOG_CFLAGS) +diff --git a/tools/crm_ticket b/tools/crm_ticket +deleted file mode 100755 +index 640a541..0000000 +--- a/tools/crm_ticket ++++ /dev/null +@@ -1,122 +0,0 @@ +-#!/bin/bash +- +-options="" +-ticket="" +-update_value="" +-last_granted="" +-delete_attr="false" +-force="false" +- +-TEMP=`getopt -o DGQVThfv:i:t: --long help,version,ticket:,attr-value:,delete-attr,get-value,attr-id:,force,quiet,time \ +- -n 'crm_ticket' -- "$@"` +- +-if [ $? != 0 ] ; then echo "crm_ticket - A convenience wrapper for crm_attribute"; echo ""; crm_attribute -?; exit 1 ; fi +- +-# Note the quotes around `$TEMP': they are essential! +-eval set -- "$TEMP" +- +-confirm() { +- action=$1 +- ticket=$2 +- +- if [ X$action = X"grant" ]; then +- warning="The crm_ticket command cannot help you verify if '$ticket' is already granted elsewhere." +- word="to" +- else +- warning="Revoking '$ticket' will trigger the specified 'loss-policy' relating to '$ticket'." +- word="from" +- fi +- +- while :; do +- printf "$warning\nAre you sure you want to $action '$ticket' $word this site? (y/n)" +- read ans +- if echo $ans | grep -iqs '^[yn]'; then +- echo $ans | grep -iqs '^y' +- return $? +- else +- echo Please answer with y or n +- fi +- done +-} +- +-while true ; do +- case "$1" in +- -v|--attr-value) options="$options $1 $2"; update_value=$2; shift; shift;; +- -i|--attr-id) options="$options $1 $2"; shift; shift;; +- -D|--delete-attr) options="$options $1"; delete_attr="true"; shift;; +- -Q|--quiet|-G|--get-value|-V) options="$options $1"; shift;; +- -t|--ticket-id) ticket=$2; shift; shift;; +- -T|--time) last_granted="time"; shift;; +- -f|--force) force="true"; shift;; +- --version) crm_attribute --version; exit 0;; +- -h|--help) +- echo "crm_ticket - A convenience wrapper for crm_attribute"; +- echo ""; +- echo "Grants or revokes the specified ticket for the cluster"; +- echo ""; +- echo "Usage: crm_ticket -t ticket_name command [options]"; +- echo "Options:" +- echo " -h, --help This text" +- echo " --version Version information" +- echo " -V, --verbose Increase debug output" +- echo " -q, --quiet Print only the value on stdout" +- echo "" +- echo " -t, --ticket-id=value The ticket to update" +- echo "" +- echo "Commands:" +- echo " -G, --query Query if the specified ticket is granted or not" +- echo " -v, --update=value Grant/Revoke the specified ticket" +- echo " -D, --delete Delete the granting/revoking record" +- echo " -T, --time Query the time of last granted the specified ticket" +- echo "" +- echo "Additional Options:" +- echo " -i, --id=value (Advanced) The ID used to identify the attribute" +- echo " -f, --force (Advanced) Force the action to be performed" +- exit 0;; +- --) shift ; break ;; +- *) echo "Unknown option: $1. See --help for details." exit 1;; +- esac +-done +- +-if [ X$last_granted != X ]; then +- options="$options -n last-granted-$ticket -G -d -1" +- crm_attribute $options -t tickets +- rc=$? +- exit $rc +-else +- options="$options -n granted-ticket-$ticket" +-fi +- +-case "$update_value" in +- true|yes|1) +- if [ X$force != X"true" ]; then +- confirm "grant" $ticket || exit 1 +- fi +- +- crm_attribute $options -t tickets >/dev/null 2>&1 +- rc=$? +- if [ $rc = 0 ]; then +- options="$options -n last-granted-$ticket -v `date +%s`" +- crm_attribute $options -t tickets >/dev/null 2>&1 +- rc=$? +- exit $rc +- else +- echo "Failed to grant ticket $ticket" +- exit $rc +- fi +- ;; +- *) +- if [ X$update_value != X -o X$delete_attr = X"true" ]; then +- if [ X$force != X"true" ]; then +- confirm "revoke" $ticket || exit 1 +- fi +- crm_attribute $options -t tickets >/dev/null 2>&1 +- rc=$? +- exit $rc +- else +- crm_attribute $options -t tickets -d false +- rc=$? +- exit $rc +- fi +- ;; +-esac +diff --git a/tools/crm_ticket.c b/tools/crm_ticket.c +new file mode 100644 +index 0000000..f90ba23 +--- /dev/null ++++ b/tools/crm_ticket.c +@@ -0,0 +1,964 @@ ++ ++/* ++ * Copyright (C) 2012 Gao,Yan ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This software is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#include ++ ++#include ++ ++#include ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++gboolean do_force = FALSE; ++gboolean BE_QUIET = FALSE; ++const char *ticket_id = NULL; ++const char *attr_name = "granted"; ++const char *attr_value = NULL; ++const char *attr_id = NULL; ++const char *set_name = NULL; ++const char *attr_default = NULL; ++char ticket_cmd = 'S'; ++char *xml_file = NULL; ++int cib_options = cib_sync_call; ++ ++extern void cleanup_alloc_calculations(pe_working_set_t * data_set); ++ ++#define CMD_ERR(fmt, args...) do { \ ++ crm_warn(fmt, ##args); \ ++ fprintf(stderr, fmt, ##args); \ ++ } while(0) ++ ++static ticket_t * ++find_ticket(const char *ticket_id , pe_working_set_t * data_set) ++{ ++ ticket_t *ticket = NULL; ++ ticket = g_hash_table_lookup(data_set->tickets, ticket_id); ++ ++ return ticket; ++} ++ ++static void ++print_date(time_t time) ++{ ++ int lpc = 0; ++ char date_str[26]; ++ ++ asctime_r(localtime(&time), date_str); ++ for (; lpc < 26; lpc++) { ++ if (date_str[lpc] == '\n') { ++ date_str[lpc] = 0; ++ } ++ } ++ fprintf(stdout,"'%s'", date_str); ++} ++ ++static int ++print_ticket(ticket_t *ticket, gboolean raw, gboolean details) ++{ ++ if (raw) { ++ fprintf(stdout, "%s\n", ticket->id); ++ return cib_ok; ++ } ++ ++ fprintf(stdout, "%s\t%s %s", ++ ticket->id, ticket->granted?"granted":"revoked", ++ ticket->standby?"[standby]":" "); ++ ++ if (details && g_hash_table_size(ticket->state) > 0) { ++ GHashTableIter iter; ++ const char *name = NULL; ++ const char *value = NULL; ++ int lpc = 0; ++ ++ fprintf(stdout, " ("); ++ ++ g_hash_table_iter_init(&iter, ticket->state); ++ while (g_hash_table_iter_next(&iter, (void **)&name, (void **)&value)) { ++ if (lpc > 0) { ++ fprintf(stdout, ", "); ++ } ++ fprintf(stdout, "%s=", name); ++ if (crm_str_eq(name, "last-granted", TRUE) ++ || crm_str_eq(name, "expires", TRUE)) { ++ print_date(crm_parse_int(value, 0)); ++ } else { ++ fprintf(stdout, "%s", value); ++ } ++ lpc++; ++ } ++ ++ fprintf(stdout, ")\n"); ++ ++ } else { ++ if (ticket->last_granted > -1) { ++ fprintf(stdout, " last-granted="); ++ print_date(ticket->last_granted); ++ } ++ fprintf(stdout, "\n"); ++ } ++ ++ return cib_ok; ++} ++ ++static int ++print_ticket_list(pe_working_set_t * data_set, gboolean raw, gboolean details) ++{ ++ GHashTableIter iter; ++ ticket_t *ticket = NULL; ++ ++ g_hash_table_iter_init(&iter, data_set->tickets); ++ ++ while (g_hash_table_iter_next(&iter, NULL, (void **)&ticket)) { ++ print_ticket(ticket, raw, details); ++ } ++ ++ return cib_ok; ++} ++ ++static int ++find_ticket_state(cib_t * the_cib, const char * ticket_id, xmlNode ** ticket_state_xml) ++{ ++ int offset = 0; ++ static int xpath_max = 1024; ++ enum cib_errors rc = cib_ok; ++ xmlNode *xml_search = NULL; ++ ++ char *xpath_string = NULL; ++ ++ CRM_ASSERT(ticket_state_xml != NULL); ++ *ticket_state_xml = NULL; ++ ++ crm_malloc0(xpath_string, xpath_max); ++ offset += ++ snprintf(xpath_string + offset, xpath_max - offset, "%s", "/cib/status/tickets"); ++ ++ if (ticket_id) { ++ offset += snprintf(xpath_string + offset, xpath_max - offset, "/%s[@id=\"%s\"]", ++ XML_CIB_TAG_TICKET_STATE, ticket_id); ++ } ++ ++ rc = the_cib->cmds->query(the_cib, xpath_string, &xml_search, ++ cib_sync_call | cib_scope_local | cib_xpath); ++ ++ if (rc != cib_ok) { ++ goto bail; ++ } ++ ++ crm_log_xml_debug(xml_search, "Match"); ++ if (xml_has_children(xml_search)) { ++ if (ticket_id) { ++ fprintf(stdout, "Multiple ticket_states match ticket_id=%s\n", ticket_id); ++ } ++ *ticket_state_xml = xml_search; ++ } else { ++ *ticket_state_xml = xml_search; ++ } ++ ++ bail: ++ crm_free(xpath_string); ++ return rc; ++} ++ ++static int ++find_ticket_constraints(cib_t * the_cib, const char * ticket_id, xmlNode ** ticket_cons_xml) ++{ ++ int offset = 0; ++ static int xpath_max = 1024; ++ enum cib_errors rc = cib_ok; ++ xmlNode *xml_search = NULL; ++ ++ char *xpath_string = NULL; ++ ++ CRM_ASSERT(ticket_cons_xml != NULL); ++ *ticket_cons_xml = NULL; ++ ++ crm_malloc0(xpath_string, xpath_max); ++ offset += ++ snprintf(xpath_string + offset, xpath_max - offset, "%s/%s", ++ get_object_path(XML_CIB_TAG_CONSTRAINTS), XML_CONS_TAG_RSC_TICKET); ++ ++ if (ticket_id) { ++ offset += snprintf(xpath_string + offset, xpath_max - offset, "[@ticket=\"%s\"]", ++ ticket_id); ++ } ++ ++ rc = the_cib->cmds->query(the_cib, xpath_string, &xml_search, ++ cib_sync_call | cib_scope_local | cib_xpath); ++ ++ if (rc != cib_ok) { ++ goto bail; ++ } ++ ++ crm_log_xml_debug(xml_search, "Match"); ++ *ticket_cons_xml = xml_search; ++ ++ bail: ++ crm_free(xpath_string); ++ return rc; ++} ++ ++static int ++dump_ticket_xml(cib_t * the_cib, const char *ticket_id) ++{ ++ enum cib_errors rc = cib_ok; ++ xmlNode * state_xml = NULL; ++ ++ rc = find_ticket_state(the_cib, ticket_id, &state_xml); ++ ++ if (state_xml == NULL) { ++ return rc; ++ } ++ ++ fprintf(stdout, "State XML:\n"); ++ if (state_xml) { ++ char *state_xml_str = NULL; ++ ++ state_xml_str = dump_xml_formatted(state_xml); ++ fprintf(stdout, "\n%s\n", crm_str(state_xml_str)); ++ free_xml(state_xml); ++ crm_free(state_xml_str); ++ } ++ ++ return cib_ok; ++} ++ ++static int ++dump_constraints(cib_t * the_cib, const char * ticket_id) ++{ ++ enum cib_errors rc = cib_ok; ++ xmlNode * cons_xml = NULL; ++ char *cons_xml_str = NULL; ++ ++ rc = find_ticket_constraints(the_cib, ticket_id, &cons_xml); ++ ++ if (cons_xml == NULL) { ++ return rc; ++ } ++ ++ cons_xml_str = dump_xml_formatted(cons_xml); ++ fprintf(stdout, "Constraints XML:\n\n%s\n", crm_str(cons_xml_str)); ++ free_xml(cons_xml); ++ crm_free(cons_xml_str); ++ ++ return cib_ok; ++} ++ ++static int ++find_ticket_state_attr_legacy(cib_t * the_cib, const char *attr, const char *ticket_id, const char *set_type, ++ const char *set_name, const char *attr_id, const char *attr_name, char **value) ++{ ++ int offset = 0; ++ static int xpath_max = 1024; ++ enum cib_errors rc = cib_ok; ++ xmlNode *xml_search = NULL; ++ ++ char *xpath_string = NULL; ++ ++ CRM_ASSERT(value != NULL); ++ *value = NULL; ++ ++ crm_malloc0(xpath_string, xpath_max); ++ offset += ++ snprintf(xpath_string + offset, xpath_max - offset, "%s", "/cib/status/tickets"); ++ ++ if (set_type) { ++ offset += snprintf(xpath_string + offset, xpath_max - offset, "/%s", set_type); ++ if (set_name) { ++ offset += snprintf(xpath_string + offset, xpath_max - offset, "[@id=\"%s\"]", set_name); ++ } ++ } ++ ++ offset += snprintf(xpath_string + offset, xpath_max - offset, "//nvpair["); ++ if (attr_id) { ++ offset += snprintf(xpath_string + offset, xpath_max - offset, "@id=\"%s\"", attr_id); ++ } ++ ++ if (attr_name) { ++ const char *attr_prefix = NULL; ++ const char *long_key = NULL; ++ ++ if (crm_str_eq(attr_name, "granted", TRUE)) { ++ attr_prefix = "granted-ticket"; ++ } else { ++ attr_prefix = attr_name; ++ } ++ long_key = crm_concat(attr_prefix, ticket_id, '-'); ++ ++ if (attr_id) { ++ offset += snprintf(xpath_string + offset, xpath_max - offset, " and "); ++ } ++ offset += snprintf(xpath_string + offset, xpath_max - offset, "@name=\"%s\"", long_key); ++ } ++ offset += snprintf(xpath_string + offset, xpath_max - offset, "]"); ++ ++ rc = the_cib->cmds->query(the_cib, xpath_string, &xml_search, ++ cib_sync_call | cib_scope_local | cib_xpath); ++ ++ if (rc != cib_ok) { ++ goto bail; ++ } ++ ++ crm_log_xml_debug(xml_search, "Match"); ++ if (xml_has_children(xml_search)) { ++ xmlNode *child = NULL; ++ ++ rc = cib_missing_data; ++ fprintf(stdout, "Multiple attributes match name=%s\n", attr_name); ++ ++ for (child = __xml_first_child(xml_search); child != NULL; child = __xml_next(child)) { ++ fprintf(stdout, " Value: %s \t(id=%s)\n", ++ crm_element_value(child, XML_NVPAIR_ATTR_VALUE), ID(child)); ++ } ++ ++ } else { ++ const char *tmp = crm_element_value(xml_search, attr); ++ ++ if (tmp) { ++ *value = crm_strdup(tmp); ++ } ++ } ++ ++ bail: ++ crm_free(xpath_string); ++ free_xml(xml_search); ++ return rc; ++} ++ ++static int ++delete_ticket_state_attr_legacy(const char *ticket_id, const char *set_name, const char *attr_id, ++ const char *attr_name, cib_t * cib) ++{ ++ xmlNode *xml_obj = NULL; ++ ++ int rc = cib_ok; ++ char *local_attr_id = NULL; ++ ++ rc = find_ticket_state_attr_legacy(cib, XML_ATTR_ID, ticket_id, XML_TAG_ATTR_SETS, set_name, attr_id, attr_name, ++ &local_attr_id); ++ ++ if (rc == cib_NOTEXISTS) { ++ return cib_ok; ++ ++ } else if (rc != cib_ok) { ++ return rc; ++ } ++ ++ if (attr_id == NULL) { ++ attr_id = local_attr_id; ++ } ++ ++ xml_obj = create_xml_node(NULL, XML_CIB_TAG_NVPAIR); ++ crm_xml_add(xml_obj, XML_ATTR_ID, attr_id); ++ /*crm_xml_add(xml_obj, XML_NVPAIR_ATTR_NAME, attr_name);*/ ++ ++ crm_log_xml_debug(xml_obj, "Delete"); ++ ++ rc = cib->cmds->delete(cib, XML_CIB_TAG_STATUS, xml_obj, cib_options); ++ ++ if (rc == cib_ok) { ++ fprintf(stdout, "Deleted legacy %s state attribute: id=%s%s%s%s%s\n", ticket_id, local_attr_id, ++ set_name ? " set=" : "", set_name ? set_name : "", ++ attr_name ? " name=" : "", attr_name ? attr_name : ""); ++ } ++ ++ free_xml(xml_obj); ++ crm_free(local_attr_id); ++ return rc; ++} ++ ++static int ++get_ticket_state_attr(const char *ticket_id, const char *attr_name, const char **attr_value, pe_working_set_t * data_set) ++{ ++ ticket_t *ticket = NULL; ++ ++ CRM_ASSERT(attr_value != NULL); ++ *attr_value = NULL; ++ ++ ticket = g_hash_table_lookup(data_set->tickets, ticket_id); ++ if (ticket == NULL) { ++ return cib_NOTEXISTS; ++ } ++ ++ *attr_value = g_hash_table_lookup(ticket->state, attr_name); ++ if (*attr_value == NULL) { ++ return cib_NOTEXISTS; ++ } ++ ++ return cib_ok; ++} ++ ++static int ++delete_ticket_state_attr(const char *ticket_id, const char *attr_name, cib_t * cib) ++{ ++ xmlNode *ticket_state_xml = NULL; ++ ++ int rc = cib_ok; ++ ++ rc = find_ticket_state(cib, ticket_id, &ticket_state_xml); ++ ++ if (rc == cib_NOTEXISTS) { ++ return cib_ok; ++ ++ } else if (rc != cib_ok) { ++ return rc; ++ } ++ ++ xml_remove_prop(ticket_state_xml, attr_name); ++ rc = cib->cmds->replace(cib, XML_CIB_TAG_STATUS, ticket_state_xml, cib_options); ++ ++ if (rc == cib_ok) { ++ fprintf(stdout, "Deleted %s state attribute: %s%s\n", ticket_id, ++ attr_name ? " name=" : "", attr_name ? attr_name : ""); ++ } ++ ++ free_xml(ticket_state_xml); ++ return rc; ++} ++ ++static int ++set_ticket_state_attr(const char *ticket_id, const char *attr_name, ++ const char *attr_value, cib_t * cib) ++{ ++ enum cib_errors rc = cib_ok; ++ xmlNode *xml_top = NULL; ++ xmlNode *ticket_state_xml = NULL; ++ ++ rc = find_ticket_state(cib, ticket_id, &ticket_state_xml); ++ if (rc == cib_ok) { ++ crm_debug("Found a match state for ticket: id=%s", ticket_id); ++ xml_top = ticket_state_xml; ++ ++ } else if (rc != cib_NOTEXISTS) { ++ return rc; ++ ++ } else { ++ xmlNode *xml_obj = NULL; ++ ++ xml_top = create_xml_node(NULL, XML_CIB_TAG_STATUS); ++ xml_obj = create_xml_node(xml_top, XML_CIB_TAG_TICKETS); ++ ticket_state_xml = create_xml_node(xml_obj, XML_CIB_TAG_TICKET_STATE); ++ crm_xml_add(ticket_state_xml, XML_ATTR_ID, ticket_id); ++ } ++ ++ crm_xml_add(ticket_state_xml, attr_name, attr_value); ++ ++ crm_log_xml_debug(xml_top, "Update"); ++ ++ rc = cib->cmds->modify(cib, XML_CIB_TAG_STATUS, xml_top, cib_options); ++ ++ free_xml(xml_top); ++ ++ return rc; ++} ++ ++static int ++delete_ticket_state(const char *ticket_id, cib_t * cib) ++{ ++ xmlNode *ticket_state_xml = NULL; ++ ++ enum cib_errors rc = cib_ok; ++ ++ rc = find_ticket_state(cib, ticket_id, &ticket_state_xml); ++ ++ if (rc == cib_NOTEXISTS) { ++ return cib_ok; ++ ++ } else if (rc != cib_ok) { ++ return rc; ++ } ++ ++ crm_log_xml_debug(ticket_state_xml, "Delete"); ++ ++ rc = cib->cmds->delete(cib, XML_CIB_TAG_STATUS, ticket_state_xml, cib_options); ++ ++ if (rc == cib_ok) { ++ fprintf(stdout, "Cleaned up %s\n", ticket_id); ++ } ++ ++ free_xml(ticket_state_xml); ++ return rc; ++} ++ ++static gboolean ++confirm(const char *ticket_id, const char *action) ++{ ++ gboolean rc = FALSE; ++ int offset = 0; ++ static int text_max = 1024; ++ ++ char *warning = NULL; ++ const char * word = NULL; ++ ++ crm_malloc0(warning, text_max); ++ if (safe_str_eq(action, "grant")) { ++ offset += snprintf(warning + offset, text_max - offset, ++ "The command cannot help you verify if '%s' is already granted elsewhere.\n", ++ ticket_id); ++ word = "to"; ++ ++ } else { ++ offset += snprintf(warning + offset, text_max - offset, ++ "Revoking '%s' can trigger the specified 'loss-policy'(s) relating to '%s'.\n\n", ++ ticket_id, ticket_id); ++ ++ offset += snprintf(warning + offset, text_max - offset, ++ "You can check that with:\ncrm_ticket --ticket %s --constraints\n\n", ++ ticket_id); ++ ++ offset += snprintf(warning + offset, text_max - offset, ++ "Otherwise before revoking '%s', you may want to make '%s' standby with:\ncrm_ticket --ticket %s --standby\n", ++ ticket_id, ticket_id, ticket_id); ++ word = "from"; ++ } ++ ++ fprintf(stdout, "%s\n", warning); ++ ++ while (TRUE) { ++ char *answer = NULL; ++ ++ crm_malloc0(answer, text_max); ++ fprintf(stdout, "Are you sure you want to %s '%s' %s this site now? (y/n)", ++ action, ticket_id, word); ++ ++ rc = scanf("%s", answer); ++ ++ if (strchr(answer, 'y') == answer || strchr(answer, 'Y') == answer) { ++ rc = TRUE; ++ crm_free(answer); ++ goto bail; ++ ++ } else if (strchr(answer, 'n') == answer || strchr(answer, 'N') == answer) { ++ rc = FALSE; ++ crm_free(answer); ++ goto bail; ++ ++ } else { ++ crm_free(answer); ++ fprintf(stdout, "Please answer with y or n\n"); ++ } ++ } ++ ++bail: ++ crm_free(warning); ++ return rc; ++} ++ ++/* *INDENT-OFF* */ ++static struct crm_option long_options[] = { ++ /* Top-level Options */ ++ {"help", 0, 0, '?', "\t\tThis text"}, ++ {"version", 0, 0, '$', "\t\tVersion information" }, ++ {"verbose", 0, 0, 'V', "\t\tIncrease debug output"}, ++ {"quiet", 0, 0, 'Q', "\t\tPrint only the value on stdout\n"}, ++ ++ {"ticket", 1, 0, 't', "\tTicket ID" }, ++ ++ {"-spacer-", 1, 0, '-', "\nQueries:"}, ++ {"info", 0, 0, 'l', "\t\tDisplay the information of ticket(s)"}, ++ {"details", 0, 0, 'L', "\t\tDisplay the details of ticket(s)"}, ++ {"raw", 0, 0, 'w', "\t\tDisplay the IDs of ticket(s)"}, ++ {"query-xml", 0, 0, 'q', "\tQuery the XML of ticket(s)"}, ++ {"constraints",0, 0, 'c', "\tDisplay the rsc_ticket constraints that apply to ticket(s)"}, ++ ++ {"-spacer-", 1, 0, '-', "\nCommands:"}, ++ {"grant", 0, 0, 'g', "\t\tGrant a ticket to this cluster site"}, ++ {"revoke", 0, 0, 'r', "\t\tRevoke a ticket from this cluster site"}, ++ {"standby", 0, 0, 's', "\t\tTell this cluster site this ticket is standby"}, ++ {"activate", 0, 0, 'a', "\tTell this cluster site this ticket is active"}, ++ ++ {"-spacer-", 1, 0, '-', "\nAdvanced Commands:"}, ++ {"get-attr", 1, 0, 'G', "\tDisplay the named attribute for a ticket"}, ++ {"set-attr", 1, 0, 'S', "\tSet the named attribtue for a ticket"}, ++ {"delete-attr",1, 0, 'D', "\tDelete the named attribute for a ticket"}, ++ {"cleanup", 0, 0, 'C', "\t\tDelete all state of a ticket at this cluster site"}, ++ ++ {"-spacer-", 1, 0, '-', "\nAdditional Options:"}, ++ {"attr-value", 1, 0, 'v', "\tAttribute value to use with -S"}, ++ {"default", 1, 0, 'd', "\t(Advanced) The default attribute value to display if none is found. For use with -G"}, ++ {"force", 0, 0, 'f', "\t\t(Advanced) Force the action to be performed"}, ++ {"xml-file", 1, 0, 'x', NULL, 1},\ ++ ++ /* legacy options */ ++ {"set-name", 1, 0, 'n', "\t(Advanced) ID of the instance_attributes object to change"}, ++ {"nvpair", 1, 0, 'i', "\t(Advanced) ID of the nvpair object to change/delete"}, ++ ++ {"-spacer-", 1, 0, '-', "\nExamples:", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', "Display the info of tickets:", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --info", pcmk_option_example}, ++ {"-spacer-", 1, 0, '-', "Display the detailed info of tickets:", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --details", pcmk_option_example}, ++ {"-spacer-", 1, 0, '-', "Display the XML of 'ticketA':", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --ticket ticketA --query-xml", pcmk_option_example}, ++ {"-spacer-", 1, 0, '-', "Display the rsc_ticket constraints that apply to 'ticketA':", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --ticket ticketA --constraints", pcmk_option_example}, ++ ++ {"-spacer-", 1, 0, '-', "Grant 'ticketA' to this cluster site:", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --ticket ticketA --grant", pcmk_option_example}, ++ {"-spacer-", 1, 0, '-', "Revoke 'ticketA' from this cluster site:", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --ticket ticketA --revoke", pcmk_option_example}, ++ {"-spacer-", 1, 0, '-', "Make 'ticketA' standby:", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', "The cluster site will treat a granted 'ticketA' as 'standby'."}, ++ {"-spacer-", 1, 0, '-', "The dependent resources will be stopped or demoted gracefully without triggering loss-policies", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --ticket ticketA --standby", pcmk_option_example}, ++ {"-spacer-", 1, 0, '-', "Activate 'ticketA' from being standby:", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --ticket ticketA --activate", pcmk_option_example}, ++ ++ {"-spacer-", 1, 0, '-', "Get the value of the 'granted' attribute for 'ticketA':", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --ticket ticketA --get-attr granted", pcmk_option_example}, ++ {"-spacer-", 1, 0, '-', "Set the value of the 'standby' attribute for 'ticketA':", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --ticket ticketA --set-attr standby --attr-value true", pcmk_option_example}, ++ {"-spacer-", 1, 0, '-', "Delete the 'granted' attribute for 'ticketA':", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --ticket ticketA --delete-attr granted", pcmk_option_example}, ++ {"-spacer-", 1, 0, '-', "Erase the operation history of 'ticketA' at this cluster site:", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', "The cluster site will 'forget' the existing ticket state.", pcmk_option_paragraph}, ++ {"-spacer-", 1, 0, '-', " crm_ticket --ticket ticketA --cleanup", pcmk_option_example}, ++ ++ {0, 0, 0, 0} ++}; ++/* *INDENT-ON* */ ++ ++int ++main(int argc, char **argv) ++{ ++ pe_working_set_t data_set; ++ xmlNode *cib_xml_copy = NULL; ++ ++ cib_t *cib_conn = NULL; ++ enum cib_errors rc = cib_ok; ++ ++ int option_index = 0; ++ int argerr = 0; ++ int flag; ++ ++ crm_log_init(NULL, LOG_ERR, FALSE, FALSE, argc, argv); ++ crm_set_options(NULL, "(query|command) [options]", long_options, ++ "Perform tasks related to cluster tickets.\nAllows ticket attributes to be queried, modified and deleted.\n"); ++ ++ if (argc < 2) { ++ crm_help('?', LSB_EXIT_EINVAL); ++ } ++ ++ while (1) { ++ flag = crm_get_option(argc, argv, &option_index); ++ if (flag == -1) ++ break; ++ ++ switch (flag) { ++ case 'V': ++ crm_bump_log_level(); ++ break; ++ case '$': ++ case '?': ++ crm_help(flag, LSB_EXIT_OK); ++ break; ++ case 'Q': ++ BE_QUIET = TRUE; ++ break; ++ case 't': ++ ticket_id = optarg; ++ break; ++ case 'l': ++ case 'L': ++ case 'w': ++ case 'q': ++ case 'c': ++ ticket_cmd = flag; ++ break; ++ case 'g': ++ case 'r': ++ case 's': ++ case 'a': ++ ticket_cmd = flag; ++ break; ++ case 'G': ++ case 'S': ++ case 'D': ++ attr_name = optarg; ++ ticket_cmd = flag; ++ break; ++ case 'C': ++ ticket_cmd = flag; ++ break; ++ case 'v': ++ attr_value = optarg; ++ break; ++ case 'd': ++ attr_default = optarg; ++ break; ++ case 'f': ++ do_force = TRUE; ++ break; ++ case 'x': ++ xml_file = crm_strdup(optarg); ++ break; ++ case 'n': ++ set_name = optarg; ++ break; ++ case 'i': ++ attr_id = optarg; ++ break; ++ ++ default: ++ CMD_ERR("Argument code 0%o (%c) is not (?yet?) supported\n", flag, flag); ++ ++argerr; ++ break; ++ } ++ } ++ ++ if (BE_QUIET == FALSE) { ++ crm_log_args(argc, argv); ++ } ++ ++ if (optind < argc && argv[optind] != NULL) { ++ CMD_ERR("non-option ARGV-elements: "); ++ while (optind < argc && argv[optind] != NULL) { ++ CMD_ERR("%s ", argv[optind++]); ++ ++argerr; ++ } ++ CMD_ERR("\n"); ++ } ++ ++ if (optind > argc) { ++ ++argerr; ++ } ++ ++ if (argerr) { ++ crm_help('?', LSB_EXIT_GENERIC); ++ } ++ ++ set_working_set_defaults(&data_set); ++ ++ cib_conn = cib_new(); ++ rc = cib_conn->cmds->signon(cib_conn, crm_system_name, cib_command); ++ if (rc != cib_ok) { ++ CMD_ERR("Error signing on to the CIB service: %s\n", cib_error2string(rc)); ++ return rc; ++ } ++ ++ if (xml_file != NULL) { ++ cib_xml_copy = filename2xml(xml_file); ++ ++ } else { ++ cib_xml_copy = get_cib_copy(cib_conn); ++ } ++ ++ if (cli_config_update(&cib_xml_copy, NULL, FALSE) == FALSE) { ++ rc = cib_STALE; ++ goto bail; ++ } ++ ++ data_set.input = cib_xml_copy; ++ data_set.now = new_ha_date(TRUE); ++ ++ cluster_status(&data_set); ++ ++ if (ticket_cmd == 'l' || ticket_cmd == 'L' || ticket_cmd == 'w') { ++ gboolean raw = FALSE; ++ gboolean details = FALSE; ++ rc = cib_ok; ++ ++ if (ticket_cmd == 'L') { ++ details = TRUE; ++ } else if (ticket_cmd == 'w') { ++ raw = TRUE; ++ } ++ ++ if (ticket_id) { ++ ticket_t *ticket = find_ticket(ticket_id, &data_set); ++ if (ticket == NULL) { ++ rc = cib_NOTEXISTS; ++ goto bail; ++ } ++ rc = print_ticket(ticket, raw, details); ++ ++ } else { ++ rc = print_ticket_list(&data_set, raw, details); ++ } ++ ++ } else if (ticket_cmd == 'q') { ++ rc = dump_ticket_xml(cib_conn, ticket_id); ++ ++ } else if (ticket_cmd == 'c') { ++ rc = dump_constraints(cib_conn, ticket_id); ++ ++ } else if (ticket_cmd == 'G') { ++ const char *value = NULL; ++ ++ if (ticket_id == NULL) { ++ CMD_ERR("Must supply a ticket id with -t\n"); ++ rc = cib_NOTEXISTS; ++ goto bail; ++ } ++ ++ rc = get_ticket_state_attr(ticket_id, attr_name, &value, &data_set); ++ if (rc == cib_ok) { ++ fprintf(stdout, "%s\n", value); ++ } else if (rc == cib_NOTEXISTS && attr_default) { ++ fprintf(stdout, "%s\n", attr_default); ++ rc = cib_ok; ++ } ++ ++ } else if (ticket_cmd == 'S' ++ || ticket_cmd == 'g' || ticket_cmd == 'r' ++ || ticket_cmd == 's' || ticket_cmd == 'a') { ++ gboolean is_granting = FALSE; ++ ++ if (ticket_id == NULL) { ++ CMD_ERR("Must supply a ticket id with -t\n"); ++ rc = cib_NOTEXISTS; ++ goto bail; ++ } ++ ++ if (ticket_cmd == 'g') { ++ attr_name = "granted"; ++ attr_value = "true"; ++ ++ } else if (ticket_cmd == 'r') { ++ attr_name = "granted"; ++ attr_value = "false"; ++ ++ } else if (ticket_cmd == 's') { ++ attr_name = "standby"; ++ attr_value = "true"; ++ ++ } else if (ticket_cmd == 'a') { ++ attr_name = "standby"; ++ attr_value = "false"; ++ } ++ ++ if (attr_value == NULL || strlen(attr_value) == 0) { ++ CMD_ERR("You need to supply a value with the -v option\n"); ++ rc = CIBRES_MISSING_FIELD; ++ goto bail; ++ } ++ ++ if (safe_str_eq(attr_name, "granted") && do_force == FALSE) { ++ if (crm_is_true(attr_value) && confirm(ticket_id, "grant") == FALSE) { ++ CMD_ERR("Cancelled\n"); ++ rc = cib_ok; ++ goto bail; ++ ++ } else if (crm_is_true(attr_value) == FALSE && confirm(ticket_id, "revoke") == FALSE) { ++ CMD_ERR("Cancelled\n"); ++ rc = cib_ok; ++ goto bail; ++ } ++ } ++ ++ if (safe_str_eq(attr_name, "granted") && crm_is_true(attr_value)) { ++ ticket_t *ticket = find_ticket(ticket_id, &data_set); ++ ++ if (ticket == NULL || ticket->granted == FALSE) { ++ is_granting = TRUE; ++ } ++ } ++ ++ rc = set_ticket_state_attr(ticket_id, attr_name, attr_value, cib_conn); ++ delete_ticket_state_attr_legacy(ticket_id, set_name, attr_id, attr_name, cib_conn); ++ ++ if(rc != cib_ok) { ++ goto bail; ++ } ++ ++ if (is_granting == TRUE) { ++ set_ticket_state_attr(ticket_id, "last-granted", crm_itoa(time(NULL)), cib_conn); ++ delete_ticket_state_attr_legacy(ticket_id, set_name, attr_id, "last-granted", cib_conn); ++ } ++ ++ } else if (ticket_cmd == 'D') { ++ if (ticket_id == NULL) { ++ CMD_ERR("Must supply a ticket id with -t\n"); ++ rc = cib_NOTEXISTS; ++ goto bail; ++ } ++ ++ if (safe_str_eq(attr_name, "granted") && do_force == FALSE ++ && confirm(ticket_id, "revoke") == FALSE) { ++ CMD_ERR("Cancelled\n"); ++ rc = cib_ok; ++ goto bail; ++ } ++ ++ delete_ticket_state_attr_legacy(ticket_id, set_name, attr_id, attr_name, cib_conn); ++ rc = delete_ticket_state_attr(ticket_id, attr_name, cib_conn); ++ ++ } else if (ticket_cmd == 'C') { ++ if (ticket_id == NULL) { ++ CMD_ERR("Must supply a ticket id with -t\n"); ++ rc = cib_NOTEXISTS; ++ goto bail; ++ } ++ ++ if (do_force == FALSE) { ++ ticket_t *ticket = NULL; ++ ++ ticket = find_ticket(ticket_id, &data_set); ++ if (ticket == NULL) { ++ return cib_NOTEXISTS; ++ goto bail; ++ } ++ ++ if (ticket->granted && confirm(ticket_id, "revoke") == FALSE) { ++ CMD_ERR("Cancelled\n"); ++ rc = cib_ok; ++ goto bail; ++ } ++ } ++ ++ rc = delete_ticket_state(ticket_id, cib_conn); ++ ++ } else { ++ CMD_ERR("Unknown command: %c\n", ticket_cmd); ++ } ++ ++ bail: ++ ++ if (cib_conn != NULL) { ++ cleanup_alloc_calculations(&data_set); ++ cib_conn->cmds->signoff(cib_conn); ++ cib_delete(cib_conn); ++ } ++ ++ crm_xml_cleanup(); ++ ++ if (rc == cib_no_quorum) { ++ CMD_ERR("Error performing operation: %s\n", cib_error2string(rc)); ++ CMD_ERR("Try using -f\n"); ++ ++ } else if (rc != cib_ok) { ++ CMD_ERR("Error performing operation: %s\n", cib_error2string(rc)); ++ } ++ ++ return rc; ++} diff --git a/pacemaker-log-fix.diff b/pacemaker-log-fix.diff new file mode 100644 index 0000000..cb05bc5 --- /dev/null +++ b/pacemaker-log-fix.diff @@ -0,0 +1,23 @@ +diff --git a/tools/crm_ticket.c b/tools/crm_ticket.c +index f90ba23..51f5180 100644 +--- a/tools/crm_ticket.c ++++ b/tools/crm_ticket.c +@@ -676,7 +676,8 @@ main(int argc, char **argv) + + switch (flag) { + case 'V': +- crm_bump_log_level(); ++ cl_log_enable_stderr(TRUE); ++ alter_debug(DEBUG_INC); + break; + case '$': + case '?': +@@ -737,7 +738,7 @@ main(int argc, char **argv) + } + + if (BE_QUIET == FALSE) { +- crm_log_args(argc, argv); ++ cl_log_args(argc, argv); + } + + if (optind < argc && argv[optind] != NULL) { diff --git a/pacemaker-ticket-last-granted-prefix.diff b/pacemaker-ticket-last-granted-prefix.diff new file mode 100644 index 0000000..d150416 --- /dev/null +++ b/pacemaker-ticket-last-granted-prefix.diff @@ -0,0 +1,19 @@ +commit 150647923483ae92bac8be05c068134583552b0d +Author: Yuusuke Iida +Date: Mon Feb 20 19:37:46 2012 +0900 + + Low: PE: changed a pre-fix to refer to a right value. + +diff --git a/lib/pengine/unpack.c b/lib/pengine/unpack.c +index 70bcdc6..34f0e0e 100644 +--- a/lib/pengine/unpack.c ++++ b/lib/pengine/unpack.c +@@ -425,7 +425,7 @@ get_ticket_state(gpointer key, gpointer value, gpointer user_data) + const char *attr_key = key; + + const char *granted_prefix = "granted-ticket-"; +- const char *last_granted_prefix = "last-granted-ticket-"; ++ const char *last_granted_prefix = "last-granted-"; + static int granted_prefix_strlen = 0; + static int last_granted_prefix_strlen = 0; + diff --git a/pacemaker-ticket-standby-tests.diff b/pacemaker-ticket-standby-tests.diff new file mode 100644 index 0000000..a55c318 --- /dev/null +++ b/pacemaker-ticket-standby-tests.diff @@ -0,0 +1,10643 @@ +commit c52df0e6a070de97c10ec9445f7428c3f0cfb2e4 +Author: Gao,Yan +Date: Sat Mar 24 18:23:11 2012 +0800 + + Low: PE: Support to make tickets standby for relinquishing tickets gracefully (regression tests) + +diff --git a/pengine/regression.sh b/pengine/regression.sh +index f8e3d7d..493b05c 100755 +--- a/pengine/regression.sh ++++ b/pengine/regression.sh +@@ -496,6 +496,19 @@ do_test ticket-primitive-10 "Ticket - Primitive (loss-policy=freeze, initial)" + do_test ticket-primitive-11 "Ticket - Primitive (loss-policy=freeze, granted)" + do_test ticket-primitive-12 "Ticket - Primitive (loss-policy=freeze, revoked)" + ++do_test ticket-primitive-13 "Ticket - Primitive (loss-policy=stop, standby, granted)" ++do_test ticket-primitive-14 "Ticket - Primitive (loss-policy=stop, granted, standby)" ++do_test ticket-primitive-15 "Ticket - Primitive (loss-policy=stop, standby, revoked)" ++do_test ticket-primitive-16 "Ticket - Primitive (loss-policy=demote, standby, granted)" ++do_test ticket-primitive-17 "Ticket - Primitive (loss-policy=demote, granted, standby)" ++do_test ticket-primitive-18 "Ticket - Primitive (loss-policy=demote, standby, revoked)" ++do_test ticket-primitive-19 "Ticket - Primitive (loss-policy=fence, standby, granted)" ++do_test ticket-primitive-20 "Ticket - Primitive (loss-policy=fence, granted, standby)" ++do_test ticket-primitive-21 "Ticket - Primitive (loss-policy=fence, standby, revoked)" ++do_test ticket-primitive-22 "Ticket - Primitive (loss-policy=freeze, standby, granted)" ++do_test ticket-primitive-23 "Ticket - Primitive (loss-policy=freeze, granted, standby)" ++do_test ticket-primitive-24 "Ticket - Primitive (loss-policy=freeze, standby, revoked)" ++ + echo"" + do_test ticket-group-1 "Ticket - Group (loss-policy=stop, initial)" + do_test ticket-group-2 "Ticket - Group (loss-policy=stop, granted)" +@@ -509,7 +522,20 @@ do_test ticket-group-9 "Ticket - Group (loss-policy=fence, revoked)" + do_test ticket-group-10 "Ticket - Group (loss-policy=freeze, initial)" + do_test ticket-group-11 "Ticket - Group (loss-policy=freeze, granted)" + do_test ticket-group-12 "Ticket - Group (loss-policy=freeze, revoked)" +- ++ ++do_test ticket-group-13 "Ticket - Group (loss-policy=stop, standby, granted)" ++do_test ticket-group-14 "Ticket - Group (loss-policy=stop, granted, standby)" ++do_test ticket-group-15 "Ticket - Group (loss-policy=stop, standby, revoked)" ++do_test ticket-group-16 "Ticket - Group (loss-policy=demote, standby, granted)" ++do_test ticket-group-17 "Ticket - Group (loss-policy=demote, granted, standby)" ++do_test ticket-group-18 "Ticket - Group (loss-policy=demote, standby, revoked)" ++do_test ticket-group-19 "Ticket - Group (loss-policy=fence, standby, granted)" ++do_test ticket-group-20 "Ticket - Group (loss-policy=fence, granted, standby)" ++do_test ticket-group-21 "Ticket - Group (loss-policy=fence, standby, revoked)" ++do_test ticket-group-22 "Ticket - Group (loss-policy=freeze, standby, granted)" ++do_test ticket-group-23 "Ticket - Group (loss-policy=freeze, granted, standby)" ++do_test ticket-group-24 "Ticket - Group (loss-policy=freeze, standby, revoked)" ++ + echo"" + do_test ticket-clone-1 "Ticket - Clone (loss-policy=stop, initial)" + do_test ticket-clone-2 "Ticket - Clone (loss-policy=stop, granted)" +@@ -523,7 +549,20 @@ do_test ticket-clone-9 "Ticket - Clone (loss-policy=fence, revoked)" + do_test ticket-clone-10 "Ticket - Clone (loss-policy=freeze, initial)" + do_test ticket-clone-11 "Ticket - Clone (loss-policy=freeze, granted)" + do_test ticket-clone-12 "Ticket - Clone (loss-policy=freeze, revoked)" +- ++ ++do_test ticket-clone-13 "Ticket - Clone (loss-policy=stop, standby, granted)" ++do_test ticket-clone-14 "Ticket - Clone (loss-policy=stop, granted, standby)" ++do_test ticket-clone-15 "Ticket - Clone (loss-policy=stop, standby, revoked)" ++do_test ticket-clone-16 "Ticket - Clone (loss-policy=demote, standby, granted)" ++do_test ticket-clone-17 "Ticket - Clone (loss-policy=demote, granted, standby)" ++do_test ticket-clone-18 "Ticket - Clone (loss-policy=demote, standby, revoked)" ++do_test ticket-clone-19 "Ticket - Clone (loss-policy=fence, standby, granted)" ++do_test ticket-clone-20 "Ticket - Clone (loss-policy=fence, granted, standby)" ++do_test ticket-clone-21 "Ticket - Clone (loss-policy=fence, standby, revoked)" ++do_test ticket-clone-22 "Ticket - Clone (loss-policy=freeze, standby, granted)" ++do_test ticket-clone-23 "Ticket - Clone (loss-policy=freeze, granted, standby)" ++do_test ticket-clone-24 "Ticket - Clone (loss-policy=freeze, standby, revoked)" ++ + echo"" + do_test ticket-master-1 "Ticket - Master (loss-policy=stop, initial)" + do_test ticket-master-2 "Ticket - Master (loss-policy=stop, granted)" +@@ -538,6 +577,19 @@ do_test ticket-master-10 "Ticket - Master (loss-policy=freeze, initial)" + do_test ticket-master-11 "Ticket - Master (loss-policy=freeze, granted)" + do_test ticket-master-12 "Ticket - Master (loss-policy=freeze, revoked)" + ++do_test ticket-master-13 "Ticket - Master (loss-policy=stop, standby, granted)" ++do_test ticket-master-14 "Ticket - Master (loss-policy=stop, granted, standby)" ++do_test ticket-master-15 "Ticket - Master (loss-policy=stop, standby, revoked)" ++do_test ticket-master-16 "Ticket - Master (loss-policy=demote, standby, granted)" ++do_test ticket-master-17 "Ticket - Master (loss-policy=demote, granted, standby)" ++do_test ticket-master-18 "Ticket - Master (loss-policy=demote, standby, revoked)" ++do_test ticket-master-19 "Ticket - Master (loss-policy=fence, standby, granted)" ++do_test ticket-master-20 "Ticket - Master (loss-policy=fence, granted, standby)" ++do_test ticket-master-21 "Ticket - Master (loss-policy=fence, standby, revoked)" ++do_test ticket-master-22 "Ticket - Master (loss-policy=freeze, standby, granted)" ++do_test ticket-master-23 "Ticket - Master (loss-policy=freeze, granted, standby)" ++do_test ticket-master-24 "Ticket - Master (loss-policy=freeze, standby, revoked)" ++ + echo "" + do_test ticket-rsc-sets-1 "Ticket - Resource sets (1 ticket, initial)" + do_test ticket-rsc-sets-2 "Ticket - Resource sets (1 ticket, granted)" +@@ -547,6 +599,14 @@ do_test ticket-rsc-sets-5 "Ticket - Resource sets (2 tickets, granted)" + do_test ticket-rsc-sets-6 "Ticket - Resource sets (2 tickets, granted)" + do_test ticket-rsc-sets-7 "Ticket - Resource sets (2 tickets, revoked)" + ++do_test ticket-rsc-sets-8 "Ticket - Resource sets (1 ticket, standby, granted)" ++do_test ticket-rsc-sets-9 "Ticket - Resource sets (1 ticket, granted, standby)" ++do_test ticket-rsc-sets-10 "Ticket - Resource sets (1 ticket, standby, revoked)" ++do_test ticket-rsc-sets-11 "Ticket - Resource sets (2 tickets, standby, granted)" ++do_test ticket-rsc-sets-12 "Ticket - Resource sets (2 tickets, standby, granted)" ++do_test ticket-rsc-sets-13 "Ticket - Resource sets (2 tickets, granted, standby)" ++do_test ticket-rsc-sets-14 "Ticket - Resource sets (2 tickets, standby, revoked)" ++ + echo "" + do_test template-1 "Template - 1" + do_test template-2 "Template - 2" +diff --git a/pengine/test10/ticket-clone-13.dot b/pengine/test10/ticket-clone-13.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-clone-13.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-clone-13.exp b/pengine/test10/ticket-clone-13.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-clone-13.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-13.scores b/pengine/test10/ticket-clone-13.scores +new file mode 100644 +index 0000000..89e2d0f +--- /dev/null ++++ b/pengine/test10/ticket-clone-13.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-13.xml b/pengine/test10/ticket-clone-13.xml +new file mode 100644 +index 0000000..3494923 +--- /dev/null ++++ b/pengine/test10/ticket-clone-13.xml +@@ -0,0 +1,57 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-14.dot b/pengine/test10/ticket-clone-14.dot +new file mode 100644 +index 0000000..1c04e6e +--- /dev/null ++++ b/pengine/test10/ticket-clone-14.dot +@@ -0,0 +1,16 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"clone1_stop_0" -> "clone1_stopped_0" [ style = bold] ++"clone1_stop_0" -> "rsc1:0_stop_0 node2" [ style = bold] ++"clone1_stop_0" -> "rsc1:1_stop_0 node1" [ style = bold] ++"clone1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"clone1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1:0_stop_0 node2" -> "clone1_stopped_0" [ style = bold] ++"rsc1:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc1:1_stop_0 node1" -> "clone1_stopped_0" [ style = bold] ++"rsc1:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-clone-14.exp b/pengine/test10/ticket-clone-14.exp +new file mode 100644 +index 0000000..a758892 +--- /dev/null ++++ b/pengine/test10/ticket-clone-14.exp +@@ -0,0 +1,86 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-14.scores b/pengine/test10/ticket-clone-14.scores +new file mode 100644 +index 0000000..89e2d0f +--- /dev/null ++++ b/pengine/test10/ticket-clone-14.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-14.xml b/pengine/test10/ticket-clone-14.xml +new file mode 100644 +index 0000000..eba5c42 +--- /dev/null ++++ b/pengine/test10/ticket-clone-14.xml +@@ -0,0 +1,63 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-15.dot b/pengine/test10/ticket-clone-15.dot +new file mode 100644 +index 0000000..1c04e6e +--- /dev/null ++++ b/pengine/test10/ticket-clone-15.dot +@@ -0,0 +1,16 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"clone1_stop_0" -> "clone1_stopped_0" [ style = bold] ++"clone1_stop_0" -> "rsc1:0_stop_0 node2" [ style = bold] ++"clone1_stop_0" -> "rsc1:1_stop_0 node1" [ style = bold] ++"clone1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"clone1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1:0_stop_0 node2" -> "clone1_stopped_0" [ style = bold] ++"rsc1:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc1:1_stop_0 node1" -> "clone1_stopped_0" [ style = bold] ++"rsc1:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-clone-15.exp b/pengine/test10/ticket-clone-15.exp +new file mode 100644 +index 0000000..a758892 +--- /dev/null ++++ b/pengine/test10/ticket-clone-15.exp +@@ -0,0 +1,86 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-15.scores b/pengine/test10/ticket-clone-15.scores +new file mode 100644 +index 0000000..89e2d0f +--- /dev/null ++++ b/pengine/test10/ticket-clone-15.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-15.xml b/pengine/test10/ticket-clone-15.xml +new file mode 100644 +index 0000000..c9c7fa6 +--- /dev/null ++++ b/pengine/test10/ticket-clone-15.xml +@@ -0,0 +1,63 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-16.dot b/pengine/test10/ticket-clone-16.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-clone-16.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-clone-16.exp b/pengine/test10/ticket-clone-16.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-clone-16.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-16.scores b/pengine/test10/ticket-clone-16.scores +new file mode 100644 +index 0000000..89e2d0f +--- /dev/null ++++ b/pengine/test10/ticket-clone-16.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-16.xml b/pengine/test10/ticket-clone-16.xml +new file mode 100644 +index 0000000..e8d9a66 +--- /dev/null ++++ b/pengine/test10/ticket-clone-16.xml +@@ -0,0 +1,57 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-17.dot b/pengine/test10/ticket-clone-17.dot +new file mode 100644 +index 0000000..1c04e6e +--- /dev/null ++++ b/pengine/test10/ticket-clone-17.dot +@@ -0,0 +1,16 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"clone1_stop_0" -> "clone1_stopped_0" [ style = bold] ++"clone1_stop_0" -> "rsc1:0_stop_0 node2" [ style = bold] ++"clone1_stop_0" -> "rsc1:1_stop_0 node1" [ style = bold] ++"clone1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"clone1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1:0_stop_0 node2" -> "clone1_stopped_0" [ style = bold] ++"rsc1:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc1:1_stop_0 node1" -> "clone1_stopped_0" [ style = bold] ++"rsc1:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-clone-17.exp b/pengine/test10/ticket-clone-17.exp +new file mode 100644 +index 0000000..a758892 +--- /dev/null ++++ b/pengine/test10/ticket-clone-17.exp +@@ -0,0 +1,86 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-17.scores b/pengine/test10/ticket-clone-17.scores +new file mode 100644 +index 0000000..89e2d0f +--- /dev/null ++++ b/pengine/test10/ticket-clone-17.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-17.xml b/pengine/test10/ticket-clone-17.xml +new file mode 100644 +index 0000000..599cec2 +--- /dev/null ++++ b/pengine/test10/ticket-clone-17.xml +@@ -0,0 +1,63 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-18.dot b/pengine/test10/ticket-clone-18.dot +new file mode 100644 +index 0000000..1c04e6e +--- /dev/null ++++ b/pengine/test10/ticket-clone-18.dot +@@ -0,0 +1,16 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"clone1_stop_0" -> "clone1_stopped_0" [ style = bold] ++"clone1_stop_0" -> "rsc1:0_stop_0 node2" [ style = bold] ++"clone1_stop_0" -> "rsc1:1_stop_0 node1" [ style = bold] ++"clone1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"clone1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1:0_stop_0 node2" -> "clone1_stopped_0" [ style = bold] ++"rsc1:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc1:1_stop_0 node1" -> "clone1_stopped_0" [ style = bold] ++"rsc1:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-clone-18.exp b/pengine/test10/ticket-clone-18.exp +new file mode 100644 +index 0000000..a758892 +--- /dev/null ++++ b/pengine/test10/ticket-clone-18.exp +@@ -0,0 +1,86 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-18.scores b/pengine/test10/ticket-clone-18.scores +new file mode 100644 +index 0000000..89e2d0f +--- /dev/null ++++ b/pengine/test10/ticket-clone-18.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-18.xml b/pengine/test10/ticket-clone-18.xml +new file mode 100644 +index 0000000..5afd2da +--- /dev/null ++++ b/pengine/test10/ticket-clone-18.xml +@@ -0,0 +1,63 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-19.dot b/pengine/test10/ticket-clone-19.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-clone-19.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-clone-19.exp b/pengine/test10/ticket-clone-19.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-clone-19.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-19.scores b/pengine/test10/ticket-clone-19.scores +new file mode 100644 +index 0000000..89e2d0f +--- /dev/null ++++ b/pengine/test10/ticket-clone-19.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-19.xml b/pengine/test10/ticket-clone-19.xml +new file mode 100644 +index 0000000..1576f06 +--- /dev/null ++++ b/pengine/test10/ticket-clone-19.xml +@@ -0,0 +1,57 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-20.dot b/pengine/test10/ticket-clone-20.dot +new file mode 100644 +index 0000000..1c04e6e +--- /dev/null ++++ b/pengine/test10/ticket-clone-20.dot +@@ -0,0 +1,16 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"clone1_stop_0" -> "clone1_stopped_0" [ style = bold] ++"clone1_stop_0" -> "rsc1:0_stop_0 node2" [ style = bold] ++"clone1_stop_0" -> "rsc1:1_stop_0 node1" [ style = bold] ++"clone1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"clone1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1:0_stop_0 node2" -> "clone1_stopped_0" [ style = bold] ++"rsc1:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc1:1_stop_0 node1" -> "clone1_stopped_0" [ style = bold] ++"rsc1:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-clone-20.exp b/pengine/test10/ticket-clone-20.exp +new file mode 100644 +index 0000000..a758892 +--- /dev/null ++++ b/pengine/test10/ticket-clone-20.exp +@@ -0,0 +1,86 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-20.scores b/pengine/test10/ticket-clone-20.scores +new file mode 100644 +index 0000000..89e2d0f +--- /dev/null ++++ b/pengine/test10/ticket-clone-20.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-20.xml b/pengine/test10/ticket-clone-20.xml +new file mode 100644 +index 0000000..0ca6500 +--- /dev/null ++++ b/pengine/test10/ticket-clone-20.xml +@@ -0,0 +1,63 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-21.dot b/pengine/test10/ticket-clone-21.dot +new file mode 100644 +index 0000000..d47eaeb +--- /dev/null ++++ b/pengine/test10/ticket-clone-21.dot +@@ -0,0 +1,31 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"clone1_stop_0" -> "clone1_stopped_0" [ style = bold] ++"clone1_stop_0" -> "rsc1:0_stop_0 node2" [ style = bold] ++"clone1_stop_0" -> "rsc1:1_stop_0 node1" [ style = bold] ++"clone1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"clone1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"rsc1:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1:0_stop_0 node2" -> "clone1_stopped_0" [ style = bold] ++"rsc1:0_stop_0 node2" [ style=bold color="green" fontcolor="orange"] ++"rsc1:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc1:1_stop_0 node1" -> "clone1_stopped_0" [ style = bold] ++"rsc1:1_stop_0 node1" [ style=bold color="green" fontcolor="orange"] ++"stonith node1" -> "all_stopped" [ style = bold] ++"stonith node1" -> "clone1_stop_0" [ style = bold] ++"stonith node1" -> "rsc1:1_stop_0 node1" [ style = bold] ++"stonith node1" -> "stonith node2" [ style = bold] ++"stonith node1" [ style=bold color="green" fontcolor="black"] ++"stonith node2" -> "all_stopped" [ style = bold] ++"stonith node2" -> "clone1_stop_0" [ style = bold] ++"stonith node2" -> "rsc1:0_stop_0 node2" [ style = bold] ++"stonith node2" -> "stonith_complete" [ style = bold] ++"stonith node2" [ style=bold color="green" fontcolor="black"] ++"stonith_complete" -> "rsc1:0_stop_0 node2" [ style = bold] ++"stonith_complete" -> "rsc1:1_stop_0 node1" [ style = bold] ++"stonith_complete" [ style=bold color="green" fontcolor="orange"] ++"stonith_up" -> "stonith node1" [ style = bold] ++"stonith_up" -> "stonith node2" [ style = bold] ++"stonith_up" -> "stonith_complete" [ style = bold] ++"stonith_up" [ style=bold color="green" fontcolor="orange"] ++} +diff --git a/pengine/test10/ticket-clone-21.exp b/pengine/test10/ticket-clone-21.exp +new file mode 100644 +index 0000000..ce2d0d6 +--- /dev/null ++++ b/pengine/test10/ticket-clone-21.exp +@@ -0,0 +1,143 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-21.scores b/pengine/test10/ticket-clone-21.scores +new file mode 100644 +index 0000000..89e2d0f +--- /dev/null ++++ b/pengine/test10/ticket-clone-21.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-21.xml b/pengine/test10/ticket-clone-21.xml +new file mode 100644 +index 0000000..a249250 +--- /dev/null ++++ b/pengine/test10/ticket-clone-21.xml +@@ -0,0 +1,63 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-22.dot b/pengine/test10/ticket-clone-22.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-clone-22.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-clone-22.exp b/pengine/test10/ticket-clone-22.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-clone-22.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-22.scores b/pengine/test10/ticket-clone-22.scores +new file mode 100644 +index 0000000..89e2d0f +--- /dev/null ++++ b/pengine/test10/ticket-clone-22.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-22.xml b/pengine/test10/ticket-clone-22.xml +new file mode 100644 +index 0000000..cd32da4 +--- /dev/null ++++ b/pengine/test10/ticket-clone-22.xml +@@ -0,0 +1,57 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-23.dot b/pengine/test10/ticket-clone-23.dot +new file mode 100644 +index 0000000..1c04e6e +--- /dev/null ++++ b/pengine/test10/ticket-clone-23.dot +@@ -0,0 +1,16 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"clone1_stop_0" -> "clone1_stopped_0" [ style = bold] ++"clone1_stop_0" -> "rsc1:0_stop_0 node2" [ style = bold] ++"clone1_stop_0" -> "rsc1:1_stop_0 node1" [ style = bold] ++"clone1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"clone1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1:0_stop_0 node2" -> "clone1_stopped_0" [ style = bold] ++"rsc1:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc1:1_stop_0 node1" -> "clone1_stopped_0" [ style = bold] ++"rsc1:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-clone-23.exp b/pengine/test10/ticket-clone-23.exp +new file mode 100644 +index 0000000..a758892 +--- /dev/null ++++ b/pengine/test10/ticket-clone-23.exp +@@ -0,0 +1,86 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-23.scores b/pengine/test10/ticket-clone-23.scores +new file mode 100644 +index 0000000..89e2d0f +--- /dev/null ++++ b/pengine/test10/ticket-clone-23.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-23.xml b/pengine/test10/ticket-clone-23.xml +new file mode 100644 +index 0000000..f13ccf5 +--- /dev/null ++++ b/pengine/test10/ticket-clone-23.xml +@@ -0,0 +1,63 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-24.dot b/pengine/test10/ticket-clone-24.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-clone-24.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-clone-24.exp b/pengine/test10/ticket-clone-24.exp +new file mode 100644 +index 0000000..446bd6f +--- /dev/null ++++ b/pengine/test10/ticket-clone-24.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-clone-24.scores b/pengine/test10/ticket-clone-24.scores +new file mode 100644 +index 0000000..d311a38 +--- /dev/null ++++ b/pengine/test10/ticket-clone-24.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++clone_color: clone1 allocation score on node1: 0 ++clone_color: clone1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: 0 ++clone_color: rsc1:0 allocation score on node2: 1 ++clone_color: rsc1:1 allocation score on node1: 1 ++clone_color: rsc1:1 allocation score on node2: 0 ++native_color: rsc1:0 allocation score on node1: 0 ++native_color: rsc1:0 allocation score on node2: 1 ++native_color: rsc1:1 allocation score on node1: 1 ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-clone-24.xml b/pengine/test10/ticket-clone-24.xml +new file mode 100644 +index 0000000..96c1f63 +--- /dev/null ++++ b/pengine/test10/ticket-clone-24.xml +@@ -0,0 +1,63 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-13.dot b/pengine/test10/ticket-group-13.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-group-13.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-group-13.exp b/pengine/test10/ticket-group-13.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-group-13.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-13.scores b/pengine/test10/ticket-group-13.scores +new file mode 100644 +index 0000000..e5b8167 +--- /dev/null ++++ b/pengine/test10/ticket-group-13.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: -INFINITY ++group_color: rsc1 allocation score on node2: -INFINITY ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-13.xml b/pengine/test10/ticket-group-13.xml +new file mode 100644 +index 0000000..37c9fc3 +--- /dev/null ++++ b/pengine/test10/ticket-group-13.xml +@@ -0,0 +1,73 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-14.dot b/pengine/test10/ticket-group-14.dot +new file mode 100644 +index 0000000..f6e63d3 +--- /dev/null ++++ b/pengine/test10/ticket-group-14.dot +@@ -0,0 +1,17 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"group1_stop_0" -> "group1_stopped_0" [ style = bold] ++"group1_stop_0" -> "rsc1_stop_0 node2" [ style = bold] ++"group1_stop_0" -> "rsc2_stop_0 node2" [ style = bold] ++"group1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc2_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc2_stop_0 node2" -> "rsc1_stop_0 node2" [ style = bold] ++"rsc2_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-group-14.exp b/pengine/test10/ticket-group-14.exp +new file mode 100644 +index 0000000..94806e6 +--- /dev/null ++++ b/pengine/test10/ticket-group-14.exp +@@ -0,0 +1,89 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-14.scores b/pengine/test10/ticket-group-14.scores +new file mode 100644 +index 0000000..e5b8167 +--- /dev/null ++++ b/pengine/test10/ticket-group-14.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: -INFINITY ++group_color: rsc1 allocation score on node2: -INFINITY ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-14.xml b/pengine/test10/ticket-group-14.xml +new file mode 100644 +index 0000000..db5db0f +--- /dev/null ++++ b/pengine/test10/ticket-group-14.xml +@@ -0,0 +1,77 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-15.dot b/pengine/test10/ticket-group-15.dot +new file mode 100644 +index 0000000..f6e63d3 +--- /dev/null ++++ b/pengine/test10/ticket-group-15.dot +@@ -0,0 +1,17 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"group1_stop_0" -> "group1_stopped_0" [ style = bold] ++"group1_stop_0" -> "rsc1_stop_0 node2" [ style = bold] ++"group1_stop_0" -> "rsc2_stop_0 node2" [ style = bold] ++"group1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc2_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc2_stop_0 node2" -> "rsc1_stop_0 node2" [ style = bold] ++"rsc2_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-group-15.exp b/pengine/test10/ticket-group-15.exp +new file mode 100644 +index 0000000..94806e6 +--- /dev/null ++++ b/pengine/test10/ticket-group-15.exp +@@ -0,0 +1,89 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-15.scores b/pengine/test10/ticket-group-15.scores +new file mode 100644 +index 0000000..e5b8167 +--- /dev/null ++++ b/pengine/test10/ticket-group-15.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: -INFINITY ++group_color: rsc1 allocation score on node2: -INFINITY ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-15.xml b/pengine/test10/ticket-group-15.xml +new file mode 100644 +index 0000000..93f0c0f +--- /dev/null ++++ b/pengine/test10/ticket-group-15.xml +@@ -0,0 +1,77 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-16.dot b/pengine/test10/ticket-group-16.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-group-16.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-group-16.exp b/pengine/test10/ticket-group-16.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-group-16.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-16.scores b/pengine/test10/ticket-group-16.scores +new file mode 100644 +index 0000000..e5b8167 +--- /dev/null ++++ b/pengine/test10/ticket-group-16.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: -INFINITY ++group_color: rsc1 allocation score on node2: -INFINITY ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-16.xml b/pengine/test10/ticket-group-16.xml +new file mode 100644 +index 0000000..acfb56c +--- /dev/null ++++ b/pengine/test10/ticket-group-16.xml +@@ -0,0 +1,73 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-17.dot b/pengine/test10/ticket-group-17.dot +new file mode 100644 +index 0000000..f6e63d3 +--- /dev/null ++++ b/pengine/test10/ticket-group-17.dot +@@ -0,0 +1,17 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"group1_stop_0" -> "group1_stopped_0" [ style = bold] ++"group1_stop_0" -> "rsc1_stop_0 node2" [ style = bold] ++"group1_stop_0" -> "rsc2_stop_0 node2" [ style = bold] ++"group1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc2_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc2_stop_0 node2" -> "rsc1_stop_0 node2" [ style = bold] ++"rsc2_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-group-17.exp b/pengine/test10/ticket-group-17.exp +new file mode 100644 +index 0000000..94806e6 +--- /dev/null ++++ b/pengine/test10/ticket-group-17.exp +@@ -0,0 +1,89 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-17.scores b/pengine/test10/ticket-group-17.scores +new file mode 100644 +index 0000000..e5b8167 +--- /dev/null ++++ b/pengine/test10/ticket-group-17.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: -INFINITY ++group_color: rsc1 allocation score on node2: -INFINITY ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-17.xml b/pengine/test10/ticket-group-17.xml +new file mode 100644 +index 0000000..228cabd +--- /dev/null ++++ b/pengine/test10/ticket-group-17.xml +@@ -0,0 +1,77 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-18.dot b/pengine/test10/ticket-group-18.dot +new file mode 100644 +index 0000000..f6e63d3 +--- /dev/null ++++ b/pengine/test10/ticket-group-18.dot +@@ -0,0 +1,17 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"group1_stop_0" -> "group1_stopped_0" [ style = bold] ++"group1_stop_0" -> "rsc1_stop_0 node2" [ style = bold] ++"group1_stop_0" -> "rsc2_stop_0 node2" [ style = bold] ++"group1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc2_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc2_stop_0 node2" -> "rsc1_stop_0 node2" [ style = bold] ++"rsc2_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-group-18.exp b/pengine/test10/ticket-group-18.exp +new file mode 100644 +index 0000000..94806e6 +--- /dev/null ++++ b/pengine/test10/ticket-group-18.exp +@@ -0,0 +1,89 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-18.scores b/pengine/test10/ticket-group-18.scores +new file mode 100644 +index 0000000..e5b8167 +--- /dev/null ++++ b/pengine/test10/ticket-group-18.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: -INFINITY ++group_color: rsc1 allocation score on node2: -INFINITY ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-18.xml b/pengine/test10/ticket-group-18.xml +new file mode 100644 +index 0000000..d02e5ef +--- /dev/null ++++ b/pengine/test10/ticket-group-18.xml +@@ -0,0 +1,77 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-19.dot b/pengine/test10/ticket-group-19.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-group-19.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-group-19.exp b/pengine/test10/ticket-group-19.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-group-19.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-19.scores b/pengine/test10/ticket-group-19.scores +new file mode 100644 +index 0000000..e5b8167 +--- /dev/null ++++ b/pengine/test10/ticket-group-19.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: -INFINITY ++group_color: rsc1 allocation score on node2: -INFINITY ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-19.xml b/pengine/test10/ticket-group-19.xml +new file mode 100644 +index 0000000..557625c +--- /dev/null ++++ b/pengine/test10/ticket-group-19.xml +@@ -0,0 +1,73 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-20.dot b/pengine/test10/ticket-group-20.dot +new file mode 100644 +index 0000000..f6e63d3 +--- /dev/null ++++ b/pengine/test10/ticket-group-20.dot +@@ -0,0 +1,17 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"group1_stop_0" -> "group1_stopped_0" [ style = bold] ++"group1_stop_0" -> "rsc1_stop_0 node2" [ style = bold] ++"group1_stop_0" -> "rsc2_stop_0 node2" [ style = bold] ++"group1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc2_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc2_stop_0 node2" -> "rsc1_stop_0 node2" [ style = bold] ++"rsc2_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-group-20.exp b/pengine/test10/ticket-group-20.exp +new file mode 100644 +index 0000000..94806e6 +--- /dev/null ++++ b/pengine/test10/ticket-group-20.exp +@@ -0,0 +1,89 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-20.scores b/pengine/test10/ticket-group-20.scores +new file mode 100644 +index 0000000..e5b8167 +--- /dev/null ++++ b/pengine/test10/ticket-group-20.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: -INFINITY ++group_color: rsc1 allocation score on node2: -INFINITY ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-20.xml b/pengine/test10/ticket-group-20.xml +new file mode 100644 +index 0000000..51624f2 +--- /dev/null ++++ b/pengine/test10/ticket-group-20.xml +@@ -0,0 +1,77 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-21.dot b/pengine/test10/ticket-group-21.dot +new file mode 100644 +index 0000000..9ebd732 +--- /dev/null ++++ b/pengine/test10/ticket-group-21.dot +@@ -0,0 +1,28 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"group1_stop_0" -> "group1_stopped_0" [ style = bold] ++"group1_stop_0" -> "rsc1_stop_0 node2" [ style = bold] ++"group1_stop_0" -> "rsc2_stop_0 node2" [ style = bold] ++"group1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="orange"] ++"rsc2_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc2_stop_0 node2" -> "rsc1_stop_0 node2" [ style = bold] ++"rsc2_stop_0 node2" [ style=bold color="green" fontcolor="orange"] ++"stonith node2" -> "all_stopped" [ style = bold] ++"stonith node2" -> "group1_stop_0" [ style = bold] ++"stonith node2" -> "rsc1_stop_0 node2" [ style = bold] ++"stonith node2" -> "rsc2_stop_0 node2" [ style = bold] ++"stonith node2" -> "stonith_complete" [ style = bold] ++"stonith node2" [ style=bold color="green" fontcolor="black"] ++"stonith_complete" -> "rsc1_stop_0 node2" [ style = bold] ++"stonith_complete" -> "rsc2_stop_0 node2" [ style = bold] ++"stonith_complete" [ style=bold color="green" fontcolor="orange"] ++"stonith_up" -> "stonith node2" [ style = bold] ++"stonith_up" -> "stonith_complete" [ style = bold] ++"stonith_up" [ style=bold color="green" fontcolor="orange"] ++} +diff --git a/pengine/test10/ticket-group-21.exp b/pengine/test10/ticket-group-21.exp +new file mode 100644 +index 0000000..ffec329 +--- /dev/null ++++ b/pengine/test10/ticket-group-21.exp +@@ -0,0 +1,133 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-21.scores b/pengine/test10/ticket-group-21.scores +new file mode 100644 +index 0000000..e5b8167 +--- /dev/null ++++ b/pengine/test10/ticket-group-21.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: -INFINITY ++group_color: rsc1 allocation score on node2: -INFINITY ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-21.xml b/pengine/test10/ticket-group-21.xml +new file mode 100644 +index 0000000..a5627df +--- /dev/null ++++ b/pengine/test10/ticket-group-21.xml +@@ -0,0 +1,77 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-22.dot b/pengine/test10/ticket-group-22.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-group-22.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-group-22.exp b/pengine/test10/ticket-group-22.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-group-22.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-22.scores b/pengine/test10/ticket-group-22.scores +new file mode 100644 +index 0000000..e5b8167 +--- /dev/null ++++ b/pengine/test10/ticket-group-22.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: -INFINITY ++group_color: rsc1 allocation score on node2: -INFINITY ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-22.xml b/pengine/test10/ticket-group-22.xml +new file mode 100644 +index 0000000..9910339 +--- /dev/null ++++ b/pengine/test10/ticket-group-22.xml +@@ -0,0 +1,73 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-23.dot b/pengine/test10/ticket-group-23.dot +new file mode 100644 +index 0000000..f6e63d3 +--- /dev/null ++++ b/pengine/test10/ticket-group-23.dot +@@ -0,0 +1,17 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"group1_stop_0" -> "group1_stopped_0" [ style = bold] ++"group1_stop_0" -> "rsc1_stop_0 node2" [ style = bold] ++"group1_stop_0" -> "rsc2_stop_0 node2" [ style = bold] ++"group1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc2_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node2" -> "group1_stopped_0" [ style = bold] ++"rsc2_stop_0 node2" -> "rsc1_stop_0 node2" [ style = bold] ++"rsc2_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-group-23.exp b/pengine/test10/ticket-group-23.exp +new file mode 100644 +index 0000000..94806e6 +--- /dev/null ++++ b/pengine/test10/ticket-group-23.exp +@@ -0,0 +1,89 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-23.scores b/pengine/test10/ticket-group-23.scores +new file mode 100644 +index 0000000..e5b8167 +--- /dev/null ++++ b/pengine/test10/ticket-group-23.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: -INFINITY ++group_color: rsc1 allocation score on node2: -INFINITY ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-23.xml b/pengine/test10/ticket-group-23.xml +new file mode 100644 +index 0000000..fd5fa24 +--- /dev/null ++++ b/pengine/test10/ticket-group-23.xml +@@ -0,0 +1,77 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-24.dot b/pengine/test10/ticket-group-24.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-group-24.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-group-24.exp b/pengine/test10/ticket-group-24.exp +new file mode 100644 +index 0000000..446bd6f +--- /dev/null ++++ b/pengine/test10/ticket-group-24.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-group-24.scores b/pengine/test10/ticket-group-24.scores +new file mode 100644 +index 0000000..8078251 +--- /dev/null ++++ b/pengine/test10/ticket-group-24.scores +@@ -0,0 +1,13 @@ ++Allocation scores: ++group_color: group1 allocation score on node1: 0 ++group_color: group1 allocation score on node2: 0 ++group_color: rsc1 allocation score on node1: 0 ++group_color: rsc1 allocation score on node2: 0 ++group_color: rsc2 allocation score on node1: 0 ++group_color: rsc2 allocation score on node2: 0 ++native_color: rsc1 allocation score on node1: 0 ++native_color: rsc1 allocation score on node2: 0 ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: 0 ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-group-24.xml b/pengine/test10/ticket-group-24.xml +new file mode 100644 +index 0000000..b21c49f +--- /dev/null ++++ b/pengine/test10/ticket-group-24.xml +@@ -0,0 +1,77 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-13.dot b/pengine/test10/ticket-master-13.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-master-13.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-master-13.exp b/pengine/test10/ticket-master-13.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-master-13.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-13.scores b/pengine/test10/ticket-master-13.scores +new file mode 100644 +index 0000000..23d58d8 +--- /dev/null ++++ b/pengine/test10/ticket-master-13.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on none: 0 ++rsc1:1 promotion score on none: 0 +diff --git a/pengine/test10/ticket-master-13.xml b/pengine/test10/ticket-master-13.xml +new file mode 100644 +index 0000000..6972260 +--- /dev/null ++++ b/pengine/test10/ticket-master-13.xml +@@ -0,0 +1,63 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-14.dot b/pengine/test10/ticket-master-14.dot +new file mode 100644 +index 0000000..7d91426 +--- /dev/null ++++ b/pengine/test10/ticket-master-14.dot +@@ -0,0 +1,24 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"ms1_demote_0" -> "ms1_demoted_0" [ style = bold] ++"ms1_demote_0" -> "rsc1:1_demote_0 node1" [ style = bold] ++"ms1_demote_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_demoted_0" -> "ms1_stop_0" [ style = bold] ++"ms1_demoted_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_stop_0" -> "ms1_stopped_0" [ style = bold] ++"ms1_stop_0" -> "rsc1:0_stop_0 node2" [ style = bold] ++"ms1_stop_0" -> "rsc1:1_stop_0 node1" [ style = bold] ++"ms1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1:0_stop_0 node2" -> "ms1_stopped_0" [ style = bold] ++"rsc1:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_demote_0 node1" -> "ms1_demoted_0" [ style = bold] ++"rsc1:1_demote_0 node1" -> "rsc1:1_stop_0 node1" [ style = bold] ++"rsc1:1_demote_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc1:1_stop_0 node1" -> "ms1_stopped_0" [ style = bold] ++"rsc1:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-master-14.exp b/pengine/test10/ticket-master-14.exp +new file mode 100644 +index 0000000..a478fb8 +--- /dev/null ++++ b/pengine/test10/ticket-master-14.exp +@@ -0,0 +1,129 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-14.scores b/pengine/test10/ticket-master-14.scores +new file mode 100644 +index 0000000..23d58d8 +--- /dev/null ++++ b/pengine/test10/ticket-master-14.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on none: 0 ++rsc1:1 promotion score on none: 0 +diff --git a/pengine/test10/ticket-master-14.xml b/pengine/test10/ticket-master-14.xml +new file mode 100644 +index 0000000..77800fa +--- /dev/null ++++ b/pengine/test10/ticket-master-14.xml +@@ -0,0 +1,68 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-15.dot b/pengine/test10/ticket-master-15.dot +new file mode 100644 +index 0000000..7d91426 +--- /dev/null ++++ b/pengine/test10/ticket-master-15.dot +@@ -0,0 +1,24 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"ms1_demote_0" -> "ms1_demoted_0" [ style = bold] ++"ms1_demote_0" -> "rsc1:1_demote_0 node1" [ style = bold] ++"ms1_demote_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_demoted_0" -> "ms1_stop_0" [ style = bold] ++"ms1_demoted_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_stop_0" -> "ms1_stopped_0" [ style = bold] ++"ms1_stop_0" -> "rsc1:0_stop_0 node2" [ style = bold] ++"ms1_stop_0" -> "rsc1:1_stop_0 node1" [ style = bold] ++"ms1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1:0_stop_0 node2" -> "ms1_stopped_0" [ style = bold] ++"rsc1:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_demote_0 node1" -> "ms1_demoted_0" [ style = bold] ++"rsc1:1_demote_0 node1" -> "rsc1:1_stop_0 node1" [ style = bold] ++"rsc1:1_demote_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc1:1_stop_0 node1" -> "ms1_stopped_0" [ style = bold] ++"rsc1:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-master-15.exp b/pengine/test10/ticket-master-15.exp +new file mode 100644 +index 0000000..a478fb8 +--- /dev/null ++++ b/pengine/test10/ticket-master-15.exp +@@ -0,0 +1,129 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-15.scores b/pengine/test10/ticket-master-15.scores +new file mode 100644 +index 0000000..23d58d8 +--- /dev/null ++++ b/pengine/test10/ticket-master-15.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: -INFINITY ++clone_color: rsc1:0 allocation score on node2: -INFINITY ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: -INFINITY ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on none: 0 ++rsc1:1 promotion score on none: 0 +diff --git a/pengine/test10/ticket-master-15.xml b/pengine/test10/ticket-master-15.xml +new file mode 100644 +index 0000000..7c47782 +--- /dev/null ++++ b/pengine/test10/ticket-master-15.xml +@@ -0,0 +1,68 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-16.dot b/pengine/test10/ticket-master-16.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-master-16.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-master-16.exp b/pengine/test10/ticket-master-16.exp +new file mode 100644 +index 0000000..446bd6f +--- /dev/null ++++ b/pengine/test10/ticket-master-16.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-16.scores b/pengine/test10/ticket-master-16.scores +new file mode 100644 +index 0000000..3e4f30f +--- /dev/null ++++ b/pengine/test10/ticket-master-16.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: 0 ++clone_color: rsc1:0 allocation score on node2: 1 ++clone_color: rsc1:1 allocation score on node1: 1 ++clone_color: rsc1:1 allocation score on node2: 0 ++native_color: rsc1:0 allocation score on node1: 0 ++native_color: rsc1:0 allocation score on node2: 1 ++native_color: rsc1:1 allocation score on node1: 1 ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on node2: -1 ++rsc1:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-master-16.xml b/pengine/test10/ticket-master-16.xml +new file mode 100644 +index 0000000..2e7452f +--- /dev/null ++++ b/pengine/test10/ticket-master-16.xml +@@ -0,0 +1,67 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-17.dot b/pengine/test10/ticket-master-17.dot +new file mode 100644 +index 0000000..4755871 +--- /dev/null ++++ b/pengine/test10/ticket-master-17.dot +@@ -0,0 +1,10 @@ ++digraph "g" { ++"ms1_demote_0" -> "ms1_demoted_0" [ style = bold] ++"ms1_demote_0" -> "rsc1:1_demote_0 node1" [ style = bold] ++"ms1_demote_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_demoted_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_demote_0 node1" -> "ms1_demoted_0" [ style = bold] ++"rsc1:1_demote_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-master-17.exp b/pengine/test10/ticket-master-17.exp +new file mode 100644 +index 0000000..c36f0f1 +--- /dev/null ++++ b/pengine/test10/ticket-master-17.exp +@@ -0,0 +1,55 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-17.scores b/pengine/test10/ticket-master-17.scores +new file mode 100644 +index 0000000..3e4f30f +--- /dev/null ++++ b/pengine/test10/ticket-master-17.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: 0 ++clone_color: rsc1:0 allocation score on node2: 1 ++clone_color: rsc1:1 allocation score on node1: 1 ++clone_color: rsc1:1 allocation score on node2: 0 ++native_color: rsc1:0 allocation score on node1: 0 ++native_color: rsc1:0 allocation score on node2: 1 ++native_color: rsc1:1 allocation score on node1: 1 ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on node2: -1 ++rsc1:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-master-17.xml b/pengine/test10/ticket-master-17.xml +new file mode 100644 +index 0000000..d28bb83 +--- /dev/null ++++ b/pengine/test10/ticket-master-17.xml +@@ -0,0 +1,68 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-18.dot b/pengine/test10/ticket-master-18.dot +new file mode 100644 +index 0000000..4755871 +--- /dev/null ++++ b/pengine/test10/ticket-master-18.dot +@@ -0,0 +1,10 @@ ++digraph "g" { ++"ms1_demote_0" -> "ms1_demoted_0" [ style = bold] ++"ms1_demote_0" -> "rsc1:1_demote_0 node1" [ style = bold] ++"ms1_demote_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_demoted_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_demote_0 node1" -> "ms1_demoted_0" [ style = bold] ++"rsc1:1_demote_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-master-18.exp b/pengine/test10/ticket-master-18.exp +new file mode 100644 +index 0000000..c36f0f1 +--- /dev/null ++++ b/pengine/test10/ticket-master-18.exp +@@ -0,0 +1,55 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-18.scores b/pengine/test10/ticket-master-18.scores +new file mode 100644 +index 0000000..3e4f30f +--- /dev/null ++++ b/pengine/test10/ticket-master-18.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: 0 ++clone_color: rsc1:0 allocation score on node2: 1 ++clone_color: rsc1:1 allocation score on node1: 1 ++clone_color: rsc1:1 allocation score on node2: 0 ++native_color: rsc1:0 allocation score on node1: 0 ++native_color: rsc1:0 allocation score on node2: 1 ++native_color: rsc1:1 allocation score on node1: 1 ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on node2: -1 ++rsc1:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-master-18.xml b/pengine/test10/ticket-master-18.xml +new file mode 100644 +index 0000000..e13eab2 +--- /dev/null ++++ b/pengine/test10/ticket-master-18.xml +@@ -0,0 +1,68 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-19.dot b/pengine/test10/ticket-master-19.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-master-19.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-master-19.exp b/pengine/test10/ticket-master-19.exp +new file mode 100644 +index 0000000..446bd6f +--- /dev/null ++++ b/pengine/test10/ticket-master-19.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-19.scores b/pengine/test10/ticket-master-19.scores +new file mode 100644 +index 0000000..3e4f30f +--- /dev/null ++++ b/pengine/test10/ticket-master-19.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: 0 ++clone_color: rsc1:0 allocation score on node2: 1 ++clone_color: rsc1:1 allocation score on node1: 1 ++clone_color: rsc1:1 allocation score on node2: 0 ++native_color: rsc1:0 allocation score on node1: 0 ++native_color: rsc1:0 allocation score on node2: 1 ++native_color: rsc1:1 allocation score on node1: 1 ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on node2: -1 ++rsc1:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-master-19.xml b/pengine/test10/ticket-master-19.xml +new file mode 100644 +index 0000000..67e41a0 +--- /dev/null ++++ b/pengine/test10/ticket-master-19.xml +@@ -0,0 +1,67 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-20.dot b/pengine/test10/ticket-master-20.dot +new file mode 100644 +index 0000000..4755871 +--- /dev/null ++++ b/pengine/test10/ticket-master-20.dot +@@ -0,0 +1,10 @@ ++digraph "g" { ++"ms1_demote_0" -> "ms1_demoted_0" [ style = bold] ++"ms1_demote_0" -> "rsc1:1_demote_0 node1" [ style = bold] ++"ms1_demote_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_demoted_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_demote_0 node1" -> "ms1_demoted_0" [ style = bold] ++"rsc1:1_demote_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-master-20.exp b/pengine/test10/ticket-master-20.exp +new file mode 100644 +index 0000000..c36f0f1 +--- /dev/null ++++ b/pengine/test10/ticket-master-20.exp +@@ -0,0 +1,55 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-20.scores b/pengine/test10/ticket-master-20.scores +new file mode 100644 +index 0000000..3e4f30f +--- /dev/null ++++ b/pengine/test10/ticket-master-20.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: 0 ++clone_color: rsc1:0 allocation score on node2: 1 ++clone_color: rsc1:1 allocation score on node1: 1 ++clone_color: rsc1:1 allocation score on node2: 0 ++native_color: rsc1:0 allocation score on node1: 0 ++native_color: rsc1:0 allocation score on node2: 1 ++native_color: rsc1:1 allocation score on node1: 1 ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on node2: -1 ++rsc1:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-master-20.xml b/pengine/test10/ticket-master-20.xml +new file mode 100644 +index 0000000..876c15d +--- /dev/null ++++ b/pengine/test10/ticket-master-20.xml +@@ -0,0 +1,68 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-21.dot b/pengine/test10/ticket-master-21.dot +new file mode 100644 +index 0000000..587b220 +--- /dev/null ++++ b/pengine/test10/ticket-master-21.dot +@@ -0,0 +1,31 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"ms1_demote_0" -> "ms1_demoted_0" [ style = bold] ++"ms1_demote_0" -> "rsc1:1_demote_0 node1" [ style = bold] ++"ms1_demote_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_demoted_0" -> "ms1_stop_0" [ style = bold] ++"ms1_demoted_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_stop_0" -> "ms1_stopped_0" [ style = bold] ++"ms1_stop_0" -> "rsc1:1_stop_0 node1" [ style = bold] ++"ms1_stop_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_demote_0 node1" -> "ms1_demoted_0" [ style = bold] ++"rsc1:1_demote_0 node1" -> "rsc1:1_stop_0 node1" [ style = bold] ++"rsc1:1_demote_0 node1" [ style=bold color="green" fontcolor="orange"] ++"rsc1:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc1:1_stop_0 node1" -> "ms1_stopped_0" [ style = bold] ++"rsc1:1_stop_0 node1" [ style=bold color="green" fontcolor="orange"] ++"stonith node1" -> "all_stopped" [ style = bold] ++"stonith node1" -> "ms1_stop_0" [ style = bold] ++"stonith node1" -> "rsc1:1_demote_0 node1" [ style = bold] ++"stonith node1" -> "rsc1:1_stop_0 node1" [ style = bold] ++"stonith node1" -> "stonith_complete" [ style = bold] ++"stonith node1" [ style=bold color="green" fontcolor="black"] ++"stonith_complete" -> "rsc1:1_demote_0 node1" [ style = bold] ++"stonith_complete" -> "rsc1:1_stop_0 node1" [ style = bold] ++"stonith_complete" [ style=bold color="green" fontcolor="orange"] ++"stonith_up" -> "stonith node1" [ style = bold] ++"stonith_up" -> "stonith_complete" [ style = bold] ++"stonith_up" [ style=bold color="green" fontcolor="orange"] ++} +diff --git a/pengine/test10/ticket-master-21.exp b/pengine/test10/ticket-master-21.exp +new file mode 100644 +index 0000000..3e82468 +--- /dev/null ++++ b/pengine/test10/ticket-master-21.exp +@@ -0,0 +1,153 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-21.scores b/pengine/test10/ticket-master-21.scores +new file mode 100644 +index 0000000..fcd7fd9 +--- /dev/null ++++ b/pengine/test10/ticket-master-21.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: 0 ++clone_color: rsc1:0 allocation score on node2: 1 ++clone_color: rsc1:1 allocation score on node1: -INFINITY ++clone_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc1:0 allocation score on node1: -INFINITY ++native_color: rsc1:0 allocation score on node2: 1 ++native_color: rsc1:1 allocation score on node1: -INFINITY ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on node2: -1 ++rsc1:1 promotion score on none: 0 +diff --git a/pengine/test10/ticket-master-21.xml b/pengine/test10/ticket-master-21.xml +new file mode 100644 +index 0000000..012c850 +--- /dev/null ++++ b/pengine/test10/ticket-master-21.xml +@@ -0,0 +1,68 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-22.dot b/pengine/test10/ticket-master-22.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-master-22.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-master-22.exp b/pengine/test10/ticket-master-22.exp +new file mode 100644 +index 0000000..446bd6f +--- /dev/null ++++ b/pengine/test10/ticket-master-22.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-22.scores b/pengine/test10/ticket-master-22.scores +new file mode 100644 +index 0000000..3e4f30f +--- /dev/null ++++ b/pengine/test10/ticket-master-22.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: 0 ++clone_color: rsc1:0 allocation score on node2: 1 ++clone_color: rsc1:1 allocation score on node1: 1 ++clone_color: rsc1:1 allocation score on node2: 0 ++native_color: rsc1:0 allocation score on node1: 0 ++native_color: rsc1:0 allocation score on node2: 1 ++native_color: rsc1:1 allocation score on node1: 1 ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on node2: -1 ++rsc1:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-master-22.xml b/pengine/test10/ticket-master-22.xml +new file mode 100644 +index 0000000..781edf7 +--- /dev/null ++++ b/pengine/test10/ticket-master-22.xml +@@ -0,0 +1,67 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-23.dot b/pengine/test10/ticket-master-23.dot +new file mode 100644 +index 0000000..4755871 +--- /dev/null ++++ b/pengine/test10/ticket-master-23.dot +@@ -0,0 +1,10 @@ ++digraph "g" { ++"ms1_demote_0" -> "ms1_demoted_0" [ style = bold] ++"ms1_demote_0" -> "rsc1:1_demote_0 node1" [ style = bold] ++"ms1_demote_0" [ style=bold color="green" fontcolor="orange"] ++"ms1_demoted_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1:1_demote_0 node1" -> "ms1_demoted_0" [ style = bold] ++"rsc1:1_demote_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-master-23.exp b/pengine/test10/ticket-master-23.exp +new file mode 100644 +index 0000000..c36f0f1 +--- /dev/null ++++ b/pengine/test10/ticket-master-23.exp +@@ -0,0 +1,55 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-23.scores b/pengine/test10/ticket-master-23.scores +new file mode 100644 +index 0000000..3e4f30f +--- /dev/null ++++ b/pengine/test10/ticket-master-23.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: 0 ++clone_color: rsc1:0 allocation score on node2: 1 ++clone_color: rsc1:1 allocation score on node1: 1 ++clone_color: rsc1:1 allocation score on node2: 0 ++native_color: rsc1:0 allocation score on node1: 0 ++native_color: rsc1:0 allocation score on node2: 1 ++native_color: rsc1:1 allocation score on node1: 1 ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on node2: -1 ++rsc1:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-master-23.xml b/pengine/test10/ticket-master-23.xml +new file mode 100644 +index 0000000..dce636b +--- /dev/null ++++ b/pengine/test10/ticket-master-23.xml +@@ -0,0 +1,68 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-24.dot b/pengine/test10/ticket-master-24.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-master-24.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-master-24.exp b/pengine/test10/ticket-master-24.exp +new file mode 100644 +index 0000000..446bd6f +--- /dev/null ++++ b/pengine/test10/ticket-master-24.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-master-24.scores b/pengine/test10/ticket-master-24.scores +new file mode 100644 +index 0000000..32ce4de +--- /dev/null ++++ b/pengine/test10/ticket-master-24.scores +@@ -0,0 +1,15 @@ ++Allocation scores: ++clone_color: ms1 allocation score on node1: 0 ++clone_color: ms1 allocation score on node2: 0 ++clone_color: rsc1:0 allocation score on node1: 0 ++clone_color: rsc1:0 allocation score on node2: 1 ++clone_color: rsc1:1 allocation score on node1: 1 ++clone_color: rsc1:1 allocation score on node2: 0 ++native_color: rsc1:0 allocation score on node1: 0 ++native_color: rsc1:0 allocation score on node2: 1 ++native_color: rsc1:1 allocation score on node1: 1 ++native_color: rsc1:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc1:0 promotion score on node2: -1 ++rsc1:1 promotion score on node1: INFINITY +diff --git a/pengine/test10/ticket-master-24.xml b/pengine/test10/ticket-master-24.xml +new file mode 100644 +index 0000000..bc469b7 +--- /dev/null ++++ b/pengine/test10/ticket-master-24.xml +@@ -0,0 +1,68 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-13.dot b/pengine/test10/ticket-primitive-13.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-primitive-13.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-primitive-13.exp b/pengine/test10/ticket-primitive-13.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-13.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-13.scores b/pengine/test10/ticket-primitive-13.scores +new file mode 100644 +index 0000000..ed3f3cd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-13.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-13.xml b/pengine/test10/ticket-primitive-13.xml +new file mode 100644 +index 0000000..3116a31 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-13.xml +@@ -0,0 +1,58 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-14.dot b/pengine/test10/ticket-primitive-14.dot +new file mode 100644 +index 0000000..b574b73 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-14.dot +@@ -0,0 +1,7 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-primitive-14.exp b/pengine/test10/ticket-primitive-14.exp +new file mode 100644 +index 0000000..209e4fd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-14.exp +@@ -0,0 +1,40 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-14.scores b/pengine/test10/ticket-primitive-14.scores +new file mode 100644 +index 0000000..ed3f3cd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-14.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-14.xml b/pengine/test10/ticket-primitive-14.xml +new file mode 100644 +index 0000000..045a84d +--- /dev/null ++++ b/pengine/test10/ticket-primitive-14.xml +@@ -0,0 +1,60 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-15.dot b/pengine/test10/ticket-primitive-15.dot +new file mode 100644 +index 0000000..b574b73 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-15.dot +@@ -0,0 +1,7 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-primitive-15.exp b/pengine/test10/ticket-primitive-15.exp +new file mode 100644 +index 0000000..209e4fd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-15.exp +@@ -0,0 +1,40 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-15.scores b/pengine/test10/ticket-primitive-15.scores +new file mode 100644 +index 0000000..ed3f3cd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-15.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-15.xml b/pengine/test10/ticket-primitive-15.xml +new file mode 100644 +index 0000000..f289844 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-15.xml +@@ -0,0 +1,60 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-16.dot b/pengine/test10/ticket-primitive-16.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-primitive-16.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-primitive-16.exp b/pengine/test10/ticket-primitive-16.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-16.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-16.scores b/pengine/test10/ticket-primitive-16.scores +new file mode 100644 +index 0000000..ed3f3cd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-16.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-16.xml b/pengine/test10/ticket-primitive-16.xml +new file mode 100644 +index 0000000..593c0cb +--- /dev/null ++++ b/pengine/test10/ticket-primitive-16.xml +@@ -0,0 +1,58 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-17.dot b/pengine/test10/ticket-primitive-17.dot +new file mode 100644 +index 0000000..b574b73 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-17.dot +@@ -0,0 +1,7 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-primitive-17.exp b/pengine/test10/ticket-primitive-17.exp +new file mode 100644 +index 0000000..209e4fd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-17.exp +@@ -0,0 +1,40 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-17.scores b/pengine/test10/ticket-primitive-17.scores +new file mode 100644 +index 0000000..ed3f3cd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-17.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-17.xml b/pengine/test10/ticket-primitive-17.xml +new file mode 100644 +index 0000000..7d89152 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-17.xml +@@ -0,0 +1,60 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-18.dot b/pengine/test10/ticket-primitive-18.dot +new file mode 100644 +index 0000000..b574b73 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-18.dot +@@ -0,0 +1,7 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-primitive-18.exp b/pengine/test10/ticket-primitive-18.exp +new file mode 100644 +index 0000000..209e4fd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-18.exp +@@ -0,0 +1,40 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-18.scores b/pengine/test10/ticket-primitive-18.scores +new file mode 100644 +index 0000000..ed3f3cd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-18.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-18.xml b/pengine/test10/ticket-primitive-18.xml +new file mode 100644 +index 0000000..dba34a2 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-18.xml +@@ -0,0 +1,60 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-19.dot b/pengine/test10/ticket-primitive-19.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-primitive-19.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-primitive-19.exp b/pengine/test10/ticket-primitive-19.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-19.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-19.scores b/pengine/test10/ticket-primitive-19.scores +new file mode 100644 +index 0000000..ed3f3cd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-19.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-19.xml b/pengine/test10/ticket-primitive-19.xml +new file mode 100644 +index 0000000..339d76a +--- /dev/null ++++ b/pengine/test10/ticket-primitive-19.xml +@@ -0,0 +1,58 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-20.dot b/pengine/test10/ticket-primitive-20.dot +new file mode 100644 +index 0000000..b574b73 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-20.dot +@@ -0,0 +1,7 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-primitive-20.exp b/pengine/test10/ticket-primitive-20.exp +new file mode 100644 +index 0000000..209e4fd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-20.exp +@@ -0,0 +1,40 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-20.scores b/pengine/test10/ticket-primitive-20.scores +new file mode 100644 +index 0000000..ed3f3cd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-20.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-20.xml b/pengine/test10/ticket-primitive-20.xml +new file mode 100644 +index 0000000..c21a4ab +--- /dev/null ++++ b/pengine/test10/ticket-primitive-20.xml +@@ -0,0 +1,60 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-21.dot b/pengine/test10/ticket-primitive-21.dot +new file mode 100644 +index 0000000..430f75f +--- /dev/null ++++ b/pengine/test10/ticket-primitive-21.dot +@@ -0,0 +1,15 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="orange"] ++"stonith node2" -> "all_stopped" [ style = bold] ++"stonith node2" -> "rsc1_stop_0 node2" [ style = bold] ++"stonith node2" -> "stonith_complete" [ style = bold] ++"stonith node2" [ style=bold color="green" fontcolor="black"] ++"stonith_complete" -> "rsc1_stop_0 node2" [ style = bold] ++"stonith_complete" [ style=bold color="green" fontcolor="orange"] ++"stonith_up" -> "stonith node2" [ style = bold] ++"stonith_up" -> "stonith_complete" [ style = bold] ++"stonith_up" [ style=bold color="green" fontcolor="orange"] ++} +diff --git a/pengine/test10/ticket-primitive-21.exp b/pengine/test10/ticket-primitive-21.exp +new file mode 100644 +index 0000000..424bd27 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-21.exp +@@ -0,0 +1,76 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-21.scores b/pengine/test10/ticket-primitive-21.scores +new file mode 100644 +index 0000000..ed3f3cd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-21.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-21.xml b/pengine/test10/ticket-primitive-21.xml +new file mode 100644 +index 0000000..3a9540e +--- /dev/null ++++ b/pengine/test10/ticket-primitive-21.xml +@@ -0,0 +1,60 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-22.dot b/pengine/test10/ticket-primitive-22.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-primitive-22.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-primitive-22.exp b/pengine/test10/ticket-primitive-22.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-22.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-22.scores b/pengine/test10/ticket-primitive-22.scores +new file mode 100644 +index 0000000..ed3f3cd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-22.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-22.xml b/pengine/test10/ticket-primitive-22.xml +new file mode 100644 +index 0000000..10d0e39 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-22.xml +@@ -0,0 +1,58 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-23.dot b/pengine/test10/ticket-primitive-23.dot +new file mode 100644 +index 0000000..b574b73 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-23.dot +@@ -0,0 +1,7 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-primitive-23.exp b/pengine/test10/ticket-primitive-23.exp +new file mode 100644 +index 0000000..209e4fd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-23.exp +@@ -0,0 +1,40 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-23.scores b/pengine/test10/ticket-primitive-23.scores +new file mode 100644 +index 0000000..ed3f3cd +--- /dev/null ++++ b/pengine/test10/ticket-primitive-23.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-23.xml b/pengine/test10/ticket-primitive-23.xml +new file mode 100644 +index 0000000..2b52181 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-23.xml +@@ -0,0 +1,60 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-24.dot b/pengine/test10/ticket-primitive-24.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-primitive-24.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-primitive-24.exp b/pengine/test10/ticket-primitive-24.exp +new file mode 100644 +index 0000000..4065c3f +--- /dev/null ++++ b/pengine/test10/ticket-primitive-24.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-primitive-24.scores b/pengine/test10/ticket-primitive-24.scores +new file mode 100644 +index 0000000..5c5889b +--- /dev/null ++++ b/pengine/test10/ticket-primitive-24.scores +@@ -0,0 +1,5 @@ ++Allocation scores: ++native_color: rsc1 allocation score on node1: 0 ++native_color: rsc1 allocation score on node2: 0 ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 +diff --git a/pengine/test10/ticket-primitive-24.xml b/pengine/test10/ticket-primitive-24.xml +new file mode 100644 +index 0000000..1d33903 +--- /dev/null ++++ b/pengine/test10/ticket-primitive-24.xml +@@ -0,0 +1,60 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-10.dot b/pengine/test10/ticket-rsc-sets-10.dot +new file mode 100644 +index 0000000..369aacd +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-10.dot +@@ -0,0 +1,36 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"clone4_stop_0" -> "clone4_stopped_0" [ style = bold] ++"clone4_stop_0" -> "rsc4:0_stop_0 node2" [ style = bold] ++"clone4_stop_0" -> "rsc4:1_stop_0 node1" [ style = bold] ++"clone4_stop_0" [ style=bold color="green" fontcolor="orange"] ++"clone4_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"group2_stop_0" -> "group2_stopped_0" [ style = bold] ++"group2_stop_0" -> "rsc2_stop_0 node1" [ style = bold] ++"group2_stop_0" -> "rsc3_stop_0 node1" [ style = bold] ++"group2_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group2_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"ms5_demote_0" -> "ms5_demoted_0" [ style = bold] ++"ms5_demote_0" -> "rsc5:1_demote_0 node1" [ style = bold] ++"ms5_demote_0" [ style=bold color="green" fontcolor="orange"] ++"ms5_demoted_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc2_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node1" -> "group2_stopped_0" [ style = bold] ++"rsc2_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc3_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc3_stop_0 node1" -> "group2_stopped_0" [ style = bold] ++"rsc3_stop_0 node1" -> "rsc2_stop_0 node1" [ style = bold] ++"rsc3_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc4:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc4:0_stop_0 node2" -> "clone4_stopped_0" [ style = bold] ++"rsc4:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc4:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc4:1_stop_0 node1" -> "clone4_stopped_0" [ style = bold] ++"rsc4:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc5:1_demote_0 node1" -> "ms5_demoted_0" [ style = bold] ++"rsc5:1_demote_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-rsc-sets-10.exp b/pengine/test10/ticket-rsc-sets-10.exp +new file mode 100644 +index 0000000..b8278ba +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-10.exp +@@ -0,0 +1,195 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-10.scores b/pengine/test10/ticket-rsc-sets-10.scores +new file mode 100644 +index 0000000..4fd8101 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-10.scores +@@ -0,0 +1,37 @@ ++Allocation scores: ++clone_color: clone4 allocation score on node1: 0 ++clone_color: clone4 allocation score on node2: 0 ++clone_color: ms5 allocation score on node1: 0 ++clone_color: ms5 allocation score on node2: 0 ++clone_color: rsc4:0 allocation score on node1: -INFINITY ++clone_color: rsc4:0 allocation score on node2: -INFINITY ++clone_color: rsc4:1 allocation score on node1: -INFINITY ++clone_color: rsc4:1 allocation score on node2: -INFINITY ++clone_color: rsc5:0 allocation score on node1: 0 ++clone_color: rsc5:0 allocation score on node2: 1 ++clone_color: rsc5:1 allocation score on node1: 1 ++clone_color: rsc5:1 allocation score on node2: 0 ++group_color: group2 allocation score on node1: 0 ++group_color: group2 allocation score on node2: 0 ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++group_color: rsc3 allocation score on node1: -INFINITY ++group_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc3 allocation score on node1: -INFINITY ++native_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc4:0 allocation score on node1: -INFINITY ++native_color: rsc4:0 allocation score on node2: -INFINITY ++native_color: rsc4:1 allocation score on node1: -INFINITY ++native_color: rsc4:1 allocation score on node2: -INFINITY ++native_color: rsc5:0 allocation score on node1: 0 ++native_color: rsc5:0 allocation score on node2: 1 ++native_color: rsc5:1 allocation score on node1: 1 ++native_color: rsc5:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc5:0 promotion score on node2: -1 ++rsc5:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-rsc-sets-10.xml b/pengine/test10/ticket-rsc-sets-10.xml +new file mode 100644 +index 0000000..606526f +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-10.xml +@@ -0,0 +1,143 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-11.dot b/pengine/test10/ticket-rsc-sets-11.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-11.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-rsc-sets-11.exp b/pengine/test10/ticket-rsc-sets-11.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-11.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-11.scores b/pengine/test10/ticket-rsc-sets-11.scores +new file mode 100644 +index 0000000..4fd8101 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-11.scores +@@ -0,0 +1,37 @@ ++Allocation scores: ++clone_color: clone4 allocation score on node1: 0 ++clone_color: clone4 allocation score on node2: 0 ++clone_color: ms5 allocation score on node1: 0 ++clone_color: ms5 allocation score on node2: 0 ++clone_color: rsc4:0 allocation score on node1: -INFINITY ++clone_color: rsc4:0 allocation score on node2: -INFINITY ++clone_color: rsc4:1 allocation score on node1: -INFINITY ++clone_color: rsc4:1 allocation score on node2: -INFINITY ++clone_color: rsc5:0 allocation score on node1: 0 ++clone_color: rsc5:0 allocation score on node2: 1 ++clone_color: rsc5:1 allocation score on node1: 1 ++clone_color: rsc5:1 allocation score on node2: 0 ++group_color: group2 allocation score on node1: 0 ++group_color: group2 allocation score on node2: 0 ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++group_color: rsc3 allocation score on node1: -INFINITY ++group_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc3 allocation score on node1: -INFINITY ++native_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc4:0 allocation score on node1: -INFINITY ++native_color: rsc4:0 allocation score on node2: -INFINITY ++native_color: rsc4:1 allocation score on node1: -INFINITY ++native_color: rsc4:1 allocation score on node2: -INFINITY ++native_color: rsc5:0 allocation score on node1: 0 ++native_color: rsc5:0 allocation score on node2: 1 ++native_color: rsc5:1 allocation score on node1: 1 ++native_color: rsc5:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc5:0 promotion score on node2: -1 ++rsc5:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-rsc-sets-11.xml b/pengine/test10/ticket-rsc-sets-11.xml +new file mode 100644 +index 0000000..96f4ad3 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-11.xml +@@ -0,0 +1,134 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-12.dot b/pengine/test10/ticket-rsc-sets-12.dot +new file mode 100644 +index 0000000..b5a50db +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-12.dot +@@ -0,0 +1,19 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"group2_stop_0" -> "group2_stopped_0" [ style = bold] ++"group2_stop_0" -> "rsc2_stop_0 node1" [ style = bold] ++"group2_stop_0" -> "rsc3_stop_0 node1" [ style = bold] ++"group2_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group2_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc2_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node1" -> "group2_stopped_0" [ style = bold] ++"rsc2_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc3_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc3_stop_0 node1" -> "group2_stopped_0" [ style = bold] ++"rsc3_stop_0 node1" -> "rsc2_stop_0 node1" [ style = bold] ++"rsc3_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-rsc-sets-12.exp b/pengine/test10/ticket-rsc-sets-12.exp +new file mode 100644 +index 0000000..68049cf +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-12.exp +@@ -0,0 +1,101 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-12.scores b/pengine/test10/ticket-rsc-sets-12.scores +new file mode 100644 +index 0000000..4fd8101 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-12.scores +@@ -0,0 +1,37 @@ ++Allocation scores: ++clone_color: clone4 allocation score on node1: 0 ++clone_color: clone4 allocation score on node2: 0 ++clone_color: ms5 allocation score on node1: 0 ++clone_color: ms5 allocation score on node2: 0 ++clone_color: rsc4:0 allocation score on node1: -INFINITY ++clone_color: rsc4:0 allocation score on node2: -INFINITY ++clone_color: rsc4:1 allocation score on node1: -INFINITY ++clone_color: rsc4:1 allocation score on node2: -INFINITY ++clone_color: rsc5:0 allocation score on node1: 0 ++clone_color: rsc5:0 allocation score on node2: 1 ++clone_color: rsc5:1 allocation score on node1: 1 ++clone_color: rsc5:1 allocation score on node2: 0 ++group_color: group2 allocation score on node1: 0 ++group_color: group2 allocation score on node2: 0 ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++group_color: rsc3 allocation score on node1: -INFINITY ++group_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc3 allocation score on node1: -INFINITY ++native_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc4:0 allocation score on node1: -INFINITY ++native_color: rsc4:0 allocation score on node2: -INFINITY ++native_color: rsc4:1 allocation score on node1: -INFINITY ++native_color: rsc4:1 allocation score on node2: -INFINITY ++native_color: rsc5:0 allocation score on node1: 0 ++native_color: rsc5:0 allocation score on node2: 1 ++native_color: rsc5:1 allocation score on node1: 1 ++native_color: rsc5:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc5:0 promotion score on node2: -1 ++rsc5:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-rsc-sets-12.xml b/pengine/test10/ticket-rsc-sets-12.xml +new file mode 100644 +index 0000000..4aea483 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-12.xml +@@ -0,0 +1,141 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-13.dot b/pengine/test10/ticket-rsc-sets-13.dot +new file mode 100644 +index 0000000..369aacd +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-13.dot +@@ -0,0 +1,36 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"clone4_stop_0" -> "clone4_stopped_0" [ style = bold] ++"clone4_stop_0" -> "rsc4:0_stop_0 node2" [ style = bold] ++"clone4_stop_0" -> "rsc4:1_stop_0 node1" [ style = bold] ++"clone4_stop_0" [ style=bold color="green" fontcolor="orange"] ++"clone4_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"group2_stop_0" -> "group2_stopped_0" [ style = bold] ++"group2_stop_0" -> "rsc2_stop_0 node1" [ style = bold] ++"group2_stop_0" -> "rsc3_stop_0 node1" [ style = bold] ++"group2_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group2_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"ms5_demote_0" -> "ms5_demoted_0" [ style = bold] ++"ms5_demote_0" -> "rsc5:1_demote_0 node1" [ style = bold] ++"ms5_demote_0" [ style=bold color="green" fontcolor="orange"] ++"ms5_demoted_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc2_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node1" -> "group2_stopped_0" [ style = bold] ++"rsc2_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc3_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc3_stop_0 node1" -> "group2_stopped_0" [ style = bold] ++"rsc3_stop_0 node1" -> "rsc2_stop_0 node1" [ style = bold] ++"rsc3_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc4:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc4:0_stop_0 node2" -> "clone4_stopped_0" [ style = bold] ++"rsc4:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc4:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc4:1_stop_0 node1" -> "clone4_stopped_0" [ style = bold] ++"rsc4:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc5:1_demote_0 node1" -> "ms5_demoted_0" [ style = bold] ++"rsc5:1_demote_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-rsc-sets-13.exp b/pengine/test10/ticket-rsc-sets-13.exp +new file mode 100644 +index 0000000..b8278ba +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-13.exp +@@ -0,0 +1,195 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-13.scores b/pengine/test10/ticket-rsc-sets-13.scores +new file mode 100644 +index 0000000..4fd8101 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-13.scores +@@ -0,0 +1,37 @@ ++Allocation scores: ++clone_color: clone4 allocation score on node1: 0 ++clone_color: clone4 allocation score on node2: 0 ++clone_color: ms5 allocation score on node1: 0 ++clone_color: ms5 allocation score on node2: 0 ++clone_color: rsc4:0 allocation score on node1: -INFINITY ++clone_color: rsc4:0 allocation score on node2: -INFINITY ++clone_color: rsc4:1 allocation score on node1: -INFINITY ++clone_color: rsc4:1 allocation score on node2: -INFINITY ++clone_color: rsc5:0 allocation score on node1: 0 ++clone_color: rsc5:0 allocation score on node2: 1 ++clone_color: rsc5:1 allocation score on node1: 1 ++clone_color: rsc5:1 allocation score on node2: 0 ++group_color: group2 allocation score on node1: 0 ++group_color: group2 allocation score on node2: 0 ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++group_color: rsc3 allocation score on node1: -INFINITY ++group_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc3 allocation score on node1: -INFINITY ++native_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc4:0 allocation score on node1: -INFINITY ++native_color: rsc4:0 allocation score on node2: -INFINITY ++native_color: rsc4:1 allocation score on node1: -INFINITY ++native_color: rsc4:1 allocation score on node2: -INFINITY ++native_color: rsc5:0 allocation score on node1: 0 ++native_color: rsc5:0 allocation score on node2: 1 ++native_color: rsc5:1 allocation score on node1: 1 ++native_color: rsc5:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc5:0 promotion score on node2: -1 ++rsc5:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-rsc-sets-13.xml b/pengine/test10/ticket-rsc-sets-13.xml +new file mode 100644 +index 0000000..c8aecd1 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-13.xml +@@ -0,0 +1,148 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-14.dot b/pengine/test10/ticket-rsc-sets-14.dot +new file mode 100644 +index 0000000..369aacd +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-14.dot +@@ -0,0 +1,36 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"clone4_stop_0" -> "clone4_stopped_0" [ style = bold] ++"clone4_stop_0" -> "rsc4:0_stop_0 node2" [ style = bold] ++"clone4_stop_0" -> "rsc4:1_stop_0 node1" [ style = bold] ++"clone4_stop_0" [ style=bold color="green" fontcolor="orange"] ++"clone4_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"group2_stop_0" -> "group2_stopped_0" [ style = bold] ++"group2_stop_0" -> "rsc2_stop_0 node1" [ style = bold] ++"group2_stop_0" -> "rsc3_stop_0 node1" [ style = bold] ++"group2_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group2_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"ms5_demote_0" -> "ms5_demoted_0" [ style = bold] ++"ms5_demote_0" -> "rsc5:1_demote_0 node1" [ style = bold] ++"ms5_demote_0" [ style=bold color="green" fontcolor="orange"] ++"ms5_demoted_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc2_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node1" -> "group2_stopped_0" [ style = bold] ++"rsc2_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc3_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc3_stop_0 node1" -> "group2_stopped_0" [ style = bold] ++"rsc3_stop_0 node1" -> "rsc2_stop_0 node1" [ style = bold] ++"rsc3_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc4:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc4:0_stop_0 node2" -> "clone4_stopped_0" [ style = bold] ++"rsc4:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc4:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc4:1_stop_0 node1" -> "clone4_stopped_0" [ style = bold] ++"rsc4:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc5:1_demote_0 node1" -> "ms5_demoted_0" [ style = bold] ++"rsc5:1_demote_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-rsc-sets-14.exp b/pengine/test10/ticket-rsc-sets-14.exp +new file mode 100644 +index 0000000..b8278ba +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-14.exp +@@ -0,0 +1,195 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-14.scores b/pengine/test10/ticket-rsc-sets-14.scores +new file mode 100644 +index 0000000..4fd8101 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-14.scores +@@ -0,0 +1,37 @@ ++Allocation scores: ++clone_color: clone4 allocation score on node1: 0 ++clone_color: clone4 allocation score on node2: 0 ++clone_color: ms5 allocation score on node1: 0 ++clone_color: ms5 allocation score on node2: 0 ++clone_color: rsc4:0 allocation score on node1: -INFINITY ++clone_color: rsc4:0 allocation score on node2: -INFINITY ++clone_color: rsc4:1 allocation score on node1: -INFINITY ++clone_color: rsc4:1 allocation score on node2: -INFINITY ++clone_color: rsc5:0 allocation score on node1: 0 ++clone_color: rsc5:0 allocation score on node2: 1 ++clone_color: rsc5:1 allocation score on node1: 1 ++clone_color: rsc5:1 allocation score on node2: 0 ++group_color: group2 allocation score on node1: 0 ++group_color: group2 allocation score on node2: 0 ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++group_color: rsc3 allocation score on node1: -INFINITY ++group_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc3 allocation score on node1: -INFINITY ++native_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc4:0 allocation score on node1: -INFINITY ++native_color: rsc4:0 allocation score on node2: -INFINITY ++native_color: rsc4:1 allocation score on node1: -INFINITY ++native_color: rsc4:1 allocation score on node2: -INFINITY ++native_color: rsc5:0 allocation score on node1: 0 ++native_color: rsc5:0 allocation score on node2: 1 ++native_color: rsc5:1 allocation score on node1: 1 ++native_color: rsc5:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc5:0 promotion score on node2: -1 ++rsc5:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-rsc-sets-14.xml b/pengine/test10/ticket-rsc-sets-14.xml +new file mode 100644 +index 0000000..0ce0959 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-14.xml +@@ -0,0 +1,148 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-8.dot b/pengine/test10/ticket-rsc-sets-8.dot +new file mode 100644 +index 0000000..7b4328b +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-8.dot +@@ -0,0 +1,4 @@ ++digraph "g" { ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-rsc-sets-8.exp b/pengine/test10/ticket-rsc-sets-8.exp +new file mode 100644 +index 0000000..8bc8c88 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-8.exp +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-8.scores b/pengine/test10/ticket-rsc-sets-8.scores +new file mode 100644 +index 0000000..4fd8101 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-8.scores +@@ -0,0 +1,37 @@ ++Allocation scores: ++clone_color: clone4 allocation score on node1: 0 ++clone_color: clone4 allocation score on node2: 0 ++clone_color: ms5 allocation score on node1: 0 ++clone_color: ms5 allocation score on node2: 0 ++clone_color: rsc4:0 allocation score on node1: -INFINITY ++clone_color: rsc4:0 allocation score on node2: -INFINITY ++clone_color: rsc4:1 allocation score on node1: -INFINITY ++clone_color: rsc4:1 allocation score on node2: -INFINITY ++clone_color: rsc5:0 allocation score on node1: 0 ++clone_color: rsc5:0 allocation score on node2: 1 ++clone_color: rsc5:1 allocation score on node1: 1 ++clone_color: rsc5:1 allocation score on node2: 0 ++group_color: group2 allocation score on node1: 0 ++group_color: group2 allocation score on node2: 0 ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++group_color: rsc3 allocation score on node1: -INFINITY ++group_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc3 allocation score on node1: -INFINITY ++native_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc4:0 allocation score on node1: -INFINITY ++native_color: rsc4:0 allocation score on node2: -INFINITY ++native_color: rsc4:1 allocation score on node1: -INFINITY ++native_color: rsc4:1 allocation score on node2: -INFINITY ++native_color: rsc5:0 allocation score on node1: 0 ++native_color: rsc5:0 allocation score on node2: 1 ++native_color: rsc5:1 allocation score on node1: 1 ++native_color: rsc5:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc5:0 promotion score on node2: -1 ++rsc5:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-rsc-sets-8.xml b/pengine/test10/ticket-rsc-sets-8.xml +new file mode 100644 +index 0000000..e358427 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-8.xml +@@ -0,0 +1,130 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-9.dot b/pengine/test10/ticket-rsc-sets-9.dot +new file mode 100644 +index 0000000..369aacd +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-9.dot +@@ -0,0 +1,36 @@ ++digraph "g" { ++"all_stopped" [ style=bold color="green" fontcolor="orange"] ++"clone4_stop_0" -> "clone4_stopped_0" [ style = bold] ++"clone4_stop_0" -> "rsc4:0_stop_0 node2" [ style = bold] ++"clone4_stop_0" -> "rsc4:1_stop_0 node1" [ style = bold] ++"clone4_stop_0" [ style=bold color="green" fontcolor="orange"] ++"clone4_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"group2_stop_0" -> "group2_stopped_0" [ style = bold] ++"group2_stop_0" -> "rsc2_stop_0 node1" [ style = bold] ++"group2_stop_0" -> "rsc3_stop_0 node1" [ style = bold] ++"group2_stop_0" [ style=bold color="green" fontcolor="orange"] ++"group2_stopped_0" [ style=bold color="green" fontcolor="orange"] ++"ms5_demote_0" -> "ms5_demoted_0" [ style = bold] ++"ms5_demote_0" -> "rsc5:1_demote_0 node1" [ style = bold] ++"ms5_demote_0" [ style=bold color="green" fontcolor="orange"] ++"ms5_demoted_0" [ style=bold color="green" fontcolor="orange"] ++"probe_complete node1" [ style=bold color="green" fontcolor="black"] ++"probe_complete node2" [ style=bold color="green" fontcolor="black"] ++"rsc1_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc1_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc2_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc2_stop_0 node1" -> "group2_stopped_0" [ style = bold] ++"rsc2_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc3_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc3_stop_0 node1" -> "group2_stopped_0" [ style = bold] ++"rsc3_stop_0 node1" -> "rsc2_stop_0 node1" [ style = bold] ++"rsc3_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc4:0_stop_0 node2" -> "all_stopped" [ style = bold] ++"rsc4:0_stop_0 node2" -> "clone4_stopped_0" [ style = bold] ++"rsc4:0_stop_0 node2" [ style=bold color="green" fontcolor="black"] ++"rsc4:1_stop_0 node1" -> "all_stopped" [ style = bold] ++"rsc4:1_stop_0 node1" -> "clone4_stopped_0" [ style = bold] ++"rsc4:1_stop_0 node1" [ style=bold color="green" fontcolor="black"] ++"rsc5:1_demote_0 node1" -> "ms5_demoted_0" [ style = bold] ++"rsc5:1_demote_0 node1" [ style=bold color="green" fontcolor="black"] ++} +diff --git a/pengine/test10/ticket-rsc-sets-9.exp b/pengine/test10/ticket-rsc-sets-9.exp +new file mode 100644 +index 0000000..b8278ba +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-9.exp +@@ -0,0 +1,195 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/pengine/test10/ticket-rsc-sets-9.scores b/pengine/test10/ticket-rsc-sets-9.scores +new file mode 100644 +index 0000000..4fd8101 +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-9.scores +@@ -0,0 +1,37 @@ ++Allocation scores: ++clone_color: clone4 allocation score on node1: 0 ++clone_color: clone4 allocation score on node2: 0 ++clone_color: ms5 allocation score on node1: 0 ++clone_color: ms5 allocation score on node2: 0 ++clone_color: rsc4:0 allocation score on node1: -INFINITY ++clone_color: rsc4:0 allocation score on node2: -INFINITY ++clone_color: rsc4:1 allocation score on node1: -INFINITY ++clone_color: rsc4:1 allocation score on node2: -INFINITY ++clone_color: rsc5:0 allocation score on node1: 0 ++clone_color: rsc5:0 allocation score on node2: 1 ++clone_color: rsc5:1 allocation score on node1: 1 ++clone_color: rsc5:1 allocation score on node2: 0 ++group_color: group2 allocation score on node1: 0 ++group_color: group2 allocation score on node2: 0 ++group_color: rsc2 allocation score on node1: -INFINITY ++group_color: rsc2 allocation score on node2: -INFINITY ++group_color: rsc3 allocation score on node1: -INFINITY ++group_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc1 allocation score on node1: -INFINITY ++native_color: rsc1 allocation score on node2: -INFINITY ++native_color: rsc2 allocation score on node1: -INFINITY ++native_color: rsc2 allocation score on node2: -INFINITY ++native_color: rsc3 allocation score on node1: -INFINITY ++native_color: rsc3 allocation score on node2: -INFINITY ++native_color: rsc4:0 allocation score on node1: -INFINITY ++native_color: rsc4:0 allocation score on node2: -INFINITY ++native_color: rsc4:1 allocation score on node1: -INFINITY ++native_color: rsc4:1 allocation score on node2: -INFINITY ++native_color: rsc5:0 allocation score on node1: 0 ++native_color: rsc5:0 allocation score on node2: 1 ++native_color: rsc5:1 allocation score on node1: 1 ++native_color: rsc5:1 allocation score on node2: -INFINITY ++native_color: rsc_stonith allocation score on node1: 0 ++native_color: rsc_stonith allocation score on node2: 0 ++rsc5:0 promotion score on node2: -1 ++rsc5:1 promotion score on node1: -INFINITY +diff --git a/pengine/test10/ticket-rsc-sets-9.xml b/pengine/test10/ticket-rsc-sets-9.xml +new file mode 100644 +index 0000000..f3a350d +--- /dev/null ++++ b/pengine/test10/ticket-rsc-sets-9.xml +@@ -0,0 +1,143 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ diff --git a/pacemaker-ticket-standby.diff b/pacemaker-ticket-standby.diff new file mode 100644 index 0000000..bcd0c96 --- /dev/null +++ b/pacemaker-ticket-standby.diff @@ -0,0 +1,96 @@ +commit de850c422b50d82d09ce820d98d057fae3ea18c9 +Author: Gao,Yan +Date: Fri Mar 23 12:01:13 2012 +0800 + + High: PE: Support to make tickets standby for relinquishing tickets gracefully + +Index: pacemaker/pengine/clone.c +=================================================================== +--- pacemaker.orig/pengine/clone.c ++++ pacemaker/pengine/clone.c +@@ -522,7 +522,7 @@ clone_color(resource_t * rsc, node_t * p + for (; gIter != NULL; gIter = gIter->next) { + rsc_ticket_t *rsc_ticket = (rsc_ticket_t *) gIter->data; + +- if (rsc_ticket->ticket->granted == FALSE) { ++ if (rsc_ticket->ticket->granted == FALSE || rsc_ticket->ticket->standby) { + rsc_ticket_constraint(rsc, rsc_ticket, data_set); + } + } +Index: pacemaker/pengine/group.c +=================================================================== +--- pacemaker.orig/pengine/group.c ++++ pacemaker/pengine/group.c +@@ -68,7 +68,7 @@ group_color(resource_t * rsc, node_t * p + for (; gIter != NULL; gIter = gIter->next) { + rsc_ticket_t *rsc_ticket = (rsc_ticket_t *) gIter->data; + +- if (rsc_ticket->ticket->granted == FALSE) { ++ if (rsc_ticket->ticket->granted == FALSE || rsc_ticket->ticket->standby) { + rsc_ticket_constraint(rsc, rsc_ticket, data_set); + } + } +Index: pacemaker/pengine/master.c +=================================================================== +--- pacemaker.orig/pengine/master.c ++++ pacemaker/pengine/master.c +@@ -353,7 +353,8 @@ master_promotion_order(resource_t * rsc, + for (; gIter != NULL; gIter = gIter->next) { + rsc_ticket_t *rsc_ticket = (rsc_ticket_t *) gIter->data; + +- if (rsc_ticket->role_lh == RSC_ROLE_MASTER && rsc_ticket->ticket->granted == FALSE) { ++ if (rsc_ticket->role_lh == RSC_ROLE_MASTER ++ && (rsc_ticket->ticket->granted == FALSE || rsc_ticket->ticket->standby)) { + resource_location(rsc, NULL, -INFINITY, "__stateful_without_ticket__", data_set); + } + } +Index: pacemaker/pengine/native.c +=================================================================== +--- pacemaker.orig/pengine/native.c ++++ pacemaker/pengine/native.c +@@ -494,7 +494,7 @@ native_color(resource_t * rsc, node_t * + for (gIter = rsc->rsc_tickets; gIter != NULL; gIter = gIter->next) { + rsc_ticket_t *rsc_ticket = (rsc_ticket_t *) gIter->data; + +- if (rsc_ticket->ticket->granted == FALSE) { ++ if (rsc_ticket->ticket->granted == FALSE || rsc_ticket->ticket->standby) { + rsc_ticket_constraint(rsc, rsc_ticket, data_set); + } + } +@@ -1401,7 +1401,7 @@ rsc_ticket_constraint(resource_t * rsc_l + return; + } + +- if (rsc_ticket->ticket->granted == TRUE) { ++ if (rsc_ticket->ticket->granted && rsc_ticket->ticket->standby == FALSE) { + return; + } + +@@ -1421,7 +1421,7 @@ rsc_ticket_constraint(resource_t * rsc_l + crm_debug_2("%s: Processing ticket dependency on %s (%s, %s)", + rsc_lh->id, rsc_ticket->ticket->id, rsc_ticket->id, role2text(rsc_ticket->role_lh)); + +- if (g_list_length(rsc_lh->running_on) > 0) { ++ if (rsc_ticket->ticket->granted == FALSE && g_list_length(rsc_lh->running_on) > 0) { + GListPtr gIter = NULL; + + switch (rsc_ticket->loss_policy) { +@@ -1461,11 +1461,17 @@ rsc_ticket_constraint(resource_t * rsc_l + break; + } + +- } else { ++ } else if (rsc_ticket->ticket->granted == FALSE){ + + if (rsc_ticket->role_lh != RSC_ROLE_MASTER || rsc_ticket->loss_policy == loss_ticket_stop) { + resource_location(rsc_lh, NULL, -INFINITY, "__no_ticket__", data_set); + } ++ ++ } else if (rsc_ticket->ticket->standby) { ++ ++ if (rsc_ticket->role_lh != RSC_ROLE_MASTER || rsc_ticket->loss_policy == loss_ticket_stop) { ++ resource_location(rsc_lh, NULL, -INFINITY, "__ticket_standby__", data_set); ++ } + } + } + diff --git a/pacemaker-ticket-state-tests.diff b/pacemaker-ticket-state-tests.diff new file mode 100644 index 0000000..9a457f2 --- /dev/null +++ b/pacemaker-ticket-state-tests.diff @@ -0,0 +1,565 @@ +commit 95b5ca54286889209f9a8d609412594047e34c26 +Author: Gao,Yan +Date: Sat Mar 24 10:48:28 2012 +0800 + + Low: PE: Update regression tests for the new ticket state section + +diff --git a/pengine/test10/ticket-clone-11.xml b/pengine/test10/ticket-clone-11.xml +index 91e8330..2845018 100644 +--- a/pengine/test10/ticket-clone-11.xml ++++ b/pengine/test10/ticket-clone-11.xml +@@ -26,9 +26,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-clone-12.xml b/pengine/test10/ticket-clone-12.xml +index a7faed0..fc5240e 100644 +--- a/pengine/test10/ticket-clone-12.xml ++++ b/pengine/test10/ticket-clone-12.xml +@@ -26,9 +26,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-clone-2.xml b/pengine/test10/ticket-clone-2.xml +index 464e886..786dc07 100644 +--- a/pengine/test10/ticket-clone-2.xml ++++ b/pengine/test10/ticket-clone-2.xml +@@ -26,9 +26,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-clone-3.xml b/pengine/test10/ticket-clone-3.xml +index b3d8333..cf57e5b 100644 +--- a/pengine/test10/ticket-clone-3.xml ++++ b/pengine/test10/ticket-clone-3.xml +@@ -26,9 +26,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-clone-5.xml b/pengine/test10/ticket-clone-5.xml +index 35ac9a2..e103637 100644 +--- a/pengine/test10/ticket-clone-5.xml ++++ b/pengine/test10/ticket-clone-5.xml +@@ -26,9 +26,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-clone-6.xml b/pengine/test10/ticket-clone-6.xml +index 1d31273..05e01f4 100644 +--- a/pengine/test10/ticket-clone-6.xml ++++ b/pengine/test10/ticket-clone-6.xml +@@ -26,9 +26,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-clone-8.xml b/pengine/test10/ticket-clone-8.xml +index 37ab92c..d8e08ee 100644 +--- a/pengine/test10/ticket-clone-8.xml ++++ b/pengine/test10/ticket-clone-8.xml +@@ -26,9 +26,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-clone-9.xml b/pengine/test10/ticket-clone-9.xml +index 81700a5..d33d515 100644 +--- a/pengine/test10/ticket-clone-9.xml ++++ b/pengine/test10/ticket-clone-9.xml +@@ -26,9 +26,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-group-11.xml b/pengine/test10/ticket-group-11.xml +index 7bbc2bc..a60211d 100644 +--- a/pengine/test10/ticket-group-11.xml ++++ b/pengine/test10/ticket-group-11.xml +@@ -36,9 +36,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-group-12.xml b/pengine/test10/ticket-group-12.xml +index 7a2e239..798b223 100644 +--- a/pengine/test10/ticket-group-12.xml ++++ b/pengine/test10/ticket-group-12.xml +@@ -36,9 +36,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-group-2.xml b/pengine/test10/ticket-group-2.xml +index f4c8c43..f96cb00 100644 +--- a/pengine/test10/ticket-group-2.xml ++++ b/pengine/test10/ticket-group-2.xml +@@ -36,9 +36,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-group-3.xml b/pengine/test10/ticket-group-3.xml +index 3746e03..80529d0 100644 +--- a/pengine/test10/ticket-group-3.xml ++++ b/pengine/test10/ticket-group-3.xml +@@ -36,9 +36,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-group-5.xml b/pengine/test10/ticket-group-5.xml +index 064e211..8e0f935 100644 +--- a/pengine/test10/ticket-group-5.xml ++++ b/pengine/test10/ticket-group-5.xml +@@ -36,9 +36,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-group-6.xml b/pengine/test10/ticket-group-6.xml +index 0fdda63..1c6fe6a 100644 +--- a/pengine/test10/ticket-group-6.xml ++++ b/pengine/test10/ticket-group-6.xml +@@ -36,9 +36,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-group-8.xml b/pengine/test10/ticket-group-8.xml +index 4232acb..dc8bb88 100644 +--- a/pengine/test10/ticket-group-8.xml ++++ b/pengine/test10/ticket-group-8.xml +@@ -36,9 +36,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-group-9.xml b/pengine/test10/ticket-group-9.xml +index dfd10c9..b08fdcd 100644 +--- a/pengine/test10/ticket-group-9.xml ++++ b/pengine/test10/ticket-group-9.xml +@@ -36,9 +36,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-master-11.xml b/pengine/test10/ticket-master-11.xml +index 151d5fb..0b46eae 100644 +--- a/pengine/test10/ticket-master-11.xml ++++ b/pengine/test10/ticket-master-11.xml +@@ -32,9 +32,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-master-12.xml b/pengine/test10/ticket-master-12.xml +index 3a238eb..620f2af 100644 +--- a/pengine/test10/ticket-master-12.xml ++++ b/pengine/test10/ticket-master-12.xml +@@ -32,9 +32,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-master-2.xml b/pengine/test10/ticket-master-2.xml +index b45fe97..7601925 100644 +--- a/pengine/test10/ticket-master-2.xml ++++ b/pengine/test10/ticket-master-2.xml +@@ -32,9 +32,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-master-3.xml b/pengine/test10/ticket-master-3.xml +index 641b26a..b0bc973 100644 +--- a/pengine/test10/ticket-master-3.xml ++++ b/pengine/test10/ticket-master-3.xml +@@ -32,9 +32,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-master-5.xml b/pengine/test10/ticket-master-5.xml +index fa15ae2..ab1f797 100644 +--- a/pengine/test10/ticket-master-5.xml ++++ b/pengine/test10/ticket-master-5.xml +@@ -32,9 +32,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-master-6.xml b/pengine/test10/ticket-master-6.xml +index 2f691b4..02bf6af 100644 +--- a/pengine/test10/ticket-master-6.xml ++++ b/pengine/test10/ticket-master-6.xml +@@ -32,9 +32,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-master-8.xml b/pengine/test10/ticket-master-8.xml +index 4c7bd42..8df7289 100644 +--- a/pengine/test10/ticket-master-8.xml ++++ b/pengine/test10/ticket-master-8.xml +@@ -32,9 +32,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-master-9.xml b/pengine/test10/ticket-master-9.xml +index b81e762..d4b7979 100644 +--- a/pengine/test10/ticket-master-9.xml ++++ b/pengine/test10/ticket-master-9.xml +@@ -32,9 +32,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-primitive-11.xml b/pengine/test10/ticket-primitive-11.xml +index 8f21e29..5b36f87 100644 +--- a/pengine/test10/ticket-primitive-11.xml ++++ b/pengine/test10/ticket-primitive-11.xml +@@ -27,9 +27,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-primitive-12.xml b/pengine/test10/ticket-primitive-12.xml +index 9c7b7f2..7285f7d 100644 +--- a/pengine/test10/ticket-primitive-12.xml ++++ b/pengine/test10/ticket-primitive-12.xml +@@ -27,9 +27,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-primitive-2.xml b/pengine/test10/ticket-primitive-2.xml +index 190fe6c..122b7e6 100644 +--- a/pengine/test10/ticket-primitive-2.xml ++++ b/pengine/test10/ticket-primitive-2.xml +@@ -27,9 +27,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-primitive-3.xml b/pengine/test10/ticket-primitive-3.xml +index 3f535f1..66d08c8 100644 +--- a/pengine/test10/ticket-primitive-3.xml ++++ b/pengine/test10/ticket-primitive-3.xml +@@ -27,9 +27,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-primitive-5.xml b/pengine/test10/ticket-primitive-5.xml +index 60e7df6..c159472 100644 +--- a/pengine/test10/ticket-primitive-5.xml ++++ b/pengine/test10/ticket-primitive-5.xml +@@ -27,9 +27,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-primitive-6.xml b/pengine/test10/ticket-primitive-6.xml +index 958ef16..1614d59 100644 +--- a/pengine/test10/ticket-primitive-6.xml ++++ b/pengine/test10/ticket-primitive-6.xml +@@ -27,9 +27,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-primitive-8.xml b/pengine/test10/ticket-primitive-8.xml +index 5ed4f6f..89ae6b7 100644 +--- a/pengine/test10/ticket-primitive-8.xml ++++ b/pengine/test10/ticket-primitive-8.xml +@@ -27,9 +27,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-primitive-9.xml b/pengine/test10/ticket-primitive-9.xml +index 4b7225d..80cc4ca 100644 +--- a/pengine/test10/ticket-primitive-9.xml ++++ b/pengine/test10/ticket-primitive-9.xml +@@ -27,9 +27,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-rsc-sets-2.xml b/pengine/test10/ticket-rsc-sets-2.xml +index b0a8ffd..c6b99e4 100644 +--- a/pengine/test10/ticket-rsc-sets-2.xml ++++ b/pengine/test10/ticket-rsc-sets-2.xml +@@ -73,9 +73,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-rsc-sets-3.xml b/pengine/test10/ticket-rsc-sets-3.xml +index 96396bb..c86cdda 100644 +--- a/pengine/test10/ticket-rsc-sets-3.xml ++++ b/pengine/test10/ticket-rsc-sets-3.xml +@@ -73,9 +73,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-rsc-sets-5.xml b/pengine/test10/ticket-rsc-sets-5.xml +index e416852..cae37c3 100644 +--- a/pengine/test10/ticket-rsc-sets-5.xml ++++ b/pengine/test10/ticket-rsc-sets-5.xml +@@ -77,9 +77,7 @@ + + + +- +- +- ++ + + + +diff --git a/pengine/test10/ticket-rsc-sets-6.xml b/pengine/test10/ticket-rsc-sets-6.xml +index dd8f577..5cf50a0 100644 +--- a/pengine/test10/ticket-rsc-sets-6.xml ++++ b/pengine/test10/ticket-rsc-sets-6.xml +@@ -77,10 +77,8 @@ + + + +- +- +- +- ++ ++ + + + +diff --git a/pengine/test10/ticket-rsc-sets-7.xml b/pengine/test10/ticket-rsc-sets-7.xml +index 7ebbc66..2cd519e 100644 +--- a/pengine/test10/ticket-rsc-sets-7.xml ++++ b/pengine/test10/ticket-rsc-sets-7.xml +@@ -77,10 +77,8 @@ + + + +- +- +- +- ++ ++ + + + diff --git a/pacemaker-ticket-state.diff b/pacemaker-ticket-state.diff new file mode 100644 index 0000000..2add37b --- /dev/null +++ b/pacemaker-ticket-state.diff @@ -0,0 +1,364 @@ +commit f3dea7908cfcc61e83b765b8bda68f6ce1ba31d3 +Author: Gao,Yan +Date: Fri Mar 23 11:40:56 2012 +0800 + + High: PE: Move the ticket state section to "/cib/status/tickets/ticket_state" + + Move the ticket state section: + --- "/cib/status/tickets/instance_attributes" + +++ "/cib/status/tickets/ticket_state" + + Pengine still recognizes the deprecated section. If there's any + attribute appears in the new tickets_state section, it'll take over + precedence over the one in the deprecated section. Actually, even + more, once crm_ticket is invoked to set an attribute, it'll clear the + one in the deprecated section. + +Index: pacemaker/include/crm/msg_xml.h +=================================================================== +--- pacemaker.orig/include/crm/msg_xml.h ++++ pacemaker/include/crm/msg_xml.h +@@ -297,7 +297,8 @@ + # define XML_ACL_ATTR_XPATH "xpath" + # define XML_ACL_ATTR_ATTRIBUTE "attribute" + +-# define XML_CIB_TAG_TICKETS "tickets" ++# define XML_CIB_TAG_TICKETS "tickets" ++# define XML_CIB_TAG_TICKET_STATE "ticket_state" + + # include + +Index: pacemaker/include/crm/pengine/status.h +=================================================================== +--- pacemaker.orig/include/crm/pengine/status.h ++++ pacemaker/include/crm/pengine/status.h +@@ -294,6 +294,8 @@ struct ticket_s { + char *id; + gboolean granted; + time_t last_granted; ++ gboolean standby; ++ GHashTable *state; + }; + + gboolean cluster_status(pe_working_set_t * data_set); +Index: pacemaker/lib/pengine/unpack.c +=================================================================== +--- pacemaker.orig/lib/pengine/unpack.c ++++ pacemaker/lib/pengine/unpack.c +@@ -412,10 +412,95 @@ unpack_resources(xmlNode * xml_resources + return TRUE; + } + ++/* The ticket state section: ++ * "/cib/status/tickets/ticket_state" */ ++static gboolean ++unpack_ticket_state(xmlNode * xml_ticket, pe_working_set_t * data_set) ++{ ++ const char *ticket_id = NULL; ++ const char *granted = NULL; ++ const char *last_granted = NULL; ++ const char *standby = NULL; ++ xmlAttrPtr xIter = NULL; ++ ++ ticket_t *ticket = NULL; ++ ++ ticket_id = ID(xml_ticket); ++ if (ticket_id == NULL || strlen(ticket_id) == 0) { ++ return FALSE; ++ } ++ ++ crm_trace("Processing ticket state for %s", ticket_id); ++ ++ ticket = g_hash_table_lookup(data_set->tickets, ticket_id); ++ if (ticket == NULL) { ++ ticket = ticket_new(ticket_id, data_set); ++ if (ticket == NULL) { ++ return FALSE; ++ } ++ } ++ ++ for (xIter = xml_ticket->properties; xIter; xIter = xIter->next) { ++ const char *prop_name = (const char *)xIter->name; ++ const char *prop_value = crm_element_value(xml_ticket, prop_name); ++ ++ if(crm_str_eq(prop_name, XML_ATTR_ID, TRUE)) { ++ continue; ++ } ++ g_hash_table_replace(ticket->state, crm_strdup(prop_name), crm_strdup(prop_value)); ++ } ++ ++ granted = g_hash_table_lookup(ticket->state, "granted"); ++ if (granted && crm_is_true(granted)) { ++ ticket->granted = TRUE; ++ crm_info("We have ticket '%s'", ticket->id); ++ } else { ++ ticket->granted = FALSE; ++ crm_info("We do not have ticket '%s'", ticket->id); ++ } ++ ++ last_granted = g_hash_table_lookup(ticket->state, "last-granted"); ++ if (last_granted) { ++ ticket->last_granted = crm_parse_int(last_granted, 0); ++ } ++ ++ standby = g_hash_table_lookup(ticket->state, "standby"); ++ if (standby && crm_is_true(standby)) { ++ ticket->standby = TRUE; ++ if (ticket->granted) { ++ crm_info("Granted ticket '%s' is in standby-mode", ticket->id); ++ } ++ } else { ++ ticket->standby = FALSE; ++ } ++ ++ crm_trace("Done with ticket state for %s", ticket_id); ++ ++ return TRUE; ++} ++ ++static gboolean ++unpack_tickets_state(xmlNode * xml_tickets, pe_working_set_t * data_set) ++{ ++ xmlNode *xml_obj = NULL; ++ ++ for (xml_obj = __xml_first_child(xml_tickets); xml_obj != NULL; xml_obj = __xml_next(xml_obj)) { ++ if (crm_str_eq((const char *)xml_obj->name, XML_CIB_TAG_TICKET_STATE, TRUE) == FALSE) { ++ continue; ++ } ++ unpack_ticket_state(xml_obj, data_set); ++ } ++ ++ return TRUE; ++} ++ ++/* Compatibility with the deprecated ticket state section: ++ * "/cib/status/tickets/instance_attributes" */ + static void +-get_ticket_state(gpointer key, gpointer value, gpointer user_data) ++get_ticket_state_legacy(gpointer key, gpointer value, gpointer user_data) + { +- const char *attr_key = key; ++ const char *long_key = key; ++ char *state_key = NULL; + + const char *granted_prefix = "granted-ticket-"; + const char *last_granted_prefix = "last-granted-"; +@@ -425,9 +510,10 @@ get_ticket_state(gpointer key, gpointer + const char *ticket_id = NULL; + const char *is_granted = NULL; + const char *last_granted = NULL; ++ const char *sep = NULL; + + ticket_t *ticket = NULL; +- GHashTable *tickets = user_data; ++ pe_working_set_t *data_set = user_data; + + if (granted_prefix_strlen == 0) { + granted_prefix_strlen = strlen(granted_prefix); +@@ -437,37 +523,41 @@ get_ticket_state(gpointer key, gpointer + last_granted_prefix_strlen = strlen(last_granted_prefix); + } + +- if (strstr(attr_key, granted_prefix) == attr_key) { +- ticket_id = attr_key + granted_prefix_strlen; ++ if (strstr(long_key, granted_prefix) == long_key) { ++ ticket_id = long_key + granted_prefix_strlen; + if (strlen(ticket_id)) { ++ state_key = crm_strdup("granted"); + is_granted = value; + } +- } else if (strstr(attr_key, last_granted_prefix) == attr_key) { +- ticket_id = attr_key + last_granted_prefix_strlen; ++ } else if (strstr(long_key, last_granted_prefix) == long_key) { ++ ticket_id = long_key + last_granted_prefix_strlen; + if (strlen(ticket_id)) { ++ state_key = crm_strdup("last-granted"); + last_granted = value; + } ++ } else if ((sep = strrchr(long_key, '-'))) { ++ ticket_id = sep + 1; ++ state_key = strndup(long_key, strlen(long_key) - strlen(sep)); + } + + if (ticket_id == NULL || strlen(ticket_id) == 0) { + return; + } + +- ticket = g_hash_table_lookup(tickets, ticket_id); ++ if (state_key == NULL || strlen(state_key) == 0) { ++ return; ++ } ++ ++ ticket = g_hash_table_lookup(data_set->tickets, ticket_id); + if (ticket == NULL) { +- crm_malloc0(ticket, sizeof(ticket_t)); ++ ticket = ticket_new(ticket_id, data_set); + if (ticket == NULL) { +- crm_config_err("Cannot allocate ticket '%s'", ticket_id); + return; + } +- +- ticket->id = crm_strdup(ticket_id); +- ticket->granted = FALSE; +- ticket->last_granted = -1; +- +- g_hash_table_insert(tickets, crm_strdup(ticket->id), ticket); + } + ++ g_hash_table_replace(ticket->state, state_key, crm_strdup(value)); ++ + if (is_granted) { + if (crm_is_true(is_granted)) { + ticket->granted = TRUE; +@@ -482,15 +572,6 @@ get_ticket_state(gpointer key, gpointer + } + } + +-static void +-destroy_ticket(gpointer data) +-{ +- ticket_t *ticket = data; +- +- crm_free(ticket->id); +- crm_free(ticket); +-} +- + /* remove nodes that are down, stopping */ + /* create +ve rsc_to_node constraints between resources and the nodes they are running on */ + /* anything else? */ +@@ -508,24 +589,32 @@ unpack_status(xmlNode * status, pe_worki + + crm_debug_3("Beginning unpack"); + +- data_set->tickets = +- g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, destroy_ticket); ++ if (data_set->tickets == NULL) { ++ data_set->tickets = ++ g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, destroy_ticket); ++ } + + for (state = __xml_first_child(status); state != NULL; state = __xml_next(state)) { + if (crm_str_eq((const char *)state->name, XML_CIB_TAG_TICKETS, TRUE)) { +- xmlNode *tickets = state; +- GHashTable *attrs_hash = +- g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, ++ xmlNode *xml_tickets = state; ++ GHashTable *state_hash = NULL; ++ ++ /* Compatibility with the deprecated ticket state section: ++ * Unpack the attributes in the deprecated "/cib/status/tickets/instance_attributes" if it exists. */ ++ state_hash = g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, + g_hash_destroy_str); + +- unpack_instance_attributes(data_set->input, tickets, XML_TAG_ATTR_SETS, NULL, +- attrs_hash, NULL, TRUE, data_set->now); ++ unpack_instance_attributes(data_set->input, xml_tickets, XML_TAG_ATTR_SETS, NULL, ++ state_hash, NULL, TRUE, data_set->now); + +- g_hash_table_foreach(attrs_hash, get_ticket_state, data_set->tickets); ++ g_hash_table_foreach(state_hash, get_ticket_state_legacy, data_set); + +- if (attrs_hash) { +- g_hash_table_destroy(attrs_hash); ++ if (state_hash) { ++ g_hash_table_destroy(state_hash); + } ++ ++ /* Unpack the new "/cib/status/tickets/ticket_state"s */ ++ unpack_tickets_state(xml_tickets, data_set); + } + + if (crm_str_eq((const char *)state->name, XML_CIB_TAG_STATE, TRUE)) { +Index: pacemaker/lib/pengine/utils.c +=================================================================== +--- pacemaker.orig/lib/pengine/utils.c ++++ pacemaker/lib/pengine/utils.c +@@ -1373,3 +1373,53 @@ get_target_role(resource_t * rsc, enum r + *role = local_role; + return TRUE; + } ++ ++void ++destroy_ticket(gpointer data) ++{ ++ ticket_t *ticket = data; ++ ++ if (ticket->state) { ++ g_hash_table_destroy(ticket->state); ++ } ++ crm_free(ticket->id); ++ crm_free(ticket); ++} ++ ++ticket_t * ++ticket_new(const char *ticket_id, pe_working_set_t * data_set) ++{ ++ ticket_t *ticket = NULL; ++ ++ if (ticket_id == NULL || strlen(ticket_id) == 0) { ++ return NULL; ++ } ++ ++ if (data_set->tickets == NULL) { ++ data_set->tickets = ++ g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, destroy_ticket); ++ } ++ ++ ticket = g_hash_table_lookup(data_set->tickets, ticket_id); ++ if (ticket == NULL) { ++ ++ crm_malloc0(ticket, sizeof(ticket_t)); ++ if (ticket == NULL) { ++ crm_err("Cannot allocate ticket '%s'", ticket_id); ++ return NULL; ++ } ++ ++ crm_trace("Creaing ticket entry for %s", ticket_id); ++ ++ ticket->id = crm_strdup(ticket_id); ++ ticket->granted = FALSE; ++ ticket->last_granted = -1; ++ ticket->standby = FALSE; ++ ticket->state = g_hash_table_new_full(crm_str_hash, g_str_equal, ++ g_hash_destroy_str, g_hash_destroy_str); ++ ++ g_hash_table_insert(data_set->tickets, crm_strdup(ticket->id), ticket); ++ } ++ ++ return ticket; ++} +Index: pacemaker/lib/pengine/utils.h +=================================================================== +--- pacemaker.orig/lib/pengine/utils.h ++++ pacemaker/lib/pengine/utils.h +@@ -162,4 +162,7 @@ extern gboolean get_target_role(resource + extern resource_t *find_clone_instance(resource_t * rsc, const char *sub_id, + pe_working_set_t * data_set); + ++extern void destroy_ticket(gpointer data); ++extern ticket_t *ticket_new(const char * ticket_id, pe_working_set_t * data_set); ++ + #endif +Index: pacemaker/pengine/constraints.c +=================================================================== +--- pacemaker.orig/pengine/constraints.c ++++ pacemaker/pengine/constraints.c +@@ -2000,17 +2000,10 @@ unpack_rsc_ticket(xmlNode * xml_obj, pe_ + } + + if (ticket == NULL) { +- crm_malloc0(ticket, sizeof(ticket_t)); ++ ticket = ticket_new(ticket_str, data_set); + if (ticket == NULL) { +- crm_config_err("Cannot allocate ticket '%s'", ticket_str); + return FALSE; + } +- +- ticket->id = crm_strdup(ticket_str); +- ticket->granted = FALSE; +- ticket->last_granted = -1; +- +- g_hash_table_insert(data_set->tickets, crm_strdup(ticket->id), ticket); + } + + unpack_rsc_ticket_template(xml_obj, &expanded_xml, data_set); diff --git a/pacemaker-tickets-crm_simulate.diff b/pacemaker-tickets-crm_simulate.diff new file mode 100644 index 0000000..13fd2c3 --- /dev/null +++ b/pacemaker-tickets-crm_simulate.diff @@ -0,0 +1,97 @@ +commit 575e1964464f6df7de7b2fbb688469554cdec44f +Author: Gao,Yan +Date: Thu Mar 8 18:40:54 2012 +0800 + + Medium: Tools: crm_simulate - Implement the support of granting/revoking tickets for crm_simulate + +diff --git a/tools/crm_inject.c b/tools/crm_inject.c +index 44b5cad..610140b 100644 +--- a/tools/crm_inject.c ++++ b/tools/crm_inject.c +@@ -758,7 +758,7 @@ create_dotfile(pe_working_set_t * data_set, const char *dot_file, gboolean all_a + static void + modify_configuration(pe_working_set_t * data_set, + const char *quorum, GListPtr node_up, GListPtr node_down, GListPtr node_fail, +- GListPtr op_inject) ++ GListPtr op_inject, GListPtr ticket_grant, GListPtr ticket_revoke) + { + int rc = cib_ok; + GListPtr gIter = NULL; +@@ -817,6 +817,34 @@ modify_configuration(pe_working_set_t * data_set, + CRM_ASSERT(rc == cib_ok); + } + ++ for (gIter = ticket_grant; gIter != NULL; gIter = gIter->next) { ++ char *ticket = (char *)gIter->data; ++ char *attr_name = crm_concat("granted-ticket", ticket, '-'); ++ ++ quiet_log(" + Granting ticket %s\n", ticket); ++ rc = update_attr(global_cib, cib_sync_call | cib_scope_local, ++ XML_CIB_TAG_TICKETS, NULL, NULL, NULL, NULL, ++ attr_name, "true", TRUE); ++ ++ crm_free(attr_name); ++ ++ CRM_ASSERT(rc == cib_ok); ++ } ++ ++ for (gIter = ticket_revoke; gIter != NULL; gIter = gIter->next) { ++ char *ticket = (char *)gIter->data; ++ char *attr_name = crm_concat("granted-ticket", ticket, '-'); ++ ++ quiet_log(" + Revoking ticket %s\n", ticket); ++ rc = update_attr(global_cib, cib_sync_call | cib_scope_local, ++ XML_CIB_TAG_TICKETS, NULL, NULL, NULL, NULL, ++ attr_name, "false", TRUE); ++ ++ crm_free(attr_name); ++ ++ CRM_ASSERT(rc == cib_ok); ++ } ++ + for (gIter = op_inject; gIter != NULL; gIter = gIter->next) { + char *spec = (char *)gIter->data; + +@@ -971,6 +999,8 @@ static struct crm_option long_options[] = { + {"op-fail", 1, 0, 'F', "\t$rsc_$task_$interval@$node=$rc - Fail the specified task while running the simulation"}, + {"set-datetime", 1, 0, 't', "Set date/time"}, + {"quorum", 1, 0, 'q', "\tSpecify a value for quorum"}, ++ {"ticket-grant", 1, 0, 'g', "Grant a ticket"}, ++ {"ticket-revoke",1, 0, 'r', "Revoke a ticket"}, + + {"-spacer-", 0, 0, '-', "\nOutput Options:"}, + +@@ -1090,6 +1120,8 @@ main(int argc, char **argv) + GListPtr node_down = NULL; + GListPtr node_fail = NULL; + GListPtr op_inject = NULL; ++ GListPtr ticket_grant = NULL; ++ GListPtr ticket_revoke = NULL; + + xmlNode *input = NULL; + +@@ -1163,6 +1195,14 @@ main(int argc, char **argv) + modified++; + quorum = optarg; + break; ++ case 'g': ++ modified++; ++ ticket_grant = g_list_append(ticket_grant, optarg); ++ break; ++ case 'r': ++ modified++; ++ ticket_revoke = g_list_append(ticket_revoke, optarg); ++ break; + case 'a': + all_actions = TRUE; + break; +@@ -1249,7 +1289,8 @@ main(int argc, char **argv) + + if (modified) { + quiet_log("Performing requested modifications\n"); +- modify_configuration(&data_set, quorum, node_up, node_down, node_fail, op_inject); ++ modify_configuration(&data_set, quorum, node_up, node_down, node_fail, op_inject, ++ ticket_grant, ticket_revoke); + + rc = global_cib->cmds->query(global_cib, NULL, &input, cib_sync_call); + if (rc != cib_ok) { diff --git a/pacemaker.changes b/pacemaker.changes index f038dd7..efaca3e 100644 --- a/pacemaker.changes +++ b/pacemaker.changes @@ -1,3 +1,53 @@ +------------------------------------------------------------------- +Thu Mar 29 07:39:30 UTC 2012 - lmb@novell.com + +- Add provides to identify support level for tickets (bnc#752241) + +------------------------------------------------------------------- +Mon Mar 26 04:43:35 UTC 2012 - ygao@suse.com + +- Resolve coverity RESOURCE_LEAK, REVERSE_INULL and UNREACHABLE defects + +------------------------------------------------------------------- +Sun Mar 25 14:46:13 UTC 2012 - ygao@suse.com + +- Tools: crm_simulate - Support to grant/revoke/standby/activate + tickets from the new ticket state section (bnc#752241) + +------------------------------------------------------------------- +Sun Mar 25 09:03:42 UTC 2012 - ygao@suse.com + +- Tools: Add crm_ticket to be profiled by valgrind +- Tools: crm_ticket - Display the tickets that are referenced in + rsc_ticket constraints but have never been granted yet (bnc#752241) +- Tools: crm_mon - Support to display tickets (bnc#752242) + +------------------------------------------------------------------- +Sat Mar 24 10:51:24 UTC 2012 - ygao@suse.com + +- PE: Move the ticket state section to + "/cib/status/tickets/ticket_state" (bnc#752241) +- PE: Support to make tickets standby for relinquishing tickets + gracefully (bnc#752241) +- Tools: Implement a new crm_ticket (bnc#752241) +- Tools: Update CLI regression tests for the new crm_ticket +- Tools: Add CLI regression tests for ticket standby state +- PE: Update regression tests for the new ticket state section +- PE: Support to make tickets standby for relinquishing tickets + gracefully (regression tests) + +------------------------------------------------------------------- +Tue Mar 20 10:11:52 UTC 2012 - ygao@suse.com + +- Tools: crm_ticket - Granting/revoking tickets need user to confirm + unless "--force" option is used (bnc#752269) + +------------------------------------------------------------------- +Tue Mar 13 09:28:38 UTC 2012 - ygao@suse.com + +- Tools: Implement the support of granting/revoking tickets for + crm_simulate (bnc#752241) + ------------------------------------------------------------------- Tue Jan 17 05:33:09 UTC 2012 - ygao@suse.com diff --git a/pacemaker.spec b/pacemaker.spec index fd694ea..6fe8b2d 100644 --- a/pacemaker.spec +++ b/pacemaker.spec @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + %global pcmk_docdir %{_docdir}/%{name} %if 0%{?suse_version} %define _libexecdir %{_libdir} @@ -54,14 +55,35 @@ Patch7: pacemaker-abi-compliance.diff Patch8: pacemaker-stonith-timeout.diff Patch9: pacemaker-ptest-xml-text.diff Patch10: pacemaker-cib-new-segfault.diff -Patch20: fix-glib_h-include.patch +Patch11: pacemaker-tickets-crm_simulate.diff +Patch12: pacemaker-crm_ticket-force.diff +Patch13: pacemaker-ticket-last-granted-prefix.diff +Patch14: pacemaker-ticket-state.diff +Patch15: pacemaker-ticket-standby.diff +Patch16: pacemaker-crm_ticket.diff +Patch17: pacemaker-crm_ticket-tests-update.diff +Patch18: pacemaker-crm_ticket-tests-standby.diff +Patch19: pacemaker-ticket-state-tests.diff +Patch20: pacemaker-ticket-standby-tests.diff +Patch21: pacemaker-log-fix.diff +Patch22: pacemaker-crm_ticket-valgrind.diff +Patch23: pacemaker-crm_ticket-all-tickets.diff +Patch24: pacemaker-crm_mon-tickets.diff +Patch25: pacemaker-crm_simulate-ticket-state.diff +Patch26: pacemaker-coverity-defects.diff +Patch100: fix-glib_h-include.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +Provides: pacemaker-ticket-support = 2.0 Conflicts: heartbeat < 3.0 # We need libglue2, not libheartbeat2 Conflicts: libheartbeat2 < 3.0.0 PreReq: cluster-glue >= 1.0.6 -Requires: resource-agents openais python python-xml -Requires: libpacemaker3 = %{version}-%{release} python-curses +Requires: libpacemaker3 = %{version}-%{release} +Requires: openais +Requires: python +Requires: python-curses +Requires: python-xml +Requires: resource-agents Recommends: crmsh BuildRequires: asciidoc BuildRequires: e2fsprogs-devel @@ -154,8 +176,8 @@ Summary: The Pacemaker scalable High-Availability cluster resource manage License: GPL-2.0 ; GPL-2.0+ ; LGPL-2.1+ Group: Development/Libraries/C and C++ Requires: %{name} = %{version}-%{release} -Requires: libpacemaker3 = %{version}-%{release} Requires: libglue-devel +Requires: libpacemaker3 = %{version}-%{release} %if %with_regression_tests # For the regression tests, we can run them only if all pacemaker # packages are installed, so we pull that in here for the regression @@ -193,7 +215,23 @@ Authors: %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 %patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch100 -p1 ########################################################### %build