Hello community,

here is the log from the commit of package resource-agents for openSUSE:Factory 
checked in at 2012-02-16 12:27:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/resource-agents (Old)
 and      /work/SRC/openSUSE:Factory/.resource-agents.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "resource-agents", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/resource-agents/resource-agents.changes  
2011-12-25 17:52:20.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.resource-agents.new/resource-agents.changes     
2012-02-16 12:27:40.000000000 +0100
@@ -1,0 +2,20 @@
+Tue Feb 14 03:19:59 UTC 2012 - [email protected]
+
+- ocf-shellfuncs: fix loglevel variable scope in ha_log
+- exportfs: fix monitor action for special characters and common
+  suffixes
+- apache: add support for IPv6 in monitor
+- iscsi: don't fail in stop or monitor if the portal is
+  ambiguous (bnc#740718)
+- ocf-tester: add -d and -q options
+- Medium: Tools: findif: Use most specific matching route (bnc#740738)
+- ldirectord: Allow IPv6 for NNTP, requires perl-IO-Socket-INET6 (bnc#669412)
+- SAPInstance/SAPDatabase: fix unique attribute in metadata (bnc#737673)
+- IPv6addr: handle a link-local address properly in send_ua
+- iSCSILogicalUnit: fix default for scsi_sn
+- named: make monitor work with IPv6 interfaces
+- slapd: exit with the right code if validation fails (it used to
+  exit always with the generic error code)
+- upstream cs: de3074
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ resource-agents.spec ++++++
--- /var/tmp/diff_new_pack.ifdFGR/_old  2012-02-16 12:27:43.000000000 +0100
+++ /var/tmp/diff_new_pack.ifdFGR/_new  2012-02-16 12:27:43.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package resource-agents
 #
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -15,7 +15,6 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-
 %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
 %global agents_docdir %{_defaultdocdir}/%{name}-%{version}
 %endif
@@ -114,6 +113,7 @@
 
 %package -n ldirectord
 Summary:        The Heartbeat Subsystem for High-Availability Linux
+Group:          Productivity/Clustering/HA
 Requires:       %{SSLeay} perl-libwww-perl ipvsadm
 Obsoletes:      heartbeat-ldirectord
 Provides:       heartbeat-ldirectord

++++++ resource-agents-3.9.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/configure.ac 
new/resource-agents/configure.ac
--- old/resource-agents/configure.ac    2011-12-09 06:05:01.000000000 +0100
+++ new/resource-agents/configure.ac    2012-02-02 04:57:16.000000000 +0100
@@ -896,7 +896,7 @@
 AC_MSG_RESULT([])
 AC_MSG_RESULT([$PACKAGE configuration:])
 AC_MSG_RESULT([  Version                  = ${VERSION}])
-AC_MSG_RESULT([  Build Version            = 
72fdc8b2a413ee2820f78a84c4afc1c66bc9bf9d])
+AC_MSG_RESULT([  Build Version            = 
de3074ce2c9718725a374bcd2199ebc077a7d796])
 AC_MSG_RESULT([  Features                 =${PKG_FEATURES}])
 AC_MSG_RESULT([])
 AC_MSG_RESULT([  Prefix                   = ${prefix}])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/Filesystem 
new/resource-agents/heartbeat/Filesystem
--- old/resource-agents/heartbeat/Filesystem    2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/heartbeat/Filesystem    2012-02-02 04:57:16.000000000 
+0100
@@ -1056,7 +1056,7 @@
 ocfs2) ocfs2_init
         CLUSTERSAFE=1
        ;;
-nfs|smbfs|none|gfs2|glusterfs) CLUSTERSAFE=1 # this is kind of safe too
+nfs|smbfs|cifs|none|gfs2|glusterfs)    CLUSTERSAFE=1 # this is kind of safe too
        ;;
 # add here CLUSTERSAFE=0 for all filesystems which are not
 # cluster aware and which, even if when mounted read-only,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/IPsrcaddr 
new/resource-agents/heartbeat/IPsrcaddr
--- old/resource-agents/heartbeat/IPsrcaddr     2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/heartbeat/IPsrcaddr     2012-02-02 04:57:16.000000000 
+0100
@@ -167,13 +167,20 @@
 srca_start() {
        srca_read $1
 
-       ip route replace $NETWORK dev $INTERFACE src $1 || \
-               errorexit "command 'ip route replace $NETWORK dev $INTERFACE 
src $1' failed"
+       rc=$?
+       if [ $rc = 0 ]; then 
+               rc=$OCF_SUCCESS
+               ocf_log info "The ip route has been already set.($NETWORK, 
$INTERFACE, $ROUTE_WO_SRC)"
+       else
+               ip route replace $NETWORK dev $INTERFACE src $1 || \
+                       errorexit "command 'ip route replace $NETWORK dev 
$INTERFACE src $1' failed"
 
-       $CMDCHANGE $ROUTE_WO_SRC src $1 || \
-               errorexit "command '$CMDCHANGE $ROUTE_WO_SRC src $1' failed"
+               $CMDCHANGE $ROUTE_WO_SRC src $1 || \
+                       errorexit "command '$CMDCHANGE $ROUTE_WO_SRC src $1' 
failed"
+               rc=$?
+       fi
 
-       return $?
+       return $rc
 }
 
 #
@@ -252,7 +259,6 @@
        else
            true
        fi         
-#      return $OCF_SUCCESS
        ;;
     *) #less than three decimal dots
        false;;
@@ -301,35 +307,14 @@
 #
 find_interface_generic() {
 
-  $IFCONFIG $IFCONFIG_A_OPT  |
-  while read ifname linkstuff
-  do
-    : Read gave us ifname = $ifname
-
-    read inet addr junk
-    : Read gave us inet = $inet addr = $addr
-
-    while
-      read line && [ "X$line" != "X" ]
-    do
-      : Nothing
-    done
-
-    case "$SYSTYPE" in
-      *BSD)
-               $IFCONFIG | grep "$BASEIP" -B`$IFCONFIG | grep -c inet` | grep 
"UP," | cut -d ":" -f 1
-               return 0;;
-      *)
-               : "comparing $BASEIP to $addr (from ifconfig)"
-               case $addr in
-                 addr:$BASEIP) echo $ifname; return $OCF_SUCCESS;;
-                 $BASEIP)      echo $ifname; return $OCF_SUCCESS;;
-               esac
-               continue;;
-    esac
-
-  done
-  return $OCF_ERR_GENERIC 
+       local iface=`$IP2UTIL -o -f inet addr show | grep "\ $BASEIP" \
+            | cut -d ' ' -f2 | grep -v '^ipsec[0-9][0-9]*$'`
+        if [ -z "$iface" ]; then
+            return $OCF_ERR_GENERIC
+        else 
+            echo $iface
+            return $OCF_SUCCESS
+        fi
 }
 
 
