diff --git a/tools/crm_failcount b/tools/crm_failcount index f59346f818..1554917628 100755 --- a/tools/crm_failcount +++ b/tools/crm_failcount @@ -1,16 +1,18 @@ #!/bin/bash done=0 options="" +target=`uname -n` while test "$done" = "0"; do case "$1" in - -N|--node|-v|--attr-value|-i|--attr-id) options="$options $1 $2"; shift; shift;; + -N|--node) target="$2"; shift; shift;; + -v|--attr-value|-i|--attr-id) options="$options $1 $2"; shift; shift;; -Q|--quiet|-D|--delete-attr|-G|--get-value|-V|-VV|-VVV) options="$options $1"; shift;; -r|--resource-id) options="$options -n fail-count-$2"; shift; shift;; "") done=1;; *) echo "crm_failcount - A convenience wrapper for crm_attribute"; echo ""; crm_attribute -?; exit 1;; esac done -crm_attribute $options +crm_attribute -N $target $options -t status -d 0 diff --git a/tools/crm_standby b/tools/crm_standby index e0f41528d6..6656c2e71b 100755 --- a/tools/crm_standby +++ b/tools/crm_standby @@ -1,20 +1,49 @@ #!/bin/sh done=0 options="" target=`uname -n` -lifetime=forever +lifetime=0 +do_get=1 +op='g' while test "$done" = "0"; do case "$1" in -N|--node) target="$2"; shift; shift;; - -l|--lifetime) lifetime="$2"; shift; shift;; - -v|--attr-value|-i|--attr-id) options="$options $1 $2"; shift; shift;; - -D|--delete-attr|-Q|--quiet|-G|--get-value|-V|-VV|-VVV) options="$options $1"; shift;; + -v|--attr-value) options="$options $1 $2"; op=u; shift; shift;; + -D|--delete-attr) options="$options $1"; op=d; shift;; + -G|--get-value) options="$options $1"; op=g; shift;; + -i|--attr-id) options="$options $1 $2"; shift; shift;; + -l|--lifetime) options="$options $1 $2"; lifetime=1; shift; shift;; + -Q|--quiet|-V|-VV|-VVV) options="$options $1"; shift;; "") done=1;; *) echo "crm_standby - A convenience wrapper for crm_attribute"; echo ""; crm_attribute -?; exit 1;; esac done -# -G is harmless, supplying -v or -D cancels it out -crm_attribute -G -n standby -N $target -t $lifetime $options +case $op in + g) + crm_attribute -N $target -n standby $cmd $options -l forever 2>&1 > /dev/null + if [ $? = 0 ]; then + crm_attribute -N $target -n standby $options -l forever + exit 0 + fi + + crm_attribute -N $target -n standby $cmd $options -l reboot -d off + ;; + u) + if [ $lifetime = 0 ]; then + options="$options -l forever" + fi + crm_attribute -N $target -n standby $options + ;; + d) + if [ $lifetime = 0 ]; then + crm_attribute -N $target -n standby $options -l forever + crm_attribute -N $target -n standby $options -l reboot + + else + crm_attribute -N $target -n standby $options + fi + ;; +esac diff --git a/tools/regression.exp b/tools/regression.exp index 2e8575d36f..45577a40b4 100644 --- a/tools/regression.exp +++ b/tools/regression.exp @@ -1,769 +1,764 @@ Setting up shadow instance A new shadow instance was created. To begin using it paste the following into your shell: CIB_shadow=tools-regression ; export CIB_shadow The supplied command is considered dangerous. To prevent accidental destruction of the cluster, the --force flag is required in order to proceed. * Passed: cibadmin - Require --force for CIB erasure * Passed: cibadmin - Allow CIB erasure with --force * Passed: cibadmin - Query CIB * Passed: crm_attribute - Set cluster option * Passed: cibadmin - Query new cluster option * Passed: cibadmin - Query cluster options * Passed: cibadmin - Delete nvpair Call failed: The object already exists * Passed: cibadmin - Create operaton should fail with: -21, The object already exists * Passed: cibadmin - Modify cluster options section * Passed: cibadmin - Query updated cluster option * Passed: crm_attribute - Set duplicate cluster option Please choose from one of the matches above and suppy the 'id' with --attr-id * Passed: crm_attribute - Setting multiply defined cluster option should fail with -216, Could not set cluster option * Passed: crm_attribute - Set cluster option with -s -Deleted crm_config option/attribute: id=(null) name=cluster-delay +Deleted crm_config option: id=(null) name=cluster-delay * Passed: crm_attribute - Delete cluster option with -i * Passed: cibadmin - Create node entry * Passed: cibadmin - Create node status entry * Passed: crm_attribute - Create node attribute * Passed: cibadmin - Query new node attribute Digest: * Passed: cibadmin - Digest calculation Call failed: Update was older than existing configuration * Passed: cibadmin - Replace operation should fail with: -45, Update was older than existing configuration -Query failed for attribute standby (section=nodes, node=clusterNode-UUID, set=, xpath=//cib/configuration/nodes//node[@id='clusterNode-UUID']//nvpair[@id='standby-clusterNode-UUID' and @name='standby']): The object/attribute does not exist -Query failed for attribute standby (section=nodes, node=, set=clusterNode-UUID): The object/attribute does not exist -Query failed for attribute standby (section=status, node=clusterNode-UUID, set=, xpath=//cib/status//node_state[@id='clusterNode-UUID']//nvpair[@id='transient-standby-clusterNode-UUID' and @name='standby']): The object/attribute does not exist -Query failed for attribute standby (section=status, node=, set=clusterNode-UUID): The object/attribute does not exist -scope=status value=off +Error performing operation: The object/attribute does not exist +scope=status name=standby value=off * Passed: crm_standby - Default standby value - + * Passed: crm_standby - Set standby status -scope=nodes value=true +scope=nodes name=standby value=true - + * Passed: crm_standby - Query standby value -Deleted status option/attribute: id=(null) name=standby - -Deleted nodes option/attribute: id=(null) name=standby +Deleted nodes attribute: id=nodes-clusterNode-UUID-standby name=standby * Passed: crm_standby - Delete standby value * Passed: cibadmin - Create a resource * Passed: crm_resource - Create a resource meta attribute * Passed: crm_resource - Create a resource attribute dummy (ocf::pacemaker:Dummy) Stopped * Passed: crm_resource - List the configured resources * Passed: crm_resource - Set a resource's fail-count Resource dummy not migrated: not-active and no prefered location specified. Error performing operation: cib object missing * Passed: crm_resource - Require a destination when migrating a resource that is stopped Error performing operation: i.dont.exist is not a known node Error performing operation: The object/attribute does not exist * Passed: crm_resource - Don't support migration to non-existant locations * Passed: crm_resource - Migrate a resource * Passed: crm_resource - Un-migrate a resource