diff --git a/shell/regression/regression.sh.in b/shell/regression/regression.sh.in index b659bd937f..5b388e5a76 100755 --- a/shell/regression/regression.sh.in +++ b/shell/regression/regression.sh.in @@ -1,237 +1,237 @@ #!/bin/sh # Copyright (C) 2007 Dejan Muhamedagic # # 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.1 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # rootdir=`dirname $0` TESTDIR=${TESTDIR:-$rootdir/testcases} DFLT_TESTSET=basicset OUTDIR=${OUTDIR:-crmtestout} CRM_OUTF="$OUTDIR/crm.out" CRM_LOGF="$OUTDIR/crm.log" CRM_DEBUGF="$OUTDIR/crm.debug" OUTF="$OUTDIR/regression.out" LRMD_OPTS="" -STONITHD_OPTS="-at" +STONITHD_OPTS="-s" DIFF_OPTS="--ignore-all-space -U 1" common_filter=$TESTDIR/common.filter common_exclf=$TESTDIR/common.excl LSB_RA=@INITDIR@/lrmregtest export OUTDIR logmsg() { echo "`date`: $*" | tee -a $CRM_DEBUGF | tee -a $CRM_LOGF } abspath() { echo $1 | grep -qs "^/" && echo $1 || echo `pwd`/$1 } usage() { cat<$OUTF 2>&1 if [ "$SILENT" = 1 ]; then exec 3>/dev/null else exec 3>/dev/tty fi start_stonithd() { - $HA_BIN/stonithd -s 2>/dev/null + killall -0 stonithd 2>/dev/null if [ $? -ne 0 ]; then echo "starting stonithd" >&3 STOP_STONITHD=1 - $HA_BIN/stonithd $STONITHD_OPTS + $HA_BIN/stonithd $STONITHD_OPTS & sleep 1 - $HA_BIN/stonithd -s 2>/dev/null + killall -0 stonithd 2>/dev/null else STOP_STONITHD= fi } stop_stonithd() { if [ "$STOP_STONITHD" ]; then echo "stopping stonithd" >&3 - $HA_BIN/stonithd -k >/dev/null 2>&1 + killall stonithd >/dev/null 2>&1 fi } start_lrmd() { $HA_BIN/lrmd -s 2>/dev/null if [ $? -eq 3 ]; then echo "starting lrmd" >&3 STOP_LRMD=1 $HA_BIN/lrmd $LRMD_OPTS >$CRM_OUTF 2>&1 & sleep 1 $HA_BIN/lrmd -s 2>/dev/null else STOP_LRMD= fi } stop_lrmd() { if [ "$STOP_LRMD" ]; then echo "stopping lrmd" >&3 $HA_BIN/lrmd -k fi } cp_ra() { if [ ! -e $LSB_RA ]; then cp -p $rootdir/lrmregtest-lsb $LSB_RA lrmregtest_lsb=1 fi chmod +x $LSB_RA } rm_ra() { [ "$lrmregtest_lsb" ] && rm -f $LSB_RA } trap "stop_lrmd; stop_stonithd; rm_ra" EXIT cp_ra start_lrmd || exit $? start_stonithd || exit $? setenvironment() { filterf=$TESTDIR/$testcase.filter exclf=$TESTDIR/$testcase.excl log_filter=$TESTDIR/$testcase.log_filter expf=$TESTDIR/$testcase.exp outf=$OUTDIR/$testcase.out difff=$OUTDIR/$testcase.diff } filter_output() { { [ -x $common_filter ] && $common_filter || cat;} | { [ -f $common_exclf ] && egrep -vf $common_exclf || cat;} | { [ -x $filterf ] && $filterf || cat;} | { [ -f $exclf ] && egrep -vf $exclf || cat;} } dumpcase() { cat<&3 logmsg "BEGIN testcase $testcase" ( cd $rootdir ./evaltest.sh ) < $TESTDIR/$testcase > $outf 2>&1 filter_output < $outf | if [ "$prepare" ]; then echo " saving to expect file" >&3 cat > $expf else echo -n " checking..." >&3 if head -2 $expf | grep -qs '^ $difff if [ $? -ne 0 ]; then echo " FAIL" >&3 dumpcase return 1 else echo " PASS" >&3 rm -f $outf $difff fi fi sed -n "/BEGIN testcase $testcase/,\$p" $CRM_LOGF | { [ -x $log_filter ] && $log_filter || cat;} | egrep '(CRIT|ERROR):' logmsg "END testcase $testcase" } [ "$1" = prepare ] && { prepare=1; shift 1;} [ $# -eq 0 ] && set "set:$DFLT_TESTSET" for a; do if [ "$a" -a -f "$TESTDIR/$a" ]; then testcase=$a runtestcase else echo "$a" | grep -q "^set:" && TESTSET=$TESTDIR/`echo $a | sed 's/set://'` while read testcase; do runtestcase done < $TESTSET fi done if egrep -wv '(BEGIN|END) testcase' $OUTF >/dev/null then echo "seems like some tests failed or else something not expected" echo "check $OUTF and diff files in $OUTDIR" echo "in case you wonder what lrmd was doing, read $CRM_LOGF and $CRM_DEBUGF" exit 1 else rm -f $OUTF $CRM_OUTF fi >&3 diff --git a/shell/regression/testcases/basicset b/shell/regression/testcases/basicset index f58d29f92c..1d47f2f73a 100644 --- a/shell/regression/testcases/basicset +++ b/shell/regression/testcases/basicset @@ -1,7 +1,8 @@ confbasic confbasic-xml +delete node resource file shadow ra diff --git a/shell/regression/testcases/confbasic-xml.exp b/shell/regression/testcases/confbasic-xml.exp index d6a268245c..2d0c118d85 100644 --- a/shell/regression/testcases/confbasic-xml.exp +++ b/shell/regression/testcases/confbasic-xml.exp @@ -1,131 +1,130 @@ - - + - + - - - - - + + + + + - - + + - + \ No newline at end of file diff --git a/shell/regression/testcases/delete.exp b/shell/regression/testcases/delete.exp index da308cbeee..1c35f0bc09 100644 --- a/shell/regression/testcases/delete.exp +++ b/shell/regression/testcases/delete.exp @@ -1,83 +1,103 @@ .TRY Delete/Rename test .INP: configure .INP: # erase to start from scratch .INP: erase .INP: erase nodes .INP: # create one stonith so that verify does not complain .INP: primitive st stonith:ssh .INP: primitive d1 ocf:heartbeat:Dummy .INP: primitive d2 ocf:heartbeat:Dummy .INP: location d1-pref d1 100: node1 .INP: show -primitive st stonith:ssh primitive d1 ocf:heartbeat:Dummy primitive d2 ocf:heartbeat:Dummy +primitive st stonith:ssh location d1-pref d1 100: node1 .INP: _test .INP: rename d1 p1 +INFO: 12: resource references in location:d1-pref updated .INP: show -primitive st stonith:ssh -primitive p1 ocf:heartbeat:Dummy primitive d2 ocf:heartbeat:Dummy +primitive p1 ocf:heartbeat:Dummy +primitive st stonith:ssh location d1-pref p1 100: node1 .INP: # delete primitive .INP: delete d2 .INP: _test .INP: show -primitive st stonith:ssh primitive p1 ocf:heartbeat:Dummy +primitive st stonith:ssh location d1-pref p1 100: node1 .INP: # delete primitive with constraint .INP: delete p1 +INFO: 19: hanging location:d1-pref deleted .INP: _test .INP: show primitive st stonith:ssh .INP: primitive d1 ocf:heartbeat:Dummy .INP: location d1-pref d1 100: node1 .INP: _test .INP: # delete primitive belonging to a group .INP: primitive d2 ocf:heartbeat:Dummy .INP: _test .INP: group g1 d2 d1 +INFO: 28: resource references in location:d1-pref updated .INP: delete d2 .INP: show -primitive st stonith:ssh primitive d1 ocf:heartbeat:Dummy +primitive st stonith:ssh group g1 d1 location d1-pref g1 100: node1 .INP: _test .INP: delete g1 +INFO: 32: resource references in location:d1-pref updated .INP: show -primitive st stonith:ssh primitive d1 ocf:heartbeat:Dummy +primitive st stonith:ssh +location d1-pref d1 100: node1 .INP: verify .INP: # delete a group which is in a clone .INP: primitive d2 ocf:heartbeat:Dummy .INP: group g1 d2 d1 +INFO: 37: resource references in location:d1-pref updated .INP: clone c1 g1 +INFO: 38: resource references in location:d1-pref updated .INP: delete g1 +INFO: 39: resource references in location:d1-pref updated +INFO: 39: resource references in location:d1-pref updated .INP: show -primitive st stonith:ssh primitive d1 ocf:heartbeat:Dummy primitive d2 ocf:heartbeat:Dummy +primitive st stonith:ssh +location d1-pref d2 100: node1 .INP: _test .INP: group g1 d2 d1 +INFO: 42: resource references in location:d1-pref updated .INP: clone c1 g1 +INFO: 43: resource references in location:d1-pref updated .INP: _test .INP: # delete group from a clone (again) .INP: delete g1 +INFO: 46: resource references in location:d1-pref updated +INFO: 46: resource references in location:d1-pref updated .INP: show -primitive st stonith:ssh primitive d1 ocf:heartbeat:Dummy primitive d2 ocf:heartbeat:Dummy +primitive st stonith:ssh +location d1-pref d2 100: node1 .INP: _test .INP: group g1 d2 d1 +INFO: 49: resource references in location:d1-pref updated .INP: clone c1 g1 +INFO: 50: resource references in location:d1-pref updated .INP: # delete primitive and its group and their clone .INP: delete d2 d1 c1 g1 +INFO: 52: resource references in location:d1-pref updated +INFO: 52: resource references in location:d1-pref updated +INFO: 52: hanging location:d1-pref deleted .INP: show primitive st stonith:ssh .INP: _test .INP: # verify .INP: verify .INP: commit diff --git a/shell/regression/testcases/node.exp b/shell/regression/testcases/node.exp index c93c0d624a..b50e3db949 100644 --- a/shell/regression/testcases/node.exp +++ b/shell/regression/testcases/node.exp @@ -1,195 +1,195 @@ .TRY node show node1: normal .TRY node show node1 node1: normal .SETENV showobj=node1 .TRY node standby node1 -.EXT crm_standby -N 'node1' -v 'on' +.EXT crm_standby -N 'node1' -v 'on' .INP: configure .INP: _regtest on .INP: show xml node1 - + .TRY node online node1 -.EXT crm_standby -N 'node1' -v 'off' +.EXT crm_standby -N 'node1' -v 'off' .INP: configure .INP: _regtest on .INP: show xml node1 - + .TRY node attribute node1 set a1 "1 2 3" .EXT crm_attribute -t nodes -U 'node1' -n 'a1' -v '1 2 3' .INP: configure .INP: _regtest on .INP: show xml node1 - + .TRY node attribute node1 show a1 .EXT crm_attribute -G -t nodes -U 'node1' -n 'a1' scope=nodes name=a1 value=1 2 3 .INP: configure .INP: _regtest on .INP: show xml node1 - + .TRY node attribute node1 delete a1 .EXT crm_attribute -D -t nodes -U 'node1' -n 'a1' Deleted nodes attribute: id=nodes-node1-a1 name=a1 .INP: configure .INP: _regtest on .INP: show xml node1 - + .TRY node status-attr node1 set s1 "1 2 3" .EXT crm_attribute -t status -U 'node1' -n 's1' -v '1 2 3' .INP: configure .INP: _regtest on .INP: show xml node1 - + .TRY node status-attr node1 show s1 .EXT crm_attribute -G -t status -U 'node1' -n 's1' scope=status name=s1 value=(null) .INP: configure .INP: _regtest on .INP: show xml node1 - + .TRY node status-attr node1 delete s1 .EXT crm_attribute -D -t status -U 'node1' -n 's1' .INP: configure .INP: _regtest on .INP: show xml node1 - + diff --git a/shell/regression/testcases/ra.exp b/shell/regression/testcases/ra.exp index 4543a62179..d3e8fc90ed 100644 --- a/shell/regression/testcases/ra.exp +++ b/shell/regression/testcases/ra.exp @@ -1,114 +1,114 @@ .TRY RA interface .INP: ra .INP: providers IPaddr heartbeat .INP: providers Dummy heartbeat pacemaker .INP: info IPaddr ocf -Manages virtual IPv4 addresses (ocf:heartbeat:IPaddr) +Manages virtual IPv4 addresses (portable version) (ocf:heartbeat:IPaddr) This script manages IP alias IP addresses It can add an IP alias, or remove one. Parameters (* denotes required, [] the default): ip* (string): IPv4 address The IPv4 address to be configured in dotted quad notation, for example "192.168.1.1". nic (string, [eth0]): Network interface The base network interface on which the IP address will be brought online. If left empty, the script will try and determine this from the routing table. Do NOT specify an alias interface in the form eth0:1 or anything here; rather, specify the base interface only. cidr_netmask (string): Netmask The netmask for the interface in CIDR format. (ie, 24), or in dotted quad notation 255.255.255.0). If unspecified, the script will also try to determine this from the routing table. broadcast (string): Broadcast address Broadcast address associated with the IP. If left empty, the script will determine this from the netmask. iflabel (string): Interface label You can specify an additional label for your IP address here. lvs_support (boolean, [false]): Enable support for LVS DR Enable support for LVS Direct Routing configurations. In case a IP address is stopped, only move it to the loopback device to allow the local node to continue to service requests, but no longer advertise it on the network. local_stop_script (string): Script called when the IP is released local_start_script (string): Script called when the IP is added ARP_INTERVAL_MS (integer, [500]): milliseconds between gratuitous ARPs milliseconds between ARPs ARP_REPEAT (integer, [10]): repeat count How many gratuitous ARPs to send out when bringing up a new address ARP_BACKGROUND (boolean, [yes]): run in background run in background (no longer any reason to do this) ARP_NETMASK (string, [ffffffffffff]): netmask for ARP netmask for ARP - in nonstandard hexadecimal format. Operations' defaults (advisory minimum): start timeout=90 stop timeout=100 - monitor_0 interval=5s timeout=20s start-delay=0 + monitor_0 interval=5s timeout=20s .INP: info external/ssh stonith ssh STONITH external device (stonith:external/ssh) ssh-based Linux host reset Fine for testing, but not suitable for production! Parameters (* denotes required, [] the default): hostlist* (string): Hostlist The list of hosts that the STONITH device controls livedangerously (enum): Live Dangerously!! Set to "yes" if you want to risk your system's integrity. Of course, since this plugin isn't for production, using it in production at all is a bad idea. On the other hand, setting this parameter to yes makes it an even worse idea. Viva la Vida Loca! stonith-timeout (time, [60s]): How long to wait for the STONITH action to complete. Overrides the stonith-timeout cluster property priority (integer, [0]): The priority of the stonith resource. The lower the number, the higher the priority. Operations' defaults (advisory minimum): start timeout=15 stop timeout=15 status timeout=15 monitor_0 interval=15 timeout=15 start-delay=15 .INP: info lrmregtest lsb lsb:lrmregtest lrmregtest Operations' defaults (advisory minimum): start timeout=15 stop timeout=15 status timeout=15 restart timeout=15 force-reload timeout=15 monitor_0 interval=15 timeout=15 start-delay=15 diff --git a/shell/regression/testcases/resource.exp b/shell/regression/testcases/resource.exp index 5b687ec160..aca86da00f 100644 --- a/shell/regression/testcases/resource.exp +++ b/shell/regression/testcases/resource.exp @@ -1,392 +1,390 @@ .TRY resource status p0 .EXT crm_resource -W -r 'p0' resource p0 is NOT running .SETENV showobj=p3 .TRY resource start p3 .EXT crm_resource --meta -r 'p3' -p target-role -v 'Started' .INP: configure .INP: _regtest on .INP: show xml p3 - + .TRY resource stop p3 .EXT crm_resource --meta -r 'p3' -p target-role -v 'Stopped' .INP: configure .INP: _regtest on .INP: show xml p3 - + .SETENV showobj=c1 .TRY resource manage c1 .EXT crm_resource --meta -r 'c1' -p is-managed -v 'true' .INP: configure .INP: _regtest on .INP: show xml c1 - + .TRY resource unmanage c1 .EXT crm_resource --meta -r 'c1' -p is-managed -v 'false' .INP: configure .INP: _regtest on .INP: show xml c1 - + .SETENV showobj=cli-prefer-p3 .TRY resource migrate p3 -.EXT crm_resource -M -r 'p3' +.EXT crm_resource -M -r 'p3' Resource p3 not moved: not-active and no preferred location specified. Error performing operation: cib object missing .INP: configure .INP: _regtest on .INP: show xml cli-prefer-p3 - + .TRY resource migrate p3 node1 -.EXT crm_resource -M -r 'p3' -H 'node1' +.EXT crm_resource -M -r 'p3' --node='node1' .INP: configure .INP: _regtest on .INP: show xml cli-prefer-p3 - + .TRY resource unmigrate p3 .EXT crm_resource -U -r 'p3' .INP: configure .INP: _regtest on .INP: show xml cli-prefer-p3 - + .SETENV showobj=p0 .TRY resource param p0 set a0 "1 2 3" .EXT crm_resource -r 'p0' -p 'a0' -v '1 2 3' .INP: configure .INP: _regtest on .INP: show xml p0 - + .TRY resource param p0 show a0 .EXT crm_resource -r 'p0' -g 'a0' 1 2 3 .INP: configure .INP: _regtest on .INP: show xml p0 - + .TRY resource param p0 delete a0 .EXT crm_resource -r 'p0' -d 'a0' Deleted p0 option: id=p0-instance_attributes-a0 name=a0 .INP: configure .INP: _regtest on .INP: show xml p0 - + .TRY resource meta p0 set m0 123 .EXT crm_resource --meta -r 'p0' -p 'm0' -v '123' .INP: configure .INP: _regtest on .INP: show xml p0 - + .TRY resource meta p0 show m0 .EXT crm_resource --meta -r 'p0' -g 'm0' 123 .INP: configure .INP: _regtest on .INP: show xml p0 - + .TRY resource meta p0 delete m0 .EXT crm_resource --meta -r 'p0' -d 'm0' Deleted p0 option: id=p0-meta_attributes-m0 name=m0 .INP: configure .INP: _regtest on .INP: show xml p0 - + .TRY resource failcount p0 set node1 5 .EXT crm_failcount -r 'p0' -N 'node1' -v '5' .INP: configure .INP: _regtest on .INP: show xml p0 - + .TRY resource failcount p0 show node1 .EXT crm_failcount -r 'p0' -N 'node1' -G scope=status name=fail-count-p0 value=0 .INP: configure .INP: _regtest on .INP: show xml p0 - + .TRY resource failcount p0 delete node1 .EXT crm_failcount -r 'p0' -N 'node1' -D .INP: configure .INP: _regtest on .INP: show xml p0 - + .TRY resource cleanup p0 node1 .EXT crm_resource -C -r 'p0' -H 'node1' -Cleaning up p0 on node1 .INP: configure .INP: _regtest on .INP: show xml p0 - + .TRY resource cleanup p0 .EXT crm_resource -C -r 'p0' -H 'node1' -Cleaning up p0 on node1 .INP: configure .INP: _regtest on .INP: show xml p0 - +