@@ -377,7 +362,6 @@
       
       Linux|SunOS)             
          IF=`find_interface "$BASEIP"`
-#        echo $IF
          if [ -z "$IF" ]; then
              return $OCF_NOT_RUNNING
          fi
@@ -404,7 +388,6 @@
 srca_validate_all() {
 
     check_binary $AWK
-    check_binary $IPROUTE
     check_binary $IFCONFIG
 
 #      The IP address should be in good shape
@@ -415,6 +398,10 @@
          exit $OCF_ERR_CONFIGURED
        fi
 
+       if ocf_is_probe; then
+         return $OCF_SUCCESS
+       fi
+
 #      We should serve this IP address of course
        if ip_status "$ipaddress"; then
          :
@@ -453,11 +440,19 @@
 
 ipaddress="$OCF_RESKEY_ipaddress"
 
+if [ "x$SYSTYPE" = "xLinux" ]; then
+       srca_validate_all
+fi
+
 findif_out=`$FINDIF -C`
 rc=$?
-[ $rc -ne 0 ] && exit $rc
+[ $rc -ne 0 ] && {
+    ocf_log err "[$FINDIF -C] failed"
+    exit $rc
+}
+
 INTERFACE=`echo $findif_out | awk '{print $1}'`
-NETWORK=`ip route list dev $INTERFACE scope link|grep -o '^[^ ]*'`
+NETWORK=`ip route list dev $INTERFACE scope link match $ipaddress|grep -o '^[^ 
]*'`
 
 case $1 in
        start)          srca_start $ipaddress
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/IPv6addr.c 
new/resource-agents/heartbeat/IPv6addr.c
--- old/resource-agents/heartbeat/IPv6addr.c    2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/heartbeat/IPv6addr.c    2012-02-02 04:57:16.000000000 
+0100
@@ -458,6 +458,11 @@
        src_sin6.sin6_family = AF_INET6;
        src_sin6.sin6_addr = *src_ip;
        src_sin6.sin6_port = 0;
+       if (IN6_IS_ADDR_LINKLOCAL(&src_sin6.sin6_addr) ||
+           IN6_IS_ADDR_MC_LINKLOCAL(&src_sin6.sin6_addr)) {
+               src_sin6.sin6_scope_id = ifindex;
+       }
+
        if (bind(fd, (struct sockaddr *)&src_sin6, sizeof(src_sin6)) < 0) {
                cl_log(LOG_ERR, "bind() failed: %s", strerror(errno));
                goto err;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/SAPDatabase 
new/resource-agents/heartbeat/SAPDatabase
--- old/resource-agents/heartbeat/SAPDatabase   2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/heartbeat/SAPDatabase   2012-02-02 04:57:16.000000000 
+0100
@@ -83,72 +83,72 @@
   <shortdesc lang="en">SAP system ID</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="DIR_EXECUTABLE" unique="1" required="0">
+ <parameter name="DIR_EXECUTABLE" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find sapstartsrv and 
sapcontrol.</longdesc>
   <shortdesc lang="en">path of sapstartsrv and sapcontrol</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="DBTYPE" unique="1" required="1">
+ <parameter name="DBTYPE" unique="0" required="1">
   <longdesc lang="en">The name of the database vendor you use. Set either: 
ORA,DB6,ADA</longdesc>
   <shortdesc lang="en">database vendor</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="NETSERVICENAME" unique="1" required="0">
+ <parameter name="NETSERVICENAME" unique="0" required="0">
   <longdesc lang="en">The Oracle TNS listener name.</longdesc>
   <shortdesc lang="en">listener name</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="DBJ2EE_ONLY" unique="1" required="0">
+ <parameter name="DBJ2EE_ONLY" unique="0" required="0">
   <longdesc lang="en">If you do not have a ABAP stack installed in the SAP 
database, set this to TRUE</longdesc>
   <shortdesc lang="en">only JAVA stack installed</shortdesc>
   <content type="boolean" default="false"/>
  </parameter>
- <parameter name="JAVA_HOME" unique="1" required="0">
+ <parameter name="JAVA_HOME" unique="0" required="0">
   <longdesc lang="en">This is only needed if the DBJ2EE_ONLY parameter is set 
to true. Enter the path to the Java SDK which is used by the SAP WebAS 
Java</longdesc>
   <shortdesc lang="en">Path to Java SDK</shortdesc>
   <content type="string" default=""/>
  </parameter>
- <parameter name="STRICT_MONITORING" unique="1" required="0">
+ <parameter name="STRICT_MONITORING" unique="0" required="0">
   <longdesc lang="en">This controls how the resource agent monitors the 
database. If set to true, it will use SAP tools to test the connect to the 
database. Do not use with Oracle, because it will result in unwanted failovers 
in case of an archiver stuck</longdesc>
   <shortdesc lang="en">Activates application level monitoring</shortdesc>
   <content type="boolean" default="false"/>
  </parameter>
- <parameter name="AUTOMATIC_RECOVER" unique="1" required="0">
+ <parameter name="AUTOMATIC_RECOVER" unique="0" required="0">
   <longdesc lang="en">The SAPDatabase resource agent tries to recover a failed 
start attempt automaticaly one time. This is done by running a forced abort of 
the RDBMS and/or executing recovery commands.</longdesc>
   <shortdesc lang="en">Enable or disable automatic startup recovery</shortdesc>
   <content type="boolean" default="false"/>
  </parameter>
- <parameter name="DIR_BOOTSTRAP" unique="1" required="0">
+ <parameter name="DIR_BOOTSTRAP" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find the J2EE instance 
bootstrap directory. e.g. /usr/sap/P01/J00/j2ee/cluster/bootstrap</longdesc>
   <shortdesc lang="en">path to j2ee bootstrap directory</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="DIR_SECSTORE" unique="1" required="0">
+ <parameter name="DIR_SECSTORE" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find the J2EE security 
store directory. e.g. /usr/sap/P01/SYS/global/security/lib/tools</longdesc>
   <shortdesc lang="en">path to j2ee secure store directory</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="DB_JARS" unique="1" required="0">
+ <parameter name="DB_JARS" unique="0" required="0">
   <longdesc lang="en">The full qualified filename of the jdbc driver for the 
database connection test. It will be automaticaly read from the 
bootstrap.properties file in Java engine 6.40 and 7.00. For Java engine 7.10 
and higher the parameter is mandatory.</longdesc>
   <shortdesc lang="en">file name of the jdbc driver</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="PRE_START_USEREXIT" unique="1" required="0">
+ <parameter name="PRE_START_USEREXIT" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find a script or 
program which should be executed before this resource gets started.</longdesc>
   <shortdesc lang="en">path to a pre-start script</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="POST_START_USEREXIT" unique="1" required="0">
+ <parameter name="POST_START_USEREXIT" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find a script or 
program which should be executed after this resource got started.</longdesc>
   <shortdesc lang="en">path to a post-start script</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="PRE_STOP_USEREXIT" unique="1" required="0">
+ <parameter name="PRE_STOP_USEREXIT" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find a script or 
program which should be executed before this resource gets stopped.</longdesc>
   <shortdesc lang="en">path to a pre-start script</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="POST_STOP_USEREXIT" unique="1" required="0">
+ <parameter name="POST_STOP_USEREXIT" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find a script or 
program which should be executed after this resource got stopped.</longdesc>
   <shortdesc lang="en">path to a post-start script</shortdesc>
   <content type="string" default="" />
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/SAPInstance 
new/resource-agents/heartbeat/SAPInstance
--- old/resource-agents/heartbeat/SAPInstance   2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/heartbeat/SAPInstance   2012-02-02 04:57:16.000000000 
+0100
@@ -72,7 +72,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
 <resource-agent name="SAPInstance">
-<version>2.12</version>
+<version>2.13</version>
 
 <shortdesc lang="en">Manages a SAP instance as an HA resource.</shortdesc>
 <longdesc lang="en">
@@ -100,12 +100,12 @@
   <shortdesc lang="en">Instance name: SID_INSTANCE_VIR-HOSTNAME</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="DIR_EXECUTABLE" unique="1" required="0">
+ <parameter name="DIR_EXECUTABLE" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find sapstartsrv and 
sapcontrol. Specify this parameter, if you have changed the SAP kernel 
directory location after the default SAP installation.</longdesc>
   <shortdesc lang="en">Path of sapstartsrv and sapcontrol</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="DIR_PROFILE" unique="1" required="0">
+ <parameter name="DIR_PROFILE" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find the SAP START 
profile. Specify this parameter, if you have changed the SAP profile directory 
location after the default SAP installation.</longdesc>
   <shortdesc lang="en">Path of start profile</shortdesc>
   <content type="string" default="" />
@@ -115,7 +115,7 @@
   <shortdesc lang="en">Start profile name</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="START_WAITTIME" unique="1" required="0">
+ <parameter name="START_WAITTIME" unique="0" required="0">
   <longdesc lang="en">After that time in seconds a monitor operation is 
executed by the resource agent. Does the monitor return SUCCESS, the start 
ishandled as SUCCESS. This is useful to resolve timing problems with e.g. the 
J2EE-Addin instance.Usually the resource agent waits until all services are 
started and the SAP Management Console reports a GREEN status. A double stack 
installation (ABAP + Java AddIn) consists of an ABAP dispatcher and aJAVA 
instance. Normally the start of the JAVA instance takes much longer than the 
start of the ABAP instance. For a JAVA Instance you may need to configure a 
much higher timeout for the start operation of the resource in Heartbeat. The 
disadvantage here is, that the discovery of a failed start by the cluster takes 
longer. Somebody might say: For me it is important, that the ABAP instance is 
up and running. A failure of the JAVA instance shall not cause a failover of 
the SAP instance.
 Actually the SAP MC reports a YELLOW status, if the JAVA instance of a double 
stack system fails. From the resource agent point of view YELLOW 
means:everything is OK. Setting START_WAITTIME to a lower value determines the 
resource agent to check the status of the instance during a start operation 
after that time. As it would wait normally for a GREEN status, now it reports 
SUCCESS to the cluster in case of a YELLOW status already after the specified 
time.
 
@@ -124,12 +124,12 @@
   <shortdesc lang="en">Check the successful start after that time (do not wait 
for J2EE-Addin)</shortdesc>
   <content type="string" default="3600" />
  </parameter>
- <parameter name="AUTOMATIC_RECOVER" unique="1" required="0">
+ <parameter name="AUTOMATIC_RECOVER" unique="0" required="0">
   <longdesc lang="en">The SAPInstance resource agent tries to recover a failed 
start attempt automaticaly one time. This is done by killing runing instance 
processes, removing the kill.sap file and executing cleanipc. Sometimes a 
crashed SAP instance leaves some processes and/or shared memory segments 
behind. Setting this option to true will try to remove those leftovers during a 
start operation. That is to reduce manual work for the administrator.</longdesc>
   <shortdesc lang="en">Enable or disable automatic startup recovery</shortdesc>
   <content type="boolean" default="false"/>
  </parameter>
- <parameter name="MONITOR_SERVICES" unique="1" required="0">
+ <parameter name="MONITOR_SERVICES" unique="0" required="0">
   <longdesc lang="en">Within a SAP instance there can be several services. 
Usually you will find the defined services in the START profile of the related 
instance (Attention: with SAP Release 7.10 the START profile content was moved 
to the instance profile). Not all of those services are worth to monitor by the 
cluster. For example you properly do not like to failover your SAP instance, if 
the central syslog collector daemon fails.
 Those services are monitored within the SAPInstance resource agent:
 
@@ -147,7 +147,7 @@
   <shortdesc lang="en">Services to monitor</shortdesc>
   <content type="string" 
default="disp+work|msg_server|enserver|enrepserver|jcontrol|jstart"/>
  </parameter>
-  <parameter name="SHUTDOWN_METHOD" unique="1" required="0">
+  <parameter name="SHUTDOWN_METHOD" unique="0" required="0">
   <longdesc lang="en">Usual a SAP Instance is stopped by the command 
'sapcontrol -nr InstanceNr -function Stop'. SHUTDOWN_METHOD=KILL means to kill 
the SAP Instance using OS commands. SAP processes of the instance are 
terminated with 'kill -9', shared memory is deleted with 'cleanipc' and the 
'kill.sap' file will be deleted. That method is much faster than the gracefull 
stop, but the instance does not have the chance to say goodbye to other 
SAPinstances in the same system. USE AT YOUR OWN RISK !!</longdesc>
   <shortdesc lang="en">Shutdown graceful or kill a SAP instance by terminating 
the processes. (normal|KILL)</shortdesc>
   <content type="string" default="normal"/>
@@ -174,22 +174,22 @@
   <shortdesc lang="en">Enqueue replication start profile name</shortdesc>
   <content type="string" default=""/>
  </parameter>
- <parameter name="PRE_START_USEREXIT" unique="1" required="0">
+ <parameter name="PRE_START_USEREXIT" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find a script or 
program which should be executed before this resource gets started.</longdesc>
   <shortdesc lang="en">Path to a pre-start script</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="POST_START_USEREXIT" unique="1" required="0">
+ <parameter name="POST_START_USEREXIT" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find a script or 
program which should be executed after this resource got started.</longdesc>
   <shortdesc lang="en">Path to a post-start script</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="PRE_STOP_USEREXIT" unique="1" required="0">
+ <parameter name="PRE_STOP_USEREXIT" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find a script or 
program which should be executed before this resource gets stopped.</longdesc>
   <shortdesc lang="en">Path to a pre-start script</shortdesc>
   <content type="string" default="" />
  </parameter>
- <parameter name="POST_STOP_USEREXIT" unique="1" required="0">
+ <parameter name="POST_STOP_USEREXIT" unique="0" required="0">
   <longdesc lang="en">The full qualified path where to find a script or 
program which should be executed after this resource got stopped.</longdesc>
   <shortdesc lang="en">Path to a post-start script</shortdesc>
   <content type="string" default="" />
@@ -321,6 +321,8 @@
     fi
   fi
 
+  sidadm="`echo $SID | tr '[:upper:]' '[:lower:]'`adm"
+
   [ -z "$DIR_EXECUTABLE" ] && abnormal_end "Cannot find sapstartsrv and 
sapcontrol executable, please set DIR_EXECUTABLE parameter!"
 
   if [ -z "$OCF_RESKEY_DIR_PROFILE" ]
@@ -360,8 +362,6 @@
     export LD_LIBRARY_PATH
   fi
 
-  sidadm="`echo $SID | tr '[:upper:]' '[:lower:]'`adm"
-
   return $OCF_SUCCESS
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/apache 
new/resource-agents/heartbeat/apache
--- old/resource-agents/heartbeat/apache        2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/heartbeat/apache        2012-02-02 04:57:16.000000000 
+0100
@@ -447,6 +447,15 @@
 <content type="string" default="/etc/apache2/envvars"/>
 </parameter>
 
+<parameter name="use_ipv6">
+<longdesc lang="en">
+We will try to detect if the URL (for monitor) is IPv6, but if
+that doesn't work set this to true to enforce IPv6.
+</longdesc>
+<shortdesc lang="en">use ipv6 with http clients</shortdesc>
+<content type="boolean" default="false"/>
+</parameter>
+
 </parameters>
 
 <actions>
@@ -585,7 +594,7 @@
   : OK
 else
   ocf_log err "Cannot parse config file [$CONFIGFILE]"
-  exit $OCF_ERR_CONFIGURED
+  exit $OCF_ERR_INSTALLED
 fi
 
 case $COMMAND in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/exportfs 
new/resource-agents/heartbeat/exportfs
--- old/resource-agents/heartbeat/exportfs      2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/heartbeat/exportfs      2012-02-02 04:57:16.000000000 
+0100
@@ -181,9 +181,12 @@
 
 exportfs_monitor ()
 {
-       # "grep -z" matches across newlines, which is necessary as
-       # exportfs output wraps lines for long export directory names
-       exportfs | grep -zqs 
"${OCF_RESKEY_directory}[[:space:]]*${OCF_RESKEY_clientspec}"
+       # exportfs output wraps lines for long export directory names.
+       # We unwrap here with sed.
+       # We then do a literal match on the full line (grep -x -F)
+       exportfs |
+               sed -e '$! N; s/\n[[:space:]]\+/ /; t; 
s/[[:space:]]\+\([^[:space:]]\+\)\(\n\|$\)/ \1\2/g; P;D;' |
+               grep -q -x -F "${OCF_RESKEY_directory} ${OCF_RESKEY_clientspec}"
 
 #Adapt grep status code to OCF return code
        case $? in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/http-mon.sh 
new/resource-agents/heartbeat/http-mon.sh
--- old/resource-agents/heartbeat/http-mon.sh   2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/heartbeat/http-mon.sh   2012-02-02 04:57:16.000000000 
+0100
@@ -15,8 +15,14 @@
 # default options for http clients
 # NB: We _always_ test a local resource, so it should be
 # safe to connect from the local interface.
-WGETOPTS="-O- -q -L --no-proxy --bind-address=127.0.0.1"
-CURLOPTS="-o - -Ss -L --interface lo"
+bind_address="127.0.0.1"
+curl_ipv6_opts=""
+if ocf_is_true "$OCF_RESKEY_use_ipv6" || echo "$STATUSURL" | grep -qs "::"; 
then
+       bind_address="::1"
+       curl_ipv6_opts="-g"
+fi
+WGETOPTS="-O- -q -L --no-proxy --bind-address=$bind_address"
+CURLOPTS="-o - -Ss -L --interface lo $curl_ipv6_opts"
 
 #
 # run the http client
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/iSCSILogicalUnit 
new/resource-agents/heartbeat/iSCSILogicalUnit
--- old/resource-agents/heartbeat/iSCSILogicalUnit      2011-12-09 
06:05:01.000000000 +0100
+++ new/resource-agents/heartbeat/iSCSILogicalUnit      2012-02-02 
04:57:16.000000000 +0100
@@ -53,7 +53,7 @@
 : ${OCF_RESKEY_scsi_id=${OCF_RESKEY_scsi_id_default}}
 # To have a reasonably unique default SCSI SN, use the first 8 bytes
 # of an MD5 hash of of $OCF_RESOURCE_INSTANCE
-sn=`echo -n "${OCF_RESOURCE_INSTANCE}" | openssl md5`
+sn=`echo -n "${OCF_RESOURCE_INSTANCE}" | openssl md5 | sed -e 's/(stdin)= //'`
 OCF_RESKEY_scsi_sn_default=${sn:0:8}
 : ${OCF_RESKEY_scsi_sn=${OCF_RESKEY_scsi_sn_default}}
 #######################################################################
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/iscsi 
new/resource-agents/heartbeat/iscsi
--- old/resource-agents/heartbeat/iscsi 2011-12-09 06:05:01.000000000 +0100
+++ new/resource-agents/heartbeat/iscsi 2012-02-02 04:57:16.000000000 +0100
@@ -274,7 +274,7 @@
        done
 }
 iscsi_status() {
-       if $disk_status $portal $OCF_RESKEY_target; then
+       if $disk_status "$portal" $OCF_RESKEY_target; then
                return $OCF_SUCCESS
        else
                return $OCF_NOT_RUNNING
@@ -316,11 +316,11 @@
 }
 
 iscsi_monitor() {
-       if $disk_status $portal $OCF_RESKEY_target; then
+       if $disk_status "$portal" $OCF_RESKEY_target; then
                return $OCF_SUCCESS
-    else
+       else
                return $OCF_NOT_RUNNING
-    fi
+       fi
 }
 
 #
@@ -388,7 +388,14 @@
    [ "$1" = status ] && exit $LSB_STATUS_STOPPED
    exit $OCF_ERR_GENERIC
 ;;
-2) exit $OCF_ERR_GENERIC;;
+2) [ "$1" = stop ] && {
+       iscsi_monitor || exit $OCF_SUCCESS
+   }
+   ocf_is_probe && {
+       iscsi_monitor; exit
+   }
+   exit $OCF_ERR_GENERIC
+;;
 3) ocf_is_probe && exit $OCF_NOT_RUNNING
    exit $OCF_ERR_GENERIC
 ;;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/named 
new/resource-agents/heartbeat/named
--- old/resource-agents/heartbeat/named 2011-12-09 06:05:01.000000000 +0100
+++ new/resource-agents/heartbeat/named 2012-02-02 04:57:16.000000000 +0100
@@ -274,7 +274,7 @@
    
     output=`$OCF_RESKEY_host $OCF_RESKEY_monitor_request 
$OCF_RESKEY_monitor_ip`
 
-    if [ $? -ne 0 ] || ! echo $output | grep -q '.* has address 
'"$OCF_RESKEY_monitor_response" 
+    if [ $? -ne 0 ] || ! echo $output | grep -q '.* has .*address 
'"$OCF_RESKEY_monitor_response" 
     then
        ocf_log err "named didn't answer properly for 
$OCF_RESKEY_monitor_request."
        ocf_log err "Expected: $OCF_RESKEY_monitor_response."
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/ocf-shellfuncs.in 
new/resource-agents/heartbeat/ocf-shellfuncs.in
--- old/resource-agents/heartbeat/ocf-shellfuncs.in     2011-12-09 
06:05:01.000000000 +0100
+++ new/resource-agents/heartbeat/ocf-shellfuncs.in     2012-02-02 
04:57:16.000000000 +0100
@@ -22,7 +22,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 # 
 
-# Build version: 72fdc8b2a413ee2820f78a84c4afc1c66bc9bf9d
+# Build version: de3074ce2c9718725a374bcd2199ebc077a7d796
 
 # TODO: Some of this should probably split out into a generic OCF
 # library for shell scripts, but for the time being, we'll just use it
@@ -181,6 +181,7 @@
 }
 
 ha_log() {
+       local loglevel
        [ none = "$HA_LOGFACILITY" ] && HA_LOGFACILITY=""
        # if we're connected to a tty, then output to stderr
        if tty >/dev/null; then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/rsyslog 
new/resource-agents/heartbeat/rsyslog
--- old/resource-agents/heartbeat/rsyslog       2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/heartbeat/rsyslog       2012-02-02 04:57:16.000000000 
+0100
@@ -204,6 +204,10 @@
        ocf_log err "undefined parameter:configfile"
        exit $OCF_ERR_CONFIGURED
 fi
+if [[ ! -f "$CONFIGFILE" ]]; then
+       ocf_log err "Config file $CONFIGFILE does not exist."
+       exit $OCF_ERR_CONFIGURED
+fi
 
 RSYSLOG_EXE="${OCF_RESKEY_rsyslog_binary-/sbin/rsyslogd}"
 if [[ ! -x "$RSYSLOG_EXE" ]]; then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/slapd 
new/resource-agents/heartbeat/slapd
--- old/resource-agents/heartbeat/slapd 2011-12-09 06:05:01.000000000 +0100
+++ new/resource-agents/heartbeat/slapd 2012-02-02 04:57:16.000000000 +0100
@@ -37,8 +37,8 @@
 
 # Initialization:
 
-: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/resource.d/heartbeat}
-. ${OCF_FUNCTIONS_DIR}/.ocf-shellfuncs
+: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
+. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
 
 : ${OCF_RESKEY_slapd="/usr/sbin/slapd"}
 : ${OCF_RESKEY_ldapsearch="ldapsearch"}
@@ -385,6 +385,7 @@
   local state
   local suffix
   local suffixes
+  local err_option="-err"
 
   slapd_status `slapd_pid`; state=$?
   if [ $state -eq $OCF_NOT_RUNNING ]; then
@@ -433,8 +434,9 @@
     options="$options -D '$bind_dn' -w '$password'"
   fi
 
+  [ -z "$1" ] && err_option=""
   for suffix in $suffixes; do
-    ocf_run -q "$ldapsearch" -H "$services" -b "$suffix" $options >/dev/null 
2>&1; result=$?
+    ocf_run -q $err_option "$ldapsearch" -H "$services" -b "$suffix" $options 
>/dev/null 2>&1; result=$?
 
     case "$result" in
       "0")
@@ -445,8 +447,10 @@
         return $OCF_ERR_CONFIGURED
         ;;
       *)
-        ocf_log err "slapd database with suffix '$suffix' unreachable."
-        state=$OCF_ERR_GENERIC
+        if [ -z "$1" ] || [ -n "$1" -a $result -ne 1 ]; then
+          ocf_log err "slapd database with suffix '$suffix' unreachable. exit 
code ($result)"
+          state=$OCF_ERR_GENERIC
+        fi
         ;;
     esac
   done
@@ -531,8 +535,8 @@
 esac
 
 slapd_validate_all
-
-[ $? -eq $OCF_SUCCESS ] || exit $?
+rc=$?
+[ $rc -eq $OCF_SUCCESS ] || exit $rc
 
 case $1 in
   status)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/tomcat 
new/resource-agents/heartbeat/tomcat
--- old/resource-agents/heartbeat/tomcat        2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/heartbeat/tomcat        2012-02-02 04:57:16.000000000 
+0100
@@ -26,7 +26,7 @@
 #   OCF_RESKEY_script_log  - A destination of the log of this script. Default 
/var/log/OCF_RESKEY_tomcat_name.log
 #   OCF_RESKEY_tomcat_stop_timeout  - Time-out at the time of the stop. 
Default is 5. DEPRECATED
 #   OCF_RESKEY_tomcat_suspend_trialcount  - The re-try number of times 
awaiting a stop. Default is 10. DEPRECATED
-#   OCF_RESKEY_tomcat_user  - A user name to start a resource. Default is root
+#   OCF_RESKEY_tomcat_user  - A user name to start a resource.
 #   OCF_RESKEY_statusurl - URL for state confirmation. Default is 
http://127.0.0.1:8080
 #   OCF_RESKEY_java_home - Home directory of Java. Default is none
 #   OCF_RESKEY_java_opts - Options to pass to Java JVM for start and stop. 
Default is none
@@ -82,8 +82,16 @@
 # 
 isalive_tomcat()
 {
-       pgrep -f "${SEARCH_STR}" > /dev/null 
+       if [ -f $CATALINA_PID ]; then
+               PID=`head -n 1 $CATALINA_PID`
+               # Retry message for restraint
+               kill -s 0 $PID >/dev/null 2>&1
+               return $?
+       fi
+       # No PID file
+       false
 }
+
 ############################################################################
 # Check tomcat process and service availability
 monitor_tomcat()
@@ -203,7 +211,10 @@
                sleep 1
                lapse_sec=`expr $lapse_sec + 1`
                ocf_log debug "stop_tomcat[$TOMCAT_NAME]: stop failed, killing 
with SIGKILL ($lapse_sec)"
-               pkill -KILL -f "${SEARCH_STR}"
+               if [ -f $CATALINA_PID ]; then
+                       PID=`head -n 1 $CATALINA_PID`
+                       kill -KILL $PID
+               fi
        done
 
        if [ ${CATALINA_ROTATE_LOG} = "YES" ]; then
@@ -214,12 +225,6 @@
        return $OCF_SUCCESS
 }
 
-status_tomcat()
-{
-       return $OCF_SUCCESS
-}
-
-
 metadata_tomcat()
 {
     cat <<END
@@ -383,6 +388,7 @@
 ### tomcat RA environment variables
 #
 
+COMMAND=$1
 TOMCAT_NAME="${OCF_RESKEY_tomcat_name-tomcat}"
 TOMCAT_CONSOLE="${OCF_RESKEY_script_log-/var/log/$TOMCAT_NAME.log}"
 RESOURCE_TOMCAT_USER="${OCF_RESKEY_tomcat_user-RUNASIS}"
@@ -398,20 +404,46 @@
 CATALINA_OPTS="-Dname=$TOMCAT_NAME ${OCF_RESKEY_catalina_opts}"
 CATALINA_ROTATE_LOG="${OCF_RESKEY_catalina_rotate_log-NO}"
 CATALINA_ROTATETIME="${OCF_RESKEY_catalina_rotatetime-86400}"
-SEARCH_STR="\\""${CATALINA_OPTS}"
+
+LSB_STATUS_STOPPED=3
+if [ $# -ne 1 ]; then
+       usage
+       exit $OCF_ERR_ARGS
+fi
+case "$COMMAND" in
+       meta-data) metadata_tomcat; exit $OCF_SUCCESS;;
+       help|usage) usage; exit $OCF_SUCCESS;;
+esac
+
+if [ ! -d "$JAVA_HOME" -o ! -d "$CATALINA_HOME" -o ! -d "$CATALINA_BASE" ]; 
then
+       case $COMMAND in
+               stop)           exit    $OCF_SUCCESS;;
+               monitor)        exit    $OCF_NOT_RUNNING;;
+               status)         exit    $LSB_STATUS_STOPPED;;
+       esac
+       ocf_log err "JAVA_HOME or CATALINA_HOME or CATALINA_BASE does not 
exist."
+       exit $OCF_ERR_INSTALLED
+fi
 
 export JAVA_HOME JAVA_OPTS CATALINA_HOME CATALINA_BASE CATALINA_PID 
CATALINA_OPTS
 
 JAVA=${JAVA_HOME}/bin/java
 
+if [ ! -x "$JAVA" ]; then
+       case $COMMAND in
+               stop)           exit    $OCF_SUCCESS;;
+               monitor)        exit    $OCF_NOT_RUNNING;;
+               status)         exit    $LSB_STATUS_STOPPED;;
+       esac
+       ocf_log err "java command does not exist."
+       exit $OCF_ERR_INSTALLED
+fi
+
 #
 # ------------------
 # the main script
 # ------------------
 # 
-
-COMMAND=$1
-
 case "$COMMAND" in
        start)
                ocf_log debug  "[$TOMCAT_NAME] Enter tomcat start"
@@ -428,7 +460,13 @@
                exit $func_status
                ;;
        status)
-               status_tomcat
+               if monitor_tomcat; then
+                 echo tomcat instance $TOMCAT_NAME is running
+                 exit $OCF_SUCCESS
+               else
+                 echo tomcat instance $TOMCAT_NAME is stopped
+                 exit $OCF_NOT_RUNNING
+               fi
                exit $?
                ;;
        monitor)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/heartbeat/varnish 
new/resource-agents/heartbeat/varnish
--- old/resource-agents/heartbeat/varnish       2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/heartbeat/varnish       2012-02-02 04:57:16.000000000 
+0100
@@ -234,8 +234,8 @@
     # SUCCES = contents of pidfile == running process id
     # NOTRUN = no pidfile, no running process
 
-    # check if pidfile exists
-    if [ -f $OCF_RESKEY_pid ]; then
+    # check if pidfile exists and larger than 0 bytes
+    if [ -s $OCF_RESKEY_pid ]; then
         # it does, now check if the pid exists
         pid=$(cat $OCF_RESKEY_pid)
         ocf_run kill -s 0 $pid
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/resource-agents.spec.in 
new/resource-agents/resource-agents.spec.in
--- old/resource-agents/resource-agents.spec.in 2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/resource-agents.spec.in 2012-02-02 04:57:16.000000000 
+0100
@@ -150,7 +150,6 @@
 
 %if 0%{?fedora} >= 11 || 0%{?centos_version} > 5 || 0%{?rhel} > 5
 CFLAGS="$(echo '%{optflags}')"
-%global conf_opt_rsctmpdir "--with-rsctmpdir=%{_var}/run/heartbeat/rsctmp"
 %global conf_opt_fatal "--enable-fatal-warnings=no"
 %else
 CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}"
@@ -243,11 +242,7 @@
 
 %{_includedir}/heartbeat
 
-%if 0%{?fedora} >= 11 || 0%{?centos_version} > 5 || 0%{?rhel} > 5
-%dir %{_var}/run/heartbeat/rsctmp
-%else
 %dir %attr (1755, root, root)  %{_var}/run/resource-agents
-%endif
 
 %{_mandir}/man7/*.7*
 %{_mandir}/man8/ocf-tester.8*
@@ -259,8 +254,14 @@
 
 %{_libdir}/heartbeat
 
-%if %{with rgmanager}
 %post -n resource-agents
+if [ $1 = 2 ]; then
+ if [ -d %{_var}/run/heartbeat/rsctmp ]; then
+  cp -fpr %{_var}/run/heartbeat/rsctmp/* %{_var}/run/resource-agents/ 
1>/dev/null 2>&1
+  rm -fr %{_var}/run/heartbeat/rsctmp
+ fi
+fi
+%if %{with rgmanager}
 ccs_update_schema > /dev/null 2>&1 ||:
 %endif
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/tools/findif.c 
new/resource-agents/tools/findif.c
--- old/resource-agents/tools/findif.c  2011-12-09 06:05:01.000000000 +0100
+++ new/resource-agents/tools/findif.c  2012-02-02 04:57:16.000000000 +0100
@@ -198,6 +198,7 @@
                ,       PROCROUTE);
                rc = OCF_ERR_GENERIC; goto out;
        }
+       *best_netmask = 0;
        while (fgets(buf, sizeof(buf), routefd) != NULL) {
                if (sscanf(buf, "%[^\t]\t%lx%lx%lx%lx%lx%lx%lx"
                ,       interface, &dest, &gw, &flags, &refcnt, &use
@@ -208,7 +209,7 @@
                        rc = OCF_ERR_GENERIC; goto out;
                }
                if ( (in->s_addr&mask) == (in_addr_t)(dest&mask)
-               &&      metric < best_metric) {
+               &&      metric <= best_metric && mask >= *best_netmask) {
                        best_metric = metric;
                        *best_netmask = mask;
                        strncpy(best_if, interface, best_iflen);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/tools/ocf-tester.8 
new/resource-agents/tools/ocf-tester.8
--- old/resource-agents/tools/ocf-tester.8      2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/tools/ocf-tester.8      2012-02-02 04:57:16.000000000 
+0100
@@ -1,4 +1,4 @@
-.TH OCF-TESTER "8" "June 2011" "ocf-tester" "System Administration Utilities"
+.TH OCF-TESTER "8" "January 2012" "Tool for testing if a cluster resource is 
OCF compliant" "System Administration Utilities"
 .SH NAME
 ocf-tester \- Part of the Linux-HA project
 .SH SYNOPSIS
@@ -11,6 +11,38 @@
 \fB\-h\fR
 This text
 .TP
+\fB\-v\fR
+Be verbose while testing
+.TP
+\fB\-q\fR
+Be quiet while testing
+.TP
+\fB\-d\fR
+Turn on RA debugging
+.TP
+\fB\-n\fR name
+Name of the resource
+.TP
+\fB\-o\fR name=value
+Name and value of any parameters required by the agent
+.TP
+\fB\-L\fR
+Use lrmadmin/lrmd for tests
+.PP
+Usage: ocf\-tester [\-Lh] \fB\-n\fR resource_name [\-o name=value]* 
/full/path/to/resource/agent
+.TP
+\fB\-h\fR
+This text
+.TP
+\fB\-v\fR
+Be verbose while testing
+.TP
+\fB\-q\fR
+Be quiet while testing
+.TP
+\fB\-d\fR
+Turn on RA debugging
+.TP
 \fB\-n\fR name
 Name of the resource
 .TP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/tools/ocf-tester.in 
new/resource-agents/tools/ocf-tester.in
--- old/resource-agents/tools/ocf-tester.in     2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/tools/ocf-tester.in     2012-02-02 04:57:16.000000000 
+0100
@@ -37,6 +37,14 @@
 
 num_errors=0
 
+info() {
+    [ "$quiet" -eq 1 ] && return
+    echo "$*"
+}
+debug() {
+    [ "$verbose" -eq 0 ] && return
+    echo "$*"
+}
 usage() {
     # make sure to output errors on stderr
     [ "x$1" = "x0" ] || exec >&2
@@ -47,6 +55,9 @@
     echo ""
     echo "Options:"
     echo "  -h                 This text"
+    echo "  -v                 Be verbose while testing"
+    echo "  -q                 Be quiet while testing"
+    echo "  -d                 Turn on RA debugging"
     echo "  -n name            Name of the resource"   
     echo "  -o name=value              Name and value of any parameters 
required by the agent"
     echo "  -L                 Use lrmadmin/lrmd for tests"
@@ -85,6 +96,7 @@
 done=0
 ra_args=""
 verbose=0
+quiet=0
 while test "$done" = "0"; do
     case "$1" in
        -n) OCF_RESOURCE_INSTANCE=$2; ra_args="$ra_args 
OCF_RESOURCE_INSTANCE=$2"; shift; shift;;
@@ -93,6 +105,8 @@
                ra_args="$ra_args OCF_RESKEY_$name='$value'"; shift; shift;;
        -L) use_lrmd=1; shift;;
        -v) verbose=1; shift;;
+       -d) export HA_debug=1; shift;;
+       -q) quiet=1; shift;;
        -?|--help) usage 0;;
        --version) echo "@PACKAGE_VERSION@"; exit 0;;
        -*) echo "unknown option: $1" >&2; usage 1;;
@@ -193,25 +207,20 @@
 lrm_test_command() {
        action="$1"
        msg="$2"
-       [ "$verbose" -eq 0 ] || echo "$msg"
+       debug "$msg"
        exec_resource $action "$lrm_ra_args"
 }
 
 test_permissions() {
     action=meta-data
-    msg=${1:-"Testing permissions with uid nobody"}
-    if [ $verbose -ne 0 ]; then
-       echo $msg
-    fi
+    debug ${1:-"Testing permissions with uid nobody"}
     su nobody -s /bin/sh $agent $action > /dev/null
 }
 
 test_metadata() {
     action=meta-data
     msg=${1:-"Testing: $action"}
-    if [ $verbose -ne 0 ]; then
-       echo $msg
-    fi
+    debug $msg
     bash $agent $action | (cd $DATADIR/resource-agents && $METADATA_LINT)
     rc=$?
     #echo rc: $rc
@@ -230,7 +239,7 @@
     if [ $verbose -eq 0 ]; then
        command_output=`bash $agent $action 2>&1`
     else
-       echo $msg
+       debug $msg
        bash $agent $action
     fi
     rc=$?
@@ -239,7 +248,7 @@
 }
 
 # Begin tests
-echo Beginning tests for $agent...
+info "Beginning tests for $agent..."
 
 if [ ! -f $agent ]; then
     assert 7 0 "Could not find file: $agent"
@@ -319,7 +328,7 @@
 test_command notify
 rc=$?
 if [ $rc -eq 3 ]; then
-    echo "* Your agent does not support the notify action (optional)"
+    info "* Your agent does not support the notify action (optional)"
 else
     assert $rc 0 "The notify action cannot fail and must return 0"
 fi
@@ -327,13 +336,13 @@
 test_command demote "Checking for demote action"
 if [ $? -eq 3 ]; then
     has_demote=0
-    echo "* Your agent does not support the demote action (optional)"
+    info "* Your agent does not support the demote action (optional)"
 fi
 
 test_command promote "Checking for promote action"
 if [ $? -eq 3 ]; then
     has_promote=0
-    echo "* Your agent does not support the promote action (optional)"
+    info "* Your agent does not support the promote action (optional)"
 fi
 
 if [ $has_promote -eq 1 -a $has_demote -eq 1 ]; then
@@ -359,7 +368,7 @@
     assert $? 0 "Demote failed" 1
 
 elif [ $has_promote -eq 0 -a $has_demote -eq 0 ]; then
-    echo "* Your agent does not support master/slave (optional)"
+    info "* Your agent does not support master/slave (optional)"
 
 else
     echo "* Your agent partially supports master/slave"
@@ -402,12 +411,12 @@
     test_command migrate_from "Checking for migrate_from action"
 fi
 if [ $? -eq 3 ]; then
-    echo "* Your agent does not support the migrate action (optional)"
+    info "* Your agent does not support the migrate action (optional)"
 fi
 
 test_command reload "Checking for reload action"
 if [ $? -eq 3 ]; then
-    echo "* Your agent does not support the reload action (optional)"
+    info "* Your agent does not support the reload action (optional)"
 fi
 
 if [ $num_errors -gt 0 ]; then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/tools/ocft/IPsrcaddr 
new/resource-agents/tools/ocft/IPsrcaddr
--- old/resource-agents/tools/ocft/IPsrcaddr    2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/tools/ocft/IPsrcaddr    2012-02-02 04:57:16.000000000 
+0100
@@ -7,7 +7,8 @@
        HangTimeout 20
 
 CASE-BLOCK required_args
-       Env OCF_RESKEY_ipaddress=127.0.0.3
+       Env OCF_RESKEY_ipaddress= # put here your IP
+       Env OCF_RESKEY_cidr_netmask= # and the netmask
 
 CASE-BLOCK default_status
        AgentRun stop
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/resource-agents/tools/ocft/apache 
new/resource-agents/tools/ocft/apache
--- old/resource-agents/tools/ocft/apache       2011-12-09 06:05:01.000000000 
+0100
+++ new/resource-agents/tools/ocft/apache       2012-02-02 04:57:16.000000000 
+0100
@@ -1,4 +1,5 @@
 # apache
+# make sure that your apache configuration loads mod_status
 
 CONFIG
        Agent apache
@@ -10,30 +11,25 @@
        /etc/init.d/apache2 start
        /etc/init.d/apache2 stop
 
-CASE-BLOCK required_args
-       Env OCF_RESKEY_statusurl=http://localhost/info2html.css
-       Env OCF_RESKEY_testregex='This is'
-
 CASE-BLOCK default_status
        AgentRun stop
 
 CASE-BLOCK prepare
-       Include required_args
        Include default_status
 
 CASE "check base env"
        Include prepare
        AgentRun start OCF_SUCCESS
 
-CASE "check base env: unset OCF_RESKEY_statusurl"
+CASE "check base env: set non-existing OCF_RESKEY_statusurl"
        Include prepare
-       Unenv OCF_RESKEY_statusurl
-       AgentRun start OCF_ERR_CONFIGURED
+       Env OCF_RESKEY_statusurl="yoyoyoyo"
+       AgentRun start OCF_ERR_GENERIC
 
-CASE "check base env: unset OCF_RESKEY_testregex"
+CASE "check base env: set non-existing OCF_RESKEY_configfile"
        Include prepare
-       Unenv OCF_RESKEY_testregex
-       AgentRun start OCF_ERR_CONFIGURED
+       Env OCF_RESKEY_configfile="/yoyoyoyo/nosuchfile"
+       AgentRun start OCF_ERR_INSTALLED
 
 CASE "normal start"
        Include prepare

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to