From cf07b3cd043c54d3f4199e157b99547257a3fa6a Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Nov 07 2013 23:13:13 +0000 Subject: import resource-agents-3.9.5-18.el7.src.rpm --- diff --git a/.resource-agents.metadata b/.resource-agents.metadata new file mode 100644 index 0000000..64286fa --- /dev/null +++ b/.resource-agents.metadata @@ -0,0 +1,2 @@ +9197b30780a0c462b34c7263b85a81c0efcff990 SOURCES/ClusterLabs-resource-agents-5434e96.tar.gz +8fc4d427e1d44de7eb0762dbb144db575b30e93a SOURCES/sap_redhat_cluster_connector-6353d27.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/bz10005924-default-apache-config.patch b/SOURCES/bz10005924-default-apache-config.patch new file mode 100644 index 0000000..c73a6c8 --- /dev/null +++ b/SOURCES/bz10005924-default-apache-config.patch @@ -0,0 +1,69 @@ +diff --git a/heartbeat/apache b/heartbeat/apache +index 726e8fb..1369804 100755 +--- a/heartbeat/apache ++++ b/heartbeat/apache +@@ -63,7 +63,8 @@ fi + LOCALHOST="http://localhost" + HTTPDOPTS="-DSTATUS" + DEFAULT_IBMCONFIG=/opt/IBMHTTPServer/conf/httpd.conf +-DEFAULT_NORMCONFIG="/etc/apache2/httpd.conf" ++DEFAULT_SUSECONFIG="/etc/apache2/httpd.conf" ++DEFAULT_RHELCONFIG="/etc/httpd/conf/httpd.conf" + # + # You can also set + # HTTPD +@@ -82,7 +83,8 @@ CMD=`basename $0` + # assumed if no config file is specified. If this command is + # invoked as *IBM*, then the default config file name is + # $DEFAULT_IBMCONFIG, otherwise the default config file +-# will be $DEFAULT_NORMCONFIG. ++# will be either $DEFAULT_RHELCONFIG or $DEFAULT_SUSECONFIG depending ++# on which is detected. + usage() { + cat <<-! + usage: $0 action +@@ -146,7 +148,7 @@ validate_default_config() { + # the relevant config is generated and valid. We're also taking + # this opportunity to enable mod_status if it's not present. + validate_default_suse_config() { +- if [ "$CONFIGFILE" = "$DEFAULT_NORMCONFIG" ] && \ ++ if [ "$CONFIGFILE" = "$DEFAULT_SUSECONFIG" ] && \ + grep -Eq '^Include[[:space:]]+/etc/apache2/sysconfig.d/include.conf' "$CONFIGFILE" + then + [ -x "/usr/sbin/a2enmod" ] && ocf_run -q /usr/sbin/a2enmod status +@@ -336,6 +338,16 @@ apache_monitor() { + esac + } + ++detect_default_config() ++{ ++ if [ -f $DEFAULT_SUSECONFIG ]; then ++ echo $DEFAULT_SUSECONFIG ++ else ++ echo $DEFAULT_RHELCONFIG ++ fi ++} ++ ++ + apache_meta_data(){ + cat < +@@ -373,7 +385,7 @@ This file is parsed to provide defaults for various other + resource agent parameters. + + configuration file path +- ++ + + + +@@ -548,7 +560,7 @@ find_httpd_prog() { + if [ "X$OCF_RESKEY_httpd" != X -a "X$HTTPD" != X ]; then + ocf_log info "Using $HTTPD as HTTPD" + fi +- DefaultConfig=$DEFAULT_NORMCONFIG ++ DefaultConfig=$(detect_default_config) + ;; + esac + } + diff --git a/SOURCES/bz1014641-VirtualDomain-syntax-error.patch b/SOURCES/bz1014641-VirtualDomain-syntax-error.patch new file mode 100644 index 0000000..f85a512 --- /dev/null +++ b/SOURCES/bz1014641-VirtualDomain-syntax-error.patch @@ -0,0 +1,25 @@ +From a165410d95a7976e5249530b08d4dbeca7a7df27 Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Wed, 2 Oct 2013 15:43:56 -0500 +Subject: [PATCH] Fix: VirtualDomain: Fixes comparison of uninitialized variable during force stop + +--- + heartbeat/VirtualDomain | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/heartbeat/VirtualDomain b/heartbeat/VirtualDomain +index b7ac912..04b4390 100755 +--- a/heartbeat/VirtualDomain ++++ b/heartbeat/VirtualDomain +@@ -295,7 +295,7 @@ VirtualDomain_Start() { + force_stop() + { + local out ex +- local status ++ local status=0 + + ocf_log info "Issuing forced shutdown (destroy) request for domain ${DOMAIN_NAME}." + out=$(virsh $VIRSH_OPTIONS destroy ${DOMAIN_NAME} 2>&1) +-- +1.7.1 + diff --git a/SOURCES/bz1016140-start-predefined-domains.patch b/SOURCES/bz1016140-start-predefined-domains.patch new file mode 100644 index 0000000..b96d0df --- /dev/null +++ b/SOURCES/bz1016140-start-predefined-domains.patch @@ -0,0 +1,47 @@ +From f00dcaf19467e3d96d9790d386b860b53ca381f9 Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Mon, 7 Oct 2013 19:37:43 -0500 +Subject: [PATCH] High: VirtualDomain: Ensure it is possible to manage a libvirt domain defined outside of VirtualDomain + +--- + heartbeat/VirtualDomain | 17 +++++++++++++++++ + 1 files changed, 17 insertions(+), 0 deletions(-) + +diff --git a/heartbeat/VirtualDomain b/heartbeat/VirtualDomain +index f7ed100..8d5e181 100755 +--- a/heartbeat/VirtualDomain ++++ b/heartbeat/VirtualDomain +@@ -257,6 +257,15 @@ VirtualDomain_Status() { + return $rc + } + ++verify_undefined() { ++ for dom in `virsh --connect=${OCF_RESKEY_hypervisor} list --all --name`; do ++ if [ "$dom" = "$DOMAIN_NAME" ]; then ++ virsh $VIRSH_OPTIONS undefine $DOMAIN_NAME > /dev/null 2>&1 ++ return ++ fi ++ done ++} ++ + VirtualDomain_Start() { + local snapshotimage + +@@ -276,6 +285,14 @@ VirtualDomain_Start() { + return $OCF_ERR_GENERIC + fi + ++ # Make sure domain is undefined before creating. ++ # The 'create' command guarantees that the domain will be ++ # undefined on shutdown, but requires the domain to be undefined. ++ # if a user defines the domain ++ # outside of this agent, we have to ensure that the domain ++ # is restored to an 'undefined' state before creating. ++ verify_undefined ++ + virsh $VIRSH_OPTIONS create ${OCF_RESKEY_config} + rc=$? + if [ $rc -ne 0 ]; then +-- +1.7.1 + diff --git a/SOURCES/bz799065-apache-simple-monitor.patch b/SOURCES/bz799065-apache-simple-monitor.patch new file mode 100644 index 0000000..8bccd70 --- /dev/null +++ b/SOURCES/bz799065-apache-simple-monitor.patch @@ -0,0 +1,118 @@ +From d2b7ff7208a7ad65cc8298eef4c4d32549c31d7b Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Tue, 10 Sep 2013 21:16:40 -0500 +Subject: [PATCH] Low: apache: Allow basic server request monitoring without + requiring server-status to be enabled + +By default, the apache agent attempts to detect the location +of the server-status url and retrieve the contents of that URL. +If no regex is set, all this agent does is verify some sort +of html file exists at the server-status url. Essentially in +the default use-case, the agent is just verifying that the agent +can successfully request something from the webserver. + +Requiring the user to enable the server-status feature +just to verify a request/response from the server shouldn't be +necessary. This patch allows the agent to fall back to +doing a basic http header request of the website's index +if the server-status check fails during a monitor... This will +only occur in the very basic use-case where a user has +not defined any statusurls, regex patterns, or custom test cases. +--- + heartbeat/apache | 54 ++++++++++++++++++++++++++++++++++++++++++++++----- + heartbeat/http-mon.sh | 9 +++++++++ + 2 files changed, 58 insertions(+), 5 deletions(-) + +diff --git a/heartbeat/apache b/heartbeat/apache +index 1369804..fac2a53 100755 +--- a/heartbeat/apache ++++ b/heartbeat/apache +@@ -308,16 +308,60 @@ apache_monitor_10() { + return $OCF_ERR_GENERIC + fi + } ++ ++# If the user has not provided any basic monitoring ++# information, allow the agent to verify the server is ++# healthy and capable of processing requests by requesting ++# the http header of website's index ++attempt_index_monitor_request() { ++ local indexpage="" ++ ++ if [ -n "$OCF_RESKEY_client" ]; then ++ if [ "$OCF_RESKEY_client" != "curl" ]; then ++ return 1; ++ fi ++ fi ++ if [ -n "$OCF_RESKEY_testregex" ]; then ++ return 1; ++ fi ++ if [ -n "$OCF_RESKEY_testregex10" ]; then ++ return 1; ++ fi ++ if [ -n "$OCF_RESKEY_testurl" ]; then ++ return 1; ++ fi ++ if [ -n "$OCF_RESKEY_statusurl" ]; then ++ return 1; ++ fi ++ if [ -n "$OCF_RESKEY_testconffile" ]; then ++ return 1; ++ fi ++ ++ indexpage=$(buildlocalurl) ++ ++ request_url_header $indexpage > /dev/null 2>&1 ++ if [ $? -ne 0 ]; then ++ return $OCF_ERR_GENERIC ++ fi ++ ocf_log info "Successfully retrieved http header at $indexpage" ++ return 0 ++} ++ + apache_monitor_basic() { + if ${ourhttpclient}_func "$STATUSURL" | grep -Ei "$TESTREGEX" > /dev/null + then + return $OCF_SUCCESS +- else +- if ! ocf_is_probe; then +- ocf_log err "Failed to access httpd status page." +- fi +- return $OCF_ERR_GENERIC + fi ++ ++ attempt_index_monitor_request ++ if [ $? -eq 0 ]; then ++ return $OCF_SUCCESS ++ fi ++ ++ if ! ocf_is_probe; then ++ ocf_log err "Failed to access httpd status page." ++ fi ++ return $OCF_ERR_GENERIC + } + apache_monitor() { + silent_status +diff --git a/heartbeat/http-mon.sh b/heartbeat/http-mon.sh +index d7b6182..fac19ef 100644 +--- a/heartbeat/http-mon.sh ++++ b/heartbeat/http-mon.sh +@@ -24,6 +24,15 @@ fi + WGETOPTS="-O- -q -L --no-proxy --bind-address=$bind_address" + CURLOPTS="-o - -Ss -L --interface lo $curl_ipv6_opts" + ++request_url_header() { ++ which curl >/dev/null 2>&1 ++ if [ $? -ne 0 ]; then ++ return 1 ++ fi ++ ++ curl -IL --connect-timeout 5 --interface lo $curl_ipv6_opts "$1" ++} ++ + # + # run the http client + # +-- +1.8.1 + diff --git a/SOURCES/bz884164-multi-lib-fixes.patch b/SOURCES/bz884164-multi-lib-fixes.patch new file mode 100644 index 0000000..e33710b --- /dev/null +++ b/SOURCES/bz884164-multi-lib-fixes.patch @@ -0,0 +1,53 @@ +diff --git a/heartbeat/Makefile.am b/heartbeat/Makefile.am +index 3a05974..777c6b1 100644 +--- a/heartbeat/Makefile.am ++++ b/heartbeat/Makefile.am +@@ -25,7 +25,7 @@ EXTRA_DIST = $(ocf_SCRIPTS) $(ocfcommon_DATA) \ + + INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/linux-ha + +-halibdir = $(libdir)/heartbeat ++halibdir = $(libexecdir)/heartbeat + + ocfdir = $(OCF_RA_DIR_PREFIX)/heartbeat + +diff --git a/heartbeat/ocf-directories.in b/heartbeat/ocf-directories.in +index 26004a3..6e0a9d5 100644 +--- a/heartbeat/ocf-directories.in ++++ b/heartbeat/ocf-directories.in +@@ -11,7 +11,7 @@ exec_prefix=@exec_prefix@ + : ${HA_RSCTMP:=@HA_RSCTMPDIR@} + : ${HA_RSCTMP_OLD:=@HA_VARRUNDIR@/heartbeat/rsctmp} + : ${HA_FIFO:=@localstatedir@/lib/heartbeat/fifo} +-: ${HA_BIN:=@libdir@/heartbeat} ++: ${HA_BIN:=@libexecdir@/heartbeat} + : ${HA_SBIN_DIR:=@sbindir@} + : ${HA_DATEFMT:="%Y/%m/%d_%T "} + : ${HA_DEBUGLOG:=/dev/null} +diff --git a/resource-agents.spec.in b/resource-agents.spec.in +index c306398..e9f0688 100644 +--- a/resource-agents.spec.in ++++ b/resource-agents.spec.in +@@ -255,7 +255,7 @@ rm -rf %{buildroot} + %dir %{_sysconfdir}/ha.d + %{_sysconfdir}/ha.d/shellfuncs + +-%{_libdir}/heartbeat ++%{_libexecdir}/heartbeat + + %post -n resource-agents + if [ $1 = 2 ]; then +diff --git a/tools/Makefile.am b/tools/Makefile.am +index 971db1c..3205bbd 100644 +--- a/tools/Makefile.am ++++ b/tools/Makefile.am +@@ -23,7 +23,7 @@ SUBDIRS = ocft + + INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include + +-halibdir = $(libdir)/heartbeat ++halibdir = $(libexecdir)/heartbeat + + EXTRA_DIST = ocf-tester.8 sfex_init.8 + + diff --git a/SOURCES/bz917681-VirtualDomain-heartbeat-updates.patch b/SOURCES/bz917681-VirtualDomain-heartbeat-updates.patch new file mode 100644 index 0000000..522cb86 --- /dev/null +++ b/SOURCES/bz917681-VirtualDomain-heartbeat-updates.patch @@ -0,0 +1,247 @@ +diff --git a/heartbeat/VirtualDomain b/heartbeat/VirtualDomain +index 50c1eaa..6582a16 100755 +--- a/heartbeat/VirtualDomain ++++ b/heartbeat/VirtualDomain +@@ -18,13 +18,11 @@ + + # Defaults + OCF_RESKEY_force_stop_default=0 +-OCF_RESKEY_hypervisor_default="$(virsh --quiet uri)" + OCF_RESKEY_autoset_utilization_cpu_default="true" + OCF_RESKEY_autoset_utilization_hv_memory_default="true" + OCF_RESKEY_migrateport_default=$(( 49152 + $(ocf_maybe_random) % 64 )) + + : ${OCF_RESKEY_force_stop=${OCF_RESKEY_force_stop_default}} +-: ${OCF_RESKEY_hypervisor=${OCF_RESKEY_hypervisor_default}} + : ${OCF_RESKEY_autoset_utilization_cpu=${OCF_RESKEY_autoset_utilization_cpu_default}} + : ${OCF_RESKEY_autoset_utilization_hv_memory=${OCF_RESKEY_autoset_utilization_hv_memory_default}} + : ${OCF_RESKEY_migrateport=${OCF_RESKEY_migrateport_default}} +@@ -67,9 +65,10 @@ for this virtual domain. + + Hypervisor URI to connect to. See the libvirt documentation for + details on supported URI formats. The default is system dependent. ++Determine your systems default uri by running 'virsh --quiet uri' + + Hypervisor URI +- ++ + + + +@@ -206,52 +205,18 @@ update_utilization() { + # Set options to be passed to virsh: + VIRSH_OPTIONS="--connect=${OCF_RESKEY_hypervisor} --quiet" + +-# A state file where we record the domain name: +-STATEFILE="${HA_RSCTMP}/VirtualDomain-${OCF_RESOURCE_INSTANCE}.state" +- +-VirtualDomain_Define() { +- local virsh_output +- local domain_name +- # Note: passing in the domain name from outside the script is +- # intended for testing and debugging purposes only. Don't do this +- # in production, instead let the script figure out the domain name +- # from the config file. You have been warned. +- if [ -z "$DOMAIN_NAME" ]; then +- # Spin until we have a domain name +- while true; do +- virsh_output=$( (virsh ${VIRSH_OPTIONS} define ${OCF_RESKEY_config}) 2>&1) +- domain_name=`echo "$virsh_output" | sed -n -e 's/Domain \(.*\) defined from .*$/\1/p'` +- if [ -n "$domain_name" ]; then +- break; +- fi +- domain_name=`echo $virsh_output | sed -n -e "s/.* '\(.*\)' already exists .*/\1/p"` +- if [ -n "$domain_name" ]; then +- break; +- fi +- ocf_log debug "Domain not defined yet, probably unable to connect to hypervisor. Retrying." +- sleep 1 +- done +- echo "$domain_name" > $STATEFILE +- ocf_log info "Domain name \"$domain_name\" saved to $STATEFILE." +- else +- ocf_log warn "Domain name ${DOMAIN_NAME} already defined, overriding configuration file ${OCF_RESKEY_config}. You should do this for testing only." +- fi +-} +- +-VirtualDomain_Cleanup_Statefile() { +- rm -f $STATEFILE || ocf_log warn "Failed to remove $STATEFILE during $__OCF_ACTION." +-} +- + VirtualDomain_Status() { + local try=0 + rc=$OCF_ERR_GENERIC + status="no state" + while [ "$status" = "no state" ]; do + try=$(($try + 1 )) +- status="`virsh $VIRSH_OPTIONS domstate $DOMAIN_NAME`" ++ status="`virsh $VIRSH_OPTIONS domstate $DOMAIN_NAME 2>&1`" + case "$status" in +- "shut off") +- # shut off: domain is defined, but not started ++ *"error:"*"Domain not found"*|"shut off") ++ # shut off: domain is defined, but not started, will not happen if ++ # domain is created but not defined ++ # Domain not found: domain is not defined and thus not started + ocf_log debug "Virtual domain $DOMAIN_NAME is currently $status." + rc=$OCF_NOT_RUNNING + ;; +@@ -264,7 +229,7 @@ VirtualDomain_Status() { + ocf_log debug "Virtual domain $DOMAIN_NAME is currently $status." + rc=$OCF_SUCCESS + ;; +- ""|"no state") ++ ""|*"Failed to reconnect to the hypervisor"*|"no state") + # Empty string may be returned when virsh does not + # receive a reply from libvirtd. + # "no state" may occur when the domain is currently +@@ -314,7 +279,7 @@ VirtualDomain_Start() { + return $OCF_ERR_GENERIC + fi + +- virsh $VIRSH_OPTIONS start ${DOMAIN_NAME} ++ virsh $VIRSH_OPTIONS create ${OCF_RESKEY_config} + rc=$? + if [ $rc -ne 0 ]; then + ocf_log error "Failed to start virtual domain ${DOMAIN_NAME}." +@@ -327,11 +292,33 @@ VirtualDomain_Start() { + return $OCF_SUCCESS + } + ++force_stop() ++{ ++ local out ex ++ local status ++ ++ ocf_log info "Issuing forced shutdown (destroy) request for domain ${DOMAIN_NAME}." ++ out=$(virsh $VIRSH_OPTIONS destroy ${DOMAIN_NAME} 2>&1) ++ ex=$? ++ echo >&2 "$out" ++ case $ex$out in ++ *"error:"*"domain is not running"*|*"error:"*"Domain not found"*) ++ : ;; # unexpected path to the intended outcome, all is well ++ [!0]*) ++ return $OCF_ERR_GENERIC ;; ++ 0*) ++ while [ $status != $OCF_NOT_RUNNING ]; do ++ VirtualDomain_Status ++ status=$? ++ done ;; ++ esac ++ return $OCF_SUCCESS ++} ++ + VirtualDomain_Stop() { + local i + local status + local shutdown_timeout +- local out ex + local needshutdown=1 + + VirtualDomain_Status +@@ -341,7 +328,8 @@ VirtualDomain_Stop() { + $OCF_SUCCESS) + if ocf_is_true $OCF_RESKEY_force_stop; then + # if force stop, don't bother attempting graceful shutdown. +- break; ++ force_stop ++ return $? + fi + + ocf_log info "Issuing graceful shutdown request for domain ${DOMAIN_NAME}." +@@ -370,9 +358,7 @@ VirtualDomain_Stop() { + status=$? + case $status in + $OCF_NOT_RUNNING) +- # This was a graceful shutdown. Clean +- # up and return. +- VirtualDomain_Cleanup_Statefile ++ # This was a graceful shutdown. + return $OCF_SUCCESS + ;; + $OCF_SUCCESS) +@@ -393,27 +379,11 @@ VirtualDomain_Stop() { + ocf_log info "Domain $DOMAIN_NAME already stopped." + return $OCF_SUCCESS + esac ++ + # OK. Now if the above graceful shutdown hasn't worked, kill + # off the domain with destroy. If that too does not work, + # have the LRM time us out. +- ocf_log info "Issuing forced shutdown (destroy) request for domain ${DOMAIN_NAME}." +- out=$(virsh $VIRSH_OPTIONS destroy ${DOMAIN_NAME} 2>&1) +- ex=$? +- echo >&2 "$out" +- # unconditionally clean up. +- VirtualDomain_Cleanup_Statefile +- case $ex$out in +- *"error:"*"domain is not running"*) +- : ;; # unexpected path to the intended outcome, all is well +- [!0]*) +- return $OCF_ERR_GENERIC ;; +- 0*) +- while [ $status != $OCF_NOT_RUNNING ]; do +- VirtualDomain_Status +- status=$? +- done ;; +- esac +- return $OCF_SUCCESS ++ force_stop + } + + VirtualDomain_Migrate_To() { +@@ -469,7 +439,6 @@ VirtualDomain_Migrate_To() { + return $OCF_ERR_GENERIC + else + ocf_log info "$DOMAIN_NAME: live migration to ${target_node} succeeded." +- VirtualDomain_Cleanup_Statefile + return $OCF_SUCCESS + fi + else +@@ -561,12 +530,15 @@ case $1 in + ;; + esac + ++OCF_RESKEY_hypervisor_default="$(virsh --quiet uri)" ++: ${OCF_RESKEY_hypervisor=${OCF_RESKEY_hypervisor_default}} ++ + # Everything except usage and meta-data must pass the validate test + VirtualDomain_Validate_All || exit $? + + # During a probe, it is permissible for the config file to not be + # readable (it might be on shared storage not available during the +-# probe). In that case, VirtualDomain_Define can't work and we're ++# probe). In that case, we're + # unable to get the domain name. Thus, we also can't check whether the + # domain is running. The only thing we can do here is to assume that + # it is not running. +@@ -575,21 +547,10 @@ if [ ! -r $OCF_RESKEY_config ]; then + [ "$__OCF_ACTION" = "stop" ] && exit $OCF_SUCCESS + fi + +-# Define the domain on startup, and re-define whenever someone deleted +-# the state file, or touched the config. +-if [ ! -e $STATEFILE ] || [ $OCF_RESKEY_config -nt $STATEFILE ]; then +- VirtualDomain_Define +-fi +-# By now, we should definitely be able to read from the state file. +-# If not, something went wrong. +-if [ ! -r $STATEFILE ]; then +- ocf_log err "$STATEFILE not found or unreadable. This is unexpected. Cannot determine domain name." +- exit $OCF_ERR_GENERIC +-fi +-# Finally, retrieve the domain name from the state file. +-DOMAIN_NAME=`cat $STATEFILE 2>/dev/null` ++# Retrieve the domain name from the xml file. ++DOMAIN_NAME=`egrep '.*.*$' ${OCF_RESKEY_config} | sed -e 's/.*\(.*\)<\/name>$/\1/' 2>/dev/null` + if [ -z $DOMAIN_NAME ]; then +- ocf_log err "$STATEFILE is empty. This is unexpected. Cannot determine domain name." ++ ocf_log err "This is unexpected. Cannot determine domain name." + exit $OCF_ERR_GENERIC + fi + +@@ -620,3 +581,4 @@ case $1 in + ;; + esac + exit $? ++ diff --git a/SOURCES/bz917681-VirtualDomain-heartbeat-updates_v2.patch b/SOURCES/bz917681-VirtualDomain-heartbeat-updates_v2.patch new file mode 100644 index 0000000..e4bf6ac --- /dev/null +++ b/SOURCES/bz917681-VirtualDomain-heartbeat-updates_v2.patch @@ -0,0 +1,36 @@ +From 34994edfb713cfda496b31ce9da3f893960caa1c Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Mon, 7 Oct 2013 19:33:42 -0500 +Subject: [PATCH] High: VirtualDomain: Fix ability to use default libvirt hypervisor without explicitly setting agent attribute + +--- + heartbeat/VirtualDomain | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/heartbeat/VirtualDomain b/heartbeat/VirtualDomain +index 04b4390..f7ed100 100755 +--- a/heartbeat/VirtualDomain ++++ b/heartbeat/VirtualDomain +@@ -202,9 +202,6 @@ update_utilization() { + fi + } + +-# Set options to be passed to virsh: +-VIRSH_OPTIONS="--connect=${OCF_RESKEY_hypervisor} --quiet" +- + VirtualDomain_Status() { + local try=0 + rc=$OCF_ERR_GENERIC +@@ -533,6 +530,9 @@ esac + OCF_RESKEY_hypervisor_default="$(virsh --quiet uri)" + : ${OCF_RESKEY_hypervisor=${OCF_RESKEY_hypervisor_default}} + ++# Set options to be passed to virsh: ++VIRSH_OPTIONS="--connect=${OCF_RESKEY_hypervisor} --quiet" ++ + # Everything except usage and meta-data must pass the validate test + VirtualDomain_Validate_All || exit $? + +-- +1.7.1 + diff --git a/SOURCES/bz917681-ipv6-send_ua-fix.patch b/SOURCES/bz917681-ipv6-send_ua-fix.patch new file mode 100644 index 0000000..eb99bb6 --- /dev/null +++ b/SOURCES/bz917681-ipv6-send_ua-fix.patch @@ -0,0 +1,743 @@ +From 72d9c7dbb01afb26faf141fbec17e2af70ea729c Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Mon, 4 Nov 2013 15:03:23 -0600 +Subject: [PATCH] High: IPv6addr: Split send_ua utility out of IPv6addr.c source so it can be re-used in IPaddr2 without requiring cluster-glue. + +--- + configure.ac | 3 +- + doc/man/Makefile.am | 2 +- + heartbeat/IPv6addr.c | 198 +++----------------------------------------- + heartbeat/IPv6addr_utils.c | 147 ++++++++++++++++++++++++++++++++ + heartbeat/Makefile.am | 14 ++- + heartbeat/send_ua.c | 127 ++++++++++++++++++++++++++++ + include/IPv6addr.h | 58 +++++++++++++ + include/Makefile.am | 2 +- + 8 files changed, 356 insertions(+), 195 deletions(-) + create mode 100644 heartbeat/IPv6addr_utils.c + create mode 100644 heartbeat/send_ua.c + create mode 100644 include/IPv6addr.h + +diff --git a/configure.ac b/configure.ac +index f88a20f..ac669d8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -714,7 +714,8 @@ AM_CONDITIONAL(USE_LIBNET, test "x$libnet_version" != "xnone" ) + dnl ************************************************************************ + dnl * Check for netinet/icmp6.h to enable the IPv6addr resource agent + AC_CHECK_HEADERS(netinet/icmp6.h,[],[],[#include ]) +-AM_CONDITIONAL(USE_IPV6ADDR, test "$ac_cv_header_netinet_icmp6_h" = yes && test "$ac_cv_header_heartbeat_glue_config_h" = yes) ++AM_CONDITIONAL(USE_IPV6ADDR_AGENT, test "$ac_cv_header_netinet_icmp6_h" = yes && test "$ac_cv_header_heartbeat_glue_config_h" = yes) ++AM_CONDITIONAL(IPV6ADDR_COMPATIBLE, test "$ac_cv_header_netinet_icmp6_h" = yes) + + dnl ======================================================================== + dnl Compiler flags +diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am +index 347c145..3bf569a 100644 +--- a/doc/man/Makefile.am ++++ b/doc/man/Makefile.am +@@ -134,7 +134,7 @@ man_MANS = ocf_heartbeat_AoEtarget.7 \ + ocf_heartbeat_vmware.7 \ + ocf_heartbeat_zabbixserver.7 + +-if USE_IPV6ADDR ++if USE_IPV6ADDR_AGENT + man_MANS += ocf_heartbeat_IPv6addr.7 + endif + +diff --git a/heartbeat/IPv6addr.c b/heartbeat/IPv6addr.c +index fab59f5..7c1d20d 100644 +--- a/heartbeat/IPv6addr.c ++++ b/heartbeat/IPv6addr.c +@@ -86,6 +86,7 @@ + */ + + #include ++#include + + #include + #include +@@ -134,9 +135,7 @@ + #define OCF_ERR_CONFIGURED 6 + #define OCF_NOT_RUNNING 7 + +-const char* IF_INET6 = "/proc/net/if_inet6"; + const char* APP_NAME = "IPv6addr"; +-const char* APP_NAME_SUA = "send_ua"; + + const char* START_CMD = "start"; + const char* STOP_CMD = "stop"; +@@ -148,12 +147,8 @@ const char* RELOAD_CMD = "reload"; + const char* META_DATA_CMD = "meta-data"; + const char* VALIDATE_CMD = "validate-all"; + +-char BCAST_ADDR[] = "ff02::1"; +-const int UA_REPEAT_COUNT = 5; + const int QUERY_COUNT = 5; + +-#define HWADDR_LEN 6 /* mac address length */ +- + struct in6_ifreq { + struct in6_addr ifr6_addr; + uint32_t ifr6_prefixlen; +@@ -169,7 +164,6 @@ static int meta_data_addr6(void); + + + static void usage(const char* self); +-static void usage_send_ua(const char* self); + int write_pid_file(const char *pid_file); + int create_pid_directory(const char *pid_file); + static void byebye(int nsig); +@@ -181,7 +175,6 @@ static char* get_if(struct in6_addr* addr_target, int* plen_target, char* prov_i + static int assign_addr6(struct in6_addr* addr6, int prefix_len, char* if_name); + static int unassign_addr6(struct in6_addr* addr6, int prefix_len, char* if_name); + int is_addr6_available(struct in6_addr* addr6); +-static int send_ua(struct in6_addr* src_ip, char* if_name); + + int + main(int argc, char* argv[]) +@@ -190,40 +183,11 @@ main(int argc, char* argv[]) + char* ipv6addr; + char* cidr_netmask; + int ret; +- int count = UA_REPEAT_COUNT; +- int interval = 1000; /* default 1000 msec */ +- int senduaflg = 0; +- int ch; +- int i; + char* cp; + char* prov_ifname = NULL; + int prefix_len = -1; + struct in6_addr addr6; + +- /* Check binary name */ +- if (strcmp(basename(argv[0]), APP_NAME_SUA) == 0) { +- senduaflg = 1; +- if (argc < 4) { +- usage_send_ua(argv[0]); +- return OCF_ERR_ARGS; +- } +- while ((ch = getopt(argc, argv, "h?c:i:")) != EOF) { +- switch(ch) { +- case 'c': /* count option */ +- count = atoi(optarg); +- break; +- case 'i': /* interval option */ +- interval = atoi(optarg); +- break; +- case 'h': +- case '?': +- default: +- usage_send_ua(argv[0]); +- return OCF_ERR_ARGS; +- } +- } +- } +- + /* Check the count of parameters first */ + if (argc < 2) { + usage(argv[0]); +@@ -235,11 +199,7 @@ main(int argc, char* argv[]) + signal(SIGTERM, byebye); + + /* open system log */ +- if (senduaflg) { +- cl_log_set_entity(APP_NAME_SUA); +- } else { +- cl_log_set_entity(APP_NAME); +- } ++ cl_log_set_entity(APP_NAME); + cl_log_set_facility(LOG_DAEMON); + + /* the meta-data dont need any parameter */ +@@ -248,12 +208,9 @@ main(int argc, char* argv[]) + return OCF_SUCCESS; + } + +- if (senduaflg) { +- ipv6addr = argv[optind]; +- } else { +- /* check the OCF_RESKEY_ipv6addr parameter, should be an IPv6 address */ +- ipv6addr = getenv("OCF_RESKEY_ipv6addr"); +- } ++ /* check the OCF_RESKEY_ipv6addr parameter, should be an IPv6 address */ ++ ipv6addr = getenv("OCF_RESKEY_ipv6addr"); ++ + if (ipv6addr == NULL) { + cl_log(LOG_ERR, "Please set OCF_RESKEY_ipv6addr to the IPv6 address you want to manage."); + usage(argv[0]); +@@ -271,12 +228,9 @@ main(int argc, char* argv[]) + *cp=0; + } + +- if (senduaflg) { +- cidr_netmask = argv[optind+1]; +- } else { +- /* get provided netmask (optional) */ +- cidr_netmask = getenv("OCF_RESKEY_cidr_netmask"); +- } ++ /* get provided netmask (optional) */ ++ cidr_netmask = getenv("OCF_RESKEY_cidr_netmask"); ++ + if (cidr_netmask != NULL) { + if ((atol(cidr_netmask) < 0) || (atol(cidr_netmask) > 128)) { + cl_log(LOG_ERR, "Invalid prefix_len [%s], " +@@ -294,12 +248,9 @@ main(int argc, char* argv[]) + prefix_len = 0; + } + +- if (senduaflg) { +- prov_ifname = argv[optind+2]; +- } else { +- /* get provided interface name (optional) */ +- prov_ifname = getenv("OCF_RESKEY_nic"); +- } ++ /* get provided interface name (optional) */ ++ prov_ifname = getenv("OCF_RESKEY_nic"); ++ + if (inet_pton(AF_INET6, ipv6addr, &addr6) <= 0) { + cl_log(LOG_ERR, "Invalid IPv6 address [%s]", ipv6addr); + usage(argv[0]); +@@ -312,15 +263,6 @@ main(int argc, char* argv[]) + return OCF_ERR_GENERIC; + } + +- if (senduaflg) { +- /* Send unsolicited advertisement packet to neighbor */ +- for (i = 0; i < count; i++) { +- send_ua(&addr6, prov_ifname); +- usleep(interval * 1000); +- } +- return OCF_SUCCESS; +- } +- + /* create the pid file so we can make sure that only one IPv6addr + * for this address is running + */ +@@ -467,118 +409,6 @@ monitor_addr6(struct in6_addr* addr6, int prefix_len) + return OCF_NOT_RUNNING; + } + +-/* Send an unsolicited advertisement packet +- * Please refer to rfc4861 / rfc3542 +- */ +-int +-send_ua(struct in6_addr* src_ip, char* if_name) +-{ +- int status = -1; +- int fd; +- +- int ifindex; +- int hop; +- struct ifreq ifr; +- u_int8_t *payload = NULL; +- int payload_size; +- struct nd_neighbor_advert *na; +- struct nd_opt_hdr *opt; +- struct sockaddr_in6 src_sin6; +- struct sockaddr_in6 dst_sin6; +- +- if ((fd = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) == -1) { +- cl_log(LOG_ERR, "socket(IPPROTO_ICMPV6) failed: %s", +- strerror(errno)); +- return status; +- } +- /* set the outgoing interface */ +- ifindex = if_nametoindex(if_name); +- if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF, +- &ifindex, sizeof(ifindex)) < 0) { +- cl_log(LOG_ERR, "setsockopt(IPV6_MULTICAST_IF) failed: %s", +- strerror(errno)); +- goto err; +- } +- /* set the hop limit */ +- hop = 255; /* 255 is required. see rfc4861 7.1.2 */ +- if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, +- &hop, sizeof(hop)) < 0) { +- cl_log(LOG_ERR, "setsockopt(IPV6_MULTICAST_HOPS) failed: %s", +- strerror(errno)); +- goto err; +- } +- +- /* set the source address */ +- memset(&src_sin6, 0, sizeof(src_sin6)); +- 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; +- } +- +- +- /* get the hardware address */ +- memset(&ifr, 0, sizeof(ifr)); +- strncpy(ifr.ifr_name, if_name, sizeof(ifr.ifr_name) - 1); +- if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) { +- cl_log(LOG_ERR, "ioctl(SIOCGIFHWADDR) failed: %s", strerror(errno)); +- goto err; +- } +- +- /* build a neighbor advertisement message */ +- payload_size = sizeof(struct nd_neighbor_advert) +- + sizeof(struct nd_opt_hdr) + HWADDR_LEN; +- payload = memalign(sysconf(_SC_PAGESIZE), payload_size); +- if (!payload) { +- cl_log(LOG_ERR, "malloc for payload failed"); +- goto err; +- } +- memset(payload, 0, payload_size); +- +- /* Ugly typecast from ia64 hell! */ +- na = (struct nd_neighbor_advert *)((void *)payload); +- na->nd_na_type = ND_NEIGHBOR_ADVERT; +- na->nd_na_code = 0; +- na->nd_na_cksum = 0; /* calculated by kernel */ +- na->nd_na_flags_reserved = ND_NA_FLAG_OVERRIDE; +- na->nd_na_target = *src_ip; +- +- /* options field; set the target link-layer address */ +- opt = (struct nd_opt_hdr *)(payload + sizeof(struct nd_neighbor_advert)); +- opt->nd_opt_type = ND_OPT_TARGET_LINKADDR; +- opt->nd_opt_len = 1; /* The length of the option in units of 8 octets */ +- memcpy(payload + sizeof(struct nd_neighbor_advert) +- + sizeof(struct nd_opt_hdr), +- &ifr.ifr_hwaddr.sa_data, HWADDR_LEN); +- +- /* sending an unsolicited neighbor advertisement to all */ +- memset(&dst_sin6, 0, sizeof(dst_sin6)); +- dst_sin6.sin6_family = AF_INET6; +- inet_pton(AF_INET6, BCAST_ADDR, &dst_sin6.sin6_addr); /* should not fail */ +- +- if (sendto(fd, payload, payload_size, 0, +- (struct sockaddr *)&dst_sin6, sizeof(dst_sin6)) +- != payload_size) { +- cl_log(LOG_ERR, "sendto(%s) failed: %s", +- if_name, strerror(errno)); +- goto err; +- } +- +- status = 0; +- +-err: +- close(fd); +- free(payload); +- return status; +-} +- + /* find the network interface associated with an address */ + char* + scan_if(struct in6_addr* addr_target, int* plen_target, int use_mask, char* prov_ifname) +@@ -822,12 +652,6 @@ static void usage(const char* self) + return; + } + +-static void usage_send_ua(const char* self) +-{ +- printf("usage: %s [-i[=Interval]] [-c[=Count]] [-h] IPv6-Address Prefix Interface\n",self); +- return; +-} +- + /* Following code is copied from send_arp.c, linux-HA project. */ + void + byebye(int nsig) +diff --git a/heartbeat/IPv6addr_utils.c b/heartbeat/IPv6addr_utils.c +new file mode 100644 +index 0000000..7672b70 +--- /dev/null ++++ b/heartbeat/IPv6addr_utils.c +@@ -0,0 +1,147 @@ ++ ++/* ++ * This program manages IPv6 address with OCF Resource Agent standard. ++ * ++ * Author: Huang Zhen ++ * Copyright (c) 2004 International Business Machines ++ * ++ * This library 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 library 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 program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include /* for inet_pton */ ++#include /* for if_nametoindex */ ++#include ++#include ++#include ++#include ++ ++/* Send an unsolicited advertisement packet ++ * Please refer to rfc4861 / rfc3542 ++ */ ++int ++send_ua(struct in6_addr* src_ip, char* if_name) ++{ ++ int status = -1; ++ int fd; ++ ++ int ifindex; ++ int hop; ++ struct ifreq ifr; ++ u_int8_t *payload = NULL; ++ int payload_size; ++ struct nd_neighbor_advert *na; ++ struct nd_opt_hdr *opt; ++ struct sockaddr_in6 src_sin6; ++ struct sockaddr_in6 dst_sin6; ++ ++ if ((fd = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) == -1) { ++ printf("ERROR: socket(IPPROTO_ICMPV6) failed: %s", ++ strerror(errno)); ++ return status; ++ } ++ /* set the outgoing interface */ ++ ifindex = if_nametoindex(if_name); ++ if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF, ++ &ifindex, sizeof(ifindex)) < 0) { ++ printf("ERROR: setsockopt(IPV6_MULTICAST_IF) failed: %s", ++ strerror(errno)); ++ goto err; ++ } ++ /* set the hop limit */ ++ hop = 255; /* 255 is required. see rfc4861 7.1.2 */ ++ if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, ++ &hop, sizeof(hop)) < 0) { ++ printf("ERROR: setsockopt(IPV6_MULTICAST_HOPS) failed: %s", ++ strerror(errno)); ++ goto err; ++ } ++ ++ /* set the source address */ ++ memset(&src_sin6, 0, sizeof(src_sin6)); ++ 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) { ++ printf("ERROR: bind() failed: %s", strerror(errno)); ++ goto err; ++ } ++ ++ ++ /* get the hardware address */ ++ memset(&ifr, 0, sizeof(ifr)); ++ strncpy(ifr.ifr_name, if_name, sizeof(ifr.ifr_name) - 1); ++ if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0) { ++ printf("ERROR: ioctl(SIOCGIFHWADDR) failed: %s", strerror(errno)); ++ goto err; ++ } ++ ++ /* build a neighbor advertisement message */ ++ payload_size = sizeof(struct nd_neighbor_advert) ++ + sizeof(struct nd_opt_hdr) + HWADDR_LEN; ++ payload = memalign(sysconf(_SC_PAGESIZE), payload_size); ++ if (!payload) { ++ printf("ERROR: malloc for payload failed"); ++ goto err; ++ } ++ memset(payload, 0, payload_size); ++ ++ /* Ugly typecast from ia64 hell! */ ++ na = (struct nd_neighbor_advert *)((void *)payload); ++ na->nd_na_type = ND_NEIGHBOR_ADVERT; ++ na->nd_na_code = 0; ++ na->nd_na_cksum = 0; /* calculated by kernel */ ++ na->nd_na_flags_reserved = ND_NA_FLAG_OVERRIDE; ++ na->nd_na_target = *src_ip; ++ ++ /* options field; set the target link-layer address */ ++ opt = (struct nd_opt_hdr *)(payload + sizeof(struct nd_neighbor_advert)); ++ opt->nd_opt_type = ND_OPT_TARGET_LINKADDR; ++ opt->nd_opt_len = 1; /* The length of the option in units of 8 octets */ ++ memcpy(payload + sizeof(struct nd_neighbor_advert) ++ + sizeof(struct nd_opt_hdr), ++ &ifr.ifr_hwaddr.sa_data, HWADDR_LEN); ++ ++ /* sending an unsolicited neighbor advertisement to all */ ++ memset(&dst_sin6, 0, sizeof(dst_sin6)); ++ dst_sin6.sin6_family = AF_INET6; ++ inet_pton(AF_INET6, BCAST_ADDR, &dst_sin6.sin6_addr); /* should not fail */ ++ ++ if (sendto(fd, payload, payload_size, 0, ++ (struct sockaddr *)&dst_sin6, sizeof(dst_sin6)) ++ != payload_size) { ++ printf("ERROR: sendto(%s) failed: %s", ++ if_name, strerror(errno)); ++ goto err; ++ } ++ ++ status = 0; ++ ++err: ++ close(fd); ++ free(payload); ++ return status; ++} +diff --git a/heartbeat/Makefile.am b/heartbeat/Makefile.am +index 0ce1c13..3393640 100644 +--- a/heartbeat/Makefile.am ++++ b/heartbeat/Makefile.am +@@ -32,19 +32,23 @@ ocfdir = $(OCF_RA_DIR_PREFIX)/heartbeat + dtddir = $(datadir)/$(PACKAGE_NAME) + dtd_DATA = ra-api-1.dtd + +-if USE_IPV6ADDR ++if USE_IPV6ADDR_AGENT + ocf_PROGRAMS = IPv6addr +-halib_PROGRAMS = send_ua + else + ocf_PROGRAMS = ++endif ++ ++if IPV6ADDR_COMPATIBLE ++halib_PROGRAMS = send_ua ++else + halib_PROGRAMS = + endif + +-IPv6addr_SOURCES = IPv6addr.c +-send_ua_SOURCES = IPv6addr.c ++IPv6addr_SOURCES = IPv6addr.c IPv6addr_utils.c ++send_ua_SOURCES = send_ua.c IPv6addr_utils.c + + IPv6addr_LDADD = -lplumb $(LIBNETLIBS) +-send_ua_LDADD = -lplumb $(LIBNETLIBS) ++send_ua_LDADD = $(LIBNETLIBS) + + ocf_SCRIPTS = ClusterMon \ + CTDB \ +diff --git a/heartbeat/send_ua.c b/heartbeat/send_ua.c +new file mode 100644 +index 0000000..ef5357b +--- /dev/null ++++ b/heartbeat/send_ua.c +@@ -0,0 +1,127 @@ ++ ++/* ++ * This program manages IPv6 address with OCF Resource Agent standard. ++ * ++ * Author: Huang Zhen ++ * Copyright (c) 2004 International Business Machines ++ * ++ * This library 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 library 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 program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include /* for inet_pton */ ++#include /* for if_nametoindex */ ++#include ++#include ++#include ++#include ++ ++static void usage_send_ua(const char* self); ++static void byebye(int nsig); ++ ++int ++main(int argc, char* argv[]) ++{ ++ char* ipv6addr; ++ int count = UA_REPEAT_COUNT; ++ int interval = 1000; /* default 1000 msec */ ++ int ch; ++ int i; ++ char* cp; ++ char* prov_ifname = NULL; ++ struct in6_addr addr6; ++ ++ /* Check binary name */ ++ if (argc < 4) { ++ usage_send_ua(argv[0]); ++ return OCF_ERR_ARGS; ++ } ++ while ((ch = getopt(argc, argv, "h?c:i:")) != EOF) { ++ switch(ch) { ++ case 'c': /* count option */ ++ count = atoi(optarg); ++ break; ++ case 'i': /* interval option */ ++ interval = atoi(optarg); ++ break; ++ case 'h': ++ case '?': ++ default: ++ usage_send_ua(argv[0]); ++ return OCF_ERR_ARGS; ++ } ++ } ++ ++ /* set termination signal */ ++ siginterrupt(SIGTERM, 1); ++ signal(SIGTERM, byebye); ++ ++ ipv6addr = argv[optind]; ++ ++ if (ipv6addr == NULL) { ++ printf("ERROR: Please set OCF_RESKEY_ipv6addr to the IPv6 address you want to manage."); ++ usage_send_ua(argv[0]); ++ return OCF_ERR_ARGS; ++ } ++ ++ /* legacy option */ ++ if ((cp = strchr(ipv6addr, '/'))) { ++ *cp=0; ++ } ++ ++ prov_ifname = argv[optind+2]; ++ ++ if (inet_pton(AF_INET6, ipv6addr, &addr6) <= 0) { ++ printf("ERROR: Invalid IPv6 address [%s]", ipv6addr); ++ usage_send_ua(argv[0]); ++ return OCF_ERR_ARGS; ++ } ++ ++ /* Check whether this system supports IPv6 */ ++ if (access(IF_INET6, R_OK)) { ++ printf("ERROR: No support for INET6 on this system."); ++ return OCF_ERR_GENERIC; ++ } ++ ++ /* Send unsolicited advertisement packet to neighbor */ ++ for (i = 0; i < count; i++) { ++ send_ua(&addr6, prov_ifname); ++ usleep(interval * 1000); ++ } ++ ++ return OCF_SUCCESS; ++} ++ ++static void usage_send_ua(const char* self) ++{ ++ printf("usage: %s [-i[=Interval]] [-c[=Count]] [-h] IPv6-Address Prefix Interface\n",self); ++ return; ++} ++ ++/* Following code is copied from send_arp.c, linux-HA project. */ ++void ++byebye(int nsig) ++{ ++ (void)nsig; ++ /* Avoid an "error exit" log message if we're killed */ ++ exit(0); ++} ++ +diff --git a/include/IPv6addr.h b/include/IPv6addr.h +new file mode 100644 +index 0000000..720edf9 +--- /dev/null ++++ b/include/IPv6addr.h +@@ -0,0 +1,58 @@ ++/* ++ * This program manages IPv6 address with OCF Resource Agent standard. ++ * ++ * Author: Huang Zhen ++ * Copyright (c) 2004 International Business Machines ++ * ++ * This library 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 library 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 program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#ifndef OCF_IPV6_HELPER_H ++#define OCF_IPV6_HELPER_H ++#include ++#include ++/* ++0 No error, action succeeded completely ++1 generic or unspecified error (current practice) ++ The "monitor" operation shall return this for a crashed, hung or ++ otherwise non-functional resource. ++2 invalid or excess argument(s) ++ Likely error code for validate-all, if the instance parameters ++ do not validate. Any other action is free to also return this ++ exit status code for this case. ++3 unimplemented feature (for example, "reload") ++4 user had insufficient privilege ++5 program is not installed ++6 program is not configured ++7 program is not running ++8 resource is running in "master" mode and fully operational ++9 resource is in "master" mode but in a failed state ++*/ ++#define OCF_SUCCESS 0 ++#define OCF_ERR_GENERIC 1 ++#define OCF_ERR_ARGS 2 ++#define OCF_ERR_UNIMPLEMENTED 3 ++#define OCF_ERR_PERM 4 ++#define OCF_ERR_INSTALLED 5 ++#define OCF_ERR_CONFIGURED 6 ++#define OCF_NOT_RUNNING 7 ++ ++#define HWADDR_LEN 6 /* mac address length */ ++#define UA_REPEAT_COUNT 5 ++#define BCAST_ADDR "ff02::1" ++#define IF_INET6 "/proc/net/if_inet6" ++ ++int send_ua(struct in6_addr* src_ip, char* if_name); ++#endif +diff --git a/include/Makefile.am b/include/Makefile.am +index 5381ce0..6f46ec3 100644 +--- a/include/Makefile.am ++++ b/include/Makefile.am +@@ -21,4 +21,4 @@ MAINTAINERCLEANFILES = Makefile.in config.h.in config.h.in~ + idir=$(includedir)/heartbeat + i_HEADERS = agent_config.h + +-noinst_HEADERS = config.h ++noinst_HEADERS = config.h IPv6addr.h +-- +1.7.1 + diff --git a/SOURCES/bz917681-ocft_fedora_supported_test_cases.patch b/SOURCES/bz917681-ocft_fedora_supported_test_cases.patch new file mode 100644 index 0000000..4a5c648 --- /dev/null +++ b/SOURCES/bz917681-ocft_fedora_supported_test_cases.patch @@ -0,0 +1,7215 @@ +From 01587177c39423763f0ad7bbcc55adf22685d706 Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Wed, 6 Nov 2013 16:39:06 -0600 +Subject: [PATCH] fedora ocft + +--- + configure.ac | 9 + + tools/ocft/Filesystem | 110 -------------- + tools/ocft/IPaddr2 | 127 ---------------- + tools/ocft/IPaddr2v4 | 323 ---------------------------------------- + tools/ocft/IPaddr2v6 | 250 ------------------------------- + tools/ocft/IPsrcaddr | 63 -------- + tools/ocft/IPv6addr | 150 ------------------- + tools/ocft/LVM | 86 ----------- + tools/ocft/MailTo | 57 ------- + tools/ocft/Makefile.am | 67 ++++++--- + tools/ocft/Raid1 | 146 ------------------ + tools/ocft/SendArp | 74 --------- + tools/ocft/Xinetd | 56 ------- + tools/ocft/apache | 63 -------- + tools/ocft/db2 | 164 -------------------- + tools/ocft/default/Filesystem | 110 ++++++++++++++ + tools/ocft/default/IPaddr2 | 137 +++++++++++++++++ + tools/ocft/default/IPaddr2v4 | 323 ++++++++++++++++++++++++++++++++++++++++ + tools/ocft/default/IPaddr2v6 | 250 +++++++++++++++++++++++++++++++ + tools/ocft/default/IPsrcaddr | 63 ++++++++ + tools/ocft/default/IPv6addr | 150 +++++++++++++++++++ + tools/ocft/default/LVM | 86 +++++++++++ + tools/ocft/default/MailTo | 57 +++++++ + tools/ocft/default/Raid1 | 146 ++++++++++++++++++ + tools/ocft/default/SendArp | 74 +++++++++ + tools/ocft/default/Xinetd | 56 +++++++ + tools/ocft/default/apache | 63 ++++++++ + tools/ocft/default/db2 | 164 ++++++++++++++++++++ + tools/ocft/default/drbd.linbit | 183 +++++++++++++++++++++++ + tools/ocft/default/exportfs | 74 +++++++++ + tools/ocft/default/iscsi | 82 ++++++++++ + tools/ocft/default/jboss | 83 ++++++++++ + tools/ocft/default/mysql | 77 ++++++++++ + tools/ocft/default/mysql-proxy | 83 ++++++++++ + tools/ocft/default/named | 69 +++++++++ + tools/ocft/default/nfsserver | 75 +++++++++ + tools/ocft/default/oracle | 81 ++++++++++ + tools/ocft/default/pgsql | 71 +++++++++ + tools/ocft/default/portblock | 69 +++++++++ + tools/ocft/default/postfix | 102 +++++++++++++ + tools/ocft/default/tomcat | 73 +++++++++ + tools/ocft/drbd.linbit | 183 ----------------------- + tools/ocft/fedora/Filesystem | 110 ++++++++++++++ + tools/ocft/fedora/IPaddr2v4 | 323 ++++++++++++++++++++++++++++++++++++++++ + tools/ocft/fedora/IPaddr2v6 | 250 +++++++++++++++++++++++++++++++ + tools/ocft/fedora/IPsrcaddr | 61 ++++++++ + tools/ocft/fedora/SendArp | 73 +++++++++ + tools/ocft/fedora/Xinetd | 62 ++++++++ + tools/ocft/fedora/apache | 81 ++++++++++ + tools/ocft/fedora/mysql | 76 ++++++++++ + tools/ocft/fedora/nfsserver | 74 +++++++++ + tools/ocft/fedora/pgsql | 72 +++++++++ + tools/ocft/fedora/tomcat | 72 +++++++++ + tools/ocft/iscsi | 82 ---------- + tools/ocft/mysql | 77 ---------- + tools/ocft/mysql-proxy | 83 ---------- + tools/ocft/named | 69 --------- + tools/ocft/nfsserver | 75 --------- + tools/ocft/oracle | 81 ---------- + tools/ocft/pgsql | 71 --------- + tools/ocft/portblock | 69 --------- + tools/ocft/postfix | 102 ------------- + 62 files changed, 4108 insertions(+), 2584 deletions(-) + delete mode 100644 tools/ocft/Filesystem + delete mode 100644 tools/ocft/IPaddr2 + delete mode 100644 tools/ocft/IPaddr2v4 + delete mode 100644 tools/ocft/IPaddr2v6 + delete mode 100644 tools/ocft/IPsrcaddr + delete mode 100644 tools/ocft/IPv6addr + delete mode 100644 tools/ocft/LVM + delete mode 100644 tools/ocft/MailTo + delete mode 100644 tools/ocft/Raid1 + delete mode 100644 tools/ocft/SendArp + delete mode 100644 tools/ocft/Xinetd + delete mode 100644 tools/ocft/apache + delete mode 100644 tools/ocft/db2 + create mode 100644 tools/ocft/default/Filesystem + create mode 100644 tools/ocft/default/IPaddr2 + create mode 100644 tools/ocft/default/IPaddr2v4 + create mode 100644 tools/ocft/default/IPaddr2v6 + create mode 100644 tools/ocft/default/IPsrcaddr + create mode 100644 tools/ocft/default/IPv6addr + create mode 100644 tools/ocft/default/LVM + create mode 100644 tools/ocft/default/MailTo + create mode 100644 tools/ocft/default/Raid1 + create mode 100644 tools/ocft/default/SendArp + create mode 100644 tools/ocft/default/Xinetd + create mode 100644 tools/ocft/default/apache + create mode 100644 tools/ocft/default/db2 + create mode 100644 tools/ocft/default/drbd.linbit + create mode 100644 tools/ocft/default/exportfs + create mode 100644 tools/ocft/default/iscsi + create mode 100644 tools/ocft/default/jboss + create mode 100644 tools/ocft/default/mysql + create mode 100644 tools/ocft/default/mysql-proxy + create mode 100644 tools/ocft/default/named + create mode 100644 tools/ocft/default/nfsserver + create mode 100644 tools/ocft/default/oracle + create mode 100644 tools/ocft/default/pgsql + create mode 100644 tools/ocft/default/portblock + create mode 100644 tools/ocft/default/postfix + create mode 100644 tools/ocft/default/tomcat + delete mode 100644 tools/ocft/drbd.linbit + create mode 100644 tools/ocft/fedora/Filesystem + create mode 100644 tools/ocft/fedora/IPaddr2v4 + create mode 100644 tools/ocft/fedora/IPaddr2v6 + create mode 100644 tools/ocft/fedora/IPsrcaddr + create mode 100644 tools/ocft/fedora/SendArp + create mode 100644 tools/ocft/fedora/Xinetd + create mode 100644 tools/ocft/fedora/apache + create mode 100644 tools/ocft/fedora/mysql + create mode 100644 tools/ocft/fedora/nfsserver + create mode 100644 tools/ocft/fedora/pgsql + create mode 100644 tools/ocft/fedora/tomcat + delete mode 100644 tools/ocft/iscsi + delete mode 100644 tools/ocft/mysql + delete mode 100644 tools/ocft/mysql-proxy + delete mode 100644 tools/ocft/named + delete mode 100644 tools/ocft/nfsserver + delete mode 100644 tools/ocft/oracle + delete mode 100644 tools/ocft/pgsql + delete mode 100644 tools/ocft/portblock + delete mode 100644 tools/ocft/postfix + +diff --git a/configure.ac b/configure.ac +index d2d58cf..15344e0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -28,6 +28,7 @@ AC_USE_SYSTEM_EXTENSIONS + CRM_DTD_VERSION="1.0" + + PKG_FEATURES="" ++OCFT_TEST_CASES="default" + + AC_CONFIG_AUX_DIR(.) + AC_CANONICAL_HOST +@@ -56,6 +57,14 @@ AC_ARG_WITH(pkg-name, + [ --with-pkg-name=name Override package name (if you're a packager needing to pretend) ], + [ PACKAGE_NAME="$withval" ]) + ++ ++AC_ARG_WITH(ocft-cases, ++ [ --with-ocft-cases=cases Set which ocft test cases to install. ], ++ [ OCFT_TEST_CASES="$withval" ]) ++ ++AM_CONDITIONAL(OCFT_FEDORA_CASES, test "x$OCFT_TEST_CASES" = "xfedora" ) ++AM_CONDITIONAL(OCFT_DEFAULT_CASES, test "x$OCFT_TEST_CASES" = "xdefault" ) ++ + dnl + dnl AM_INIT_AUTOMAKE([1.11.1 foreign dist-bzip2 dist-xz]) + dnl +diff --git a/tools/ocft/Filesystem b/tools/ocft/Filesystem +deleted file mode 100644 +index 75203d7..0000000 +--- a/tools/ocft/Filesystem ++++ /dev/null +@@ -1,110 +0,0 @@ +-# Filesystem +-# by dejan@suse.de on +-# Tue Feb 15 18:50:04 CET 2011 +- +-CONFIG +- Agent Filesystem +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- HangTimeout 20 +- +-VARIABLE +- OCFT_fs=/var/run/resource-agents/ocft-Filesystem-fs +- OCFT_loop=/dev/loop7 +- OCFT_dir=/var/run/resource-agents/ocft-Filesystem-mnt +- +-SETUP-AGENT +- losetup $OCFT_loop 2>/dev/null && exit 1 +- rmdir $OCFT_dir 2>/dev/null || true +- mkdir $OCFT_dir +- dd if=/dev/zero of=$OCFT_fs bs=1 count=0 seek=16M 2>/dev/null +- mke2fs -j -Fq -m 0 $OCFT_fs +- losetup $OCFT_loop $OCFT_fs +- +-CLEANUP-AGENT +- rmdir $OCFT_dir +- rm $OCFT_fs +- losetup -d $OCFT_loop +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_device=$OCFT_loop +- Env OCF_RESKEY_fstype=ext3 +- Env OCF_RESKEY_directory=$OCFT_dir +- +-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: invalid 'OCF_RESKEY_device'" +- Include prepare +- Env OCF_RESKEY_device=/dev/no_such_device +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "check base env: unset 'OCF_RESKEY_device'" +- Include prepare +- Unenv OCF_RESKEY_device +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor when running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor when not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "monitor depth 10 when running" +- Include prepare +- AgentRun start +- Env OCF_CHECK_LEVEL=10 +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor depth 20 with running" +- Include prepare +- AgentRun start +- Env OCF_CHECK_LEVEL=20 +- AgentRun monitor OCF_SUCCESS +- +-CASE "start insert failure (remove device)" +- Include prepare +- Bash losetup -d $OCFT_loop +- BashAtExit losetup $OCFT_loop $OCFT_fs +- AgentRun start OCF_ERR_GENERIC +- +-CASE "monitor depth 20 insert failure (r/o fs)" +- Include prepare +- AgentRun start +- Bash mount -o remount,ro $OCFT_dir +- BashAtExit mount -o remount,rw $OCFT_dir +- Env OCF_CHECK_LEVEL=20 +- AgentRun monitor OCF_ERR_GENERIC +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +- +diff --git a/tools/ocft/IPaddr2 b/tools/ocft/IPaddr2 +deleted file mode 100644 +index bfa8283..0000000 +--- a/tools/ocft/IPaddr2 ++++ /dev/null +@@ -1,127 +0,0 @@ +-# IPaddr2 +- +-CONFIG +- Agent IPaddr2 +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- HangTimeout 20 +- +-SETUP-AGENT +- ip addr add 192.168.144.1/24 dev eth0 brd 192.168.144.255 +- +-CLEANUP-AGENT +- ip addr del 192.168.144.1/24 dev eth0 +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_ip=192.168.144.2 +- +-CASE-BLOCK check_iflabel_assigned +- Bash ip -4 -o addr show eth0 | grep -w 192.168.144.2/24 | grep -w eth0:iflabel >/dev/null # checking iflabel was assigned correctly +- +-CASE-BLOCK check_iflabel_removed +- Bash ! ip -4 -o addr show eth0 | grep -w 192.168.144.2/24 | grep -w eth0:iflabel >/dev/null # checking iflabel was removed correctly +- +-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_ip'" +- Include prepare +- Unenv OCF_RESKEY_ip +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: set invalid 'OCF_RESKEY_ip'" +- Include prepare +- Env OCF_RESKEY_ip=not_ip_address +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: set 'OCF_RESKEY_cidr_netmask'" +- Include prepare +- Env OCF_RESKEY_cidr_netmask=24 +- AgentRun start OCF_SUCCESS +- +-CASE "check base env: set invalid 'OCF_RESKEY_cidr_netmask'" +- Include prepare +- Env OCF_RESKEY_cidr_netmask=not_netmask +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: set 'OCF_RESKEY_broadcast'" +- Include prepare +- Env OCF_RESKEY_broadcast=192.168.144.255 +- AgentRun start OCF_SUCCESS +- +-CASE "check base env: set invalid 'OCF_RESKEY_broadcast'" +- Include prepare +- Env OCF_RESKEY_broadcast=not_broadcast +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: set 'OCF_RESKEY_nic'" +- Include prepare +- Env OCF_RESKEY_nic=eth0 +- AgentRun start OCF_SUCCESS +- +-CASE "check base env: set invalid 'OCF_RESKEY_nic'" +- Include prepare +- Env OCF_RESKEY_nic=not_nic +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor with running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor with not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +- +-CASE "Attachment to loopback interface" +- Env OCF_RESKEY_ip=127.0.0.3 +- AgentRun start OCF_SUCCESS +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- +-CASE "check additional env: set 'OCF_RESKEY_iflabel'" +- Include prepare +- Env OCF_RESKEY_nic=eth0 +- Env OCF_RESKEY_iflabel=iflabel +- AgentRun start OCF_SUCCESS +- Include check_iflabel_assigned +- AgentRun stop OCF_SUCCESS +- Include check_iflabel_removed +- +-# This is deprecated but still supported for the compatibility. +-CASE "check additional env: specify iflabel in 'OCF_RESKEY_nic'" +- Include prepare +- Env OCF_RESKEY_nic=eth0:iflabel +- AgentRun start OCF_SUCCESS +- Include check_iflabel_assigned +- AgentRun stop OCF_SUCCESS +- Include check_iflabel_removed +diff --git a/tools/ocft/IPaddr2v4 b/tools/ocft/IPaddr2v4 +deleted file mode 100644 +index 4d37168..0000000 +--- a/tools/ocft/IPaddr2v4 ++++ /dev/null +@@ -1,323 +0,0 @@ +-# IPaddr2v4 +- +-# Note: This test case uses two NICs(eth0, eth1) and +-# a IPv4 address prefix (192.168.144.0/24). +-# Adjust them according to your environment at VARIABLE section if needed. +- +-CONFIG +- Agent IPaddr2 +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- HangTimeout 20 +- +-VARIABLE +- OCFT_target_ip=192.168.144.2 +- OCFT_target_nic=eth0 +- OCFT_target_prefix=24 +- OCFT_target_netaddr=192.168.144.1/$OCFT_target_prefix +- OCFT_target_brd=192.168.144.255 +- OCFT_wrong_ip=192.168.120.1 +- OCFT_force_nic=eth1 +- OCFT_force_prefix=16 +- OCFT_force_prefix2=28 +- OCFT_force_brd=192.168.255.255 +- +-SETUP-AGENT +- ip addr add $OCFT_target_netaddr dev $OCFT_target_nic brd $OCFT_target_brd +- +-CLEANUP-AGENT +- ip addr del $OCFT_target_netaddr dev $OCFT_target_nic +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_ip=$OCFT_target_ip +- Env OCFT_check_ip=$OCFT_target_ip +- Env OCFT_check_prefix=$OCFT_target_prefix +- Env OCFT_check_nic=$OCFT_target_nic +- +-CASE-BLOCK check_ip_assigned +- Bash ip -4 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv4 address was assigned correctly +- +-CASE-BLOCK check_ip_removed +- Bash ! ip -4 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv4 address was removed correctly +- +-CASE-BLOCK base_ip_assigned +- Bash ip addr add $OCFT_target_netaddr dev $OCFT_target_nic brd $OCFT_target_brd +- +-CASE-BLOCK base_ip_removed +- Bash ip addr del $OCFT_target_netaddr dev $OCFT_target_nic +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include required_args +- Include default_status +- +-# CASE No.0 +-# +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- +-# CASE No.1 +-# +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.2 +-# +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-# CASE No.3 +-# +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-# CASE No.4 +-# +-CASE "monitor with running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-# CASE No.5 +-# +-CASE "monitor with not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-# CASE No.6 +-# Note: this result is different from IPaddr2 in 3.9.3. +-# IPaddr2 succeeds if the ip matched based on the netmask of the subnet +-# or fails if it did not match to any. +-# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. +-# IPaddr2 in 3.9.3 was using a wrong subnet mask (constant of 32) in this case. +-# +-CASE "params with nic, no cidr_netmask" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_target_nic +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.7 +-# +-CASE "params with nic, cidr_netmask" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_target_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.8 +-# +-CASE "error params with wrong ip" +- Include prepare +- Env OCF_RESKEY_ip=$OCFT_wrong_ip +- AgentRun start OCF_ERR_GENERIC +- +-# CASE No.9 +-# Note: this result is different from IPaddr2 in 3.9.3. +-# IPaddr2 fails when it could not determine the correct subnet mask. +-# When it could not get base ip, it becomes the error. +-# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. +-# IPaddr2 in 3.9.3 was using a wrong subnet mask (constant of 32) in this case. +-# +-CASE "params with force nic" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_force_nic +- Env OCFT_check_nic=$OCFT_force_nic +- AgentRun start OCF_ERR_GENERIC +- Include check_ip_removed +- Unenv OCF_RESKEY_nic +- +-# CASE No.10 +-# Note: this result is different from IPaddr2 in 3.9.3. +-# IPaddr2 fails when it could not determine the broadcast. +-# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. +-# IPaddr2 in 3.9.3 succeeded but it's considered ambiguous. +-# +-CASE "params with force cidr_netmask (base netmask > assigned netmask)" +- Include prepare +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix +- Env OCFT_check_prefix=$OCFT_force_prefix +- AgentRun start OCF_ERR_GENERIC +- Include check_ip_removed +- +-# CASE No.11 +-# Note: this result is different from IPaddr2 in 3.9.3. +-# IPaddr2 succeeds but the broadcast is not set. +-# This is because findif.sh can not calculate a broadcast from a netmask. +-# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. +-# IPaddr2 in 3.9.3 succeeded with using a calculated broadcast. +-# +-CASE "force to use the specified nic and cidr_netmask" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_force_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix +- Env OCFT_check_nic=$OCFT_force_nic +- Env OCFT_check_prefix=$OCFT_force_prefix +- AgentRun start OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- Unenv OCF_RESKEY_cidr_netmask +- +- +-# CASE No.12 +-# Note: this result is different from IPaddr2 in 3.9.3. +-# IPaddr2 fails when it could not determine the correct subnet mask. +-# When it could not get base ip, it becomes the error. +-# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. +-# IPaddr2 in 3.9.3 was using a wrong subnet mask (constant of 32) in this case. +-# +-CASE "error params with wrong ip and nic (not exist base_ip)" +- Include prepare +- Include base_ip_removed +- Env OCF_RESKEY_nic=$OCFT_target_nic +- Env OCFT_check_nic=$OCFT_target_nic +- AgentRun start OCF_ERR_GENERIC +- Include check_ip_removed +- Include base_ip_assigned +- +-# CASE No.13 +-# +-CASE "params with cidr_netmask" +- Include prepare +- Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.14 +-# Note: this result is different from IPaddr2 in 3.9.3. +-# IPaddr2 does not override the broadcast by cidr_netmask. +-# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. +-# IPaddr2 in 3.9.3 overrode the broadcast calculated by cidr_netmask. +-# +-CASE "params with force cidr_netmask (base netmask < assigned netmask)" +- Include prepare +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 +- Env OCFT_check_prefix=$OCFT_force_prefix2 +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.15 +-# Note: this result is different from IPaddr2 in 3.9.3. +-# IPaddr2 fails when it could not determine the broadcast. +-# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. +-# IPaddr2 in 3.9.3 succeeded but it's considered ambiguous. +-# +-CASE "error params with wrong ip and cidr_netmask (not exist base_ip)" +- Include prepare +- Include base_ip_removed +- Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix +- AgentRun start OCF_ERR_GENERIC +- Include base_ip_assigned +- +-# CASE No.16 +-# Note: this result is different from IPaddr2 in 3.9.3. +-# IPaddr2 succeeds but the broadcast is not set. +-# This is because findif.sh can not calculate a broadcast from a netmask. +-# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. +-# IPaddr2 in 3.9.3 succeeded with using a calculated broadcast. +-# +-CASE "force to use the specified nic and cidr_netmask" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_force_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 +- Env OCFT_check_prefix=$OCFT_force_prefix2 +- Env OCFT_check_nic=$OCFT_force_nic +- AgentRun start OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.17 +-# Note: this result is different from IPaddr2 in 3.9.3. +-# IPaddr2 succeeds but the broadcast is not set. +-# This is because findif.sh can not calculate a broadcast from a netmask. +-# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. +-# IPaddr2 in 3.9.3 succeeded with using a calculated broadcast. +-# +-CASE "force to use the specified nic and cidr_netmask (not exist base_ip)" +- Include prepare +- Include base_ip_removed +- Env OCF_RESKEY_nic=$OCFT_force_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 +- Env OCFT_check_prefix=$OCFT_force_prefix2 +- Env OCFT_check_nic=$OCFT_force_nic +- AgentRun start OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Unenv OCF_RESKEY_nic +- Unenv OCF_RESKEY_cidr_netmask +- Include base_ip_assigned +- +-# CASE No.18 +-# +-CASE "params with broadcast, no nic, no cidr_netmask" +- Include prepare +- Env OCF_RESKEY_broadcast=$OCFT_force_brd +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.19 +-# +-CASE "params with broadcast, no nic, no cidr_netmask" +- Include prepare +- Include base_ip_removed +- Env OCF_RESKEY_broadcast=$OCFT_force_brd +- AgentRun start OCF_ERR_GENERIC +- Include base_ip_assigned +- +-# CASE No.20 +-# +-CASE "force to use the specified nic and cidr_netmask" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_force_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix +- Env OCF_RESKEY_broadcast=$OCFT_force_brd +- Env OCFT_check_nic=$OCFT_force_nic +- Env OCFT_check_prefix=$OCFT_force_prefix +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- Unenv OCF_RESKEY_cidr_netmask +- +-# CASE No.21 +-# +-CASE "force to use the specified nic and cidr_netmask" +- Include prepare +- Include base_ip_removed +- Env OCF_RESKEY_nic=$OCFT_force_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 +- Env OCF_RESKEY_broadcast=$OCFT_target_brd +- Env OCFT_check_nic=$OCFT_force_nic +- Env OCFT_check_prefix=$OCFT_force_prefix2 +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- Include base_ip_assigned +- +diff --git a/tools/ocft/IPaddr2v6 b/tools/ocft/IPaddr2v6 +deleted file mode 100644 +index d24d890..0000000 +--- a/tools/ocft/IPaddr2v6 ++++ /dev/null +@@ -1,250 +0,0 @@ +-# IPaddr2v6 +- +-# Note: This test case uses two NICs(eth0, eth1) and +-# a IPv6 address prefix (2001:db8::/32, RFC3849). +-# Adjust them according to your environment at VARIABLE section if needed. +- +-CONFIG +- Agent IPaddr2 +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- HangTimeout 20 +- +-VARIABLE +- OCFT_target_ip=2001:db8:1234::2 +- OCFT_target_nic=eth0 +- OCFT_target_prefix=64 +- OCFT_target_netaddr=2001:db8:1234::1/$OCFT_target_prefix +- OCFT_target_linklocal=fe80::2 +- OCFT_wrong_ip=2001:db8:5678::2 +- OCFT_force_nic=eth1 +- OCFT_force_prefix=80 +- OCFT_force_prefix2=48 +- +-SETUP-AGENT +- ip addr add $OCFT_target_netaddr dev $OCFT_target_nic +- +-CLEANUP-AGENT +- ip addr del $OCFT_target_netaddr dev $OCFT_target_nic +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_ip=$OCFT_target_ip +- Env OCFT_check_ip=$OCFT_target_ip +- Env OCFT_check_prefix=$OCFT_target_prefix +- Env OCFT_check_nic=$OCFT_target_nic +- +-CASE-BLOCK check_ip_assigned +- Bash ip -6 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv6 address was assigned correctly +- +-CASE-BLOCK check_ip_removed +- Bash ! ip -6 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv6 address was removed correctly +- +-CASE-BLOCK base_ip_assigned +- Bash ip addr add $OCFT_target_netaddr dev $OCFT_target_nic +- +-CASE-BLOCK base_ip_removed +- Bash ip addr del $OCFT_target_netaddr dev $OCFT_target_nic +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include required_args +- Include default_status +- +-# CASE No.0 +-# +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- +-# CASE No.1 +-# +-CASE "normal stop" +- Include prepare +- AgentRun start OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.2 +-# +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-# CASE No.3 +-# +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-# CASE No.4 +-# +-CASE "monitor with running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-# CASE No.5 +-# +-CASE "monitor with not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-# CASE No.6 +-# +-CASE "error params with wrong ip" +- Include prepare +- Env OCF_RESKEY_ip=$OCFT_wrong_ip +- AgentRun start OCF_ERR_GENERIC +- +-# CASE No.7 +-# +-CASE "error params with no nic for a link-local IPv6 address" +- Include prepare +- Env OCF_RESKEY_ip=$OCFT_target_linklocal +- Env OCFT_check_ip=$OCFT_target_linklocal +- # nic is mandatory for a link-local address +- AgentRun start OCF_ERR_CONFIGURED +- +-# CASE No.8 +-# +-CASE "params with nic, no cidr_netmask" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_target_nic +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.9 +-# +-CASE "normal usage for a link-local IPv6 address, params with nic" +- Include prepare +- Env OCF_RESKEY_ip=$OCFT_target_linklocal +- Env OCFT_check_ip=$OCFT_target_linklocal +- # nic is mandatory for a link-local address +- Env OCF_RESKEY_nic=$OCFT_target_nic +- Env OCFT_check_nic=$OCFT_target_nic +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.10 +-# +-CASE "error params with wrong ip and nic (not exist base_ip)" +- Include prepare +- Include base_ip_removed +- Env OCF_RESKEY_nic=$OCFT_target_nic +- Env OCFT_check_nic=$OCFT_target_nic +- AgentRun start OCF_ERR_GENERIC +- Include check_ip_removed +- Include base_ip_assigned +- +-# CASE No.11 +-# +-CASE "params with force nic" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_force_nic +- Env OCFT_check_nic=$OCFT_force_nic +- AgentRun start OCF_ERR_GENERIC +- Include check_ip_removed +- Unenv OCF_RESKEY_nic +- +-# CASE No.12 +-# +-CASE "params with force cidr_netmask" +- Include prepare +- Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix +- Env OCFT_check_prefix=$OCFT_target_prefix +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.13 +-# +-CASE "params with force cidr_netmask (base netmask < assigned netmask)" +- Include prepare +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix +- Env OCFT_check_prefix=$OCFT_force_prefix +- AgentRun start OCF_ERR_GENERIC +- Include check_ip_removed +- +-# CASE No.14 +-# +-CASE "params with force cidr_netmask (base netmask > assigned netmask)" +- Include prepare +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 +- Env OCFT_check_prefix=$OCFT_force_prefix2 +- AgentRun start OCF_ERR_GENERIC +- Include check_ip_removed +- +-# CASE No.15 +-# +-CASE "params with cidr_netmask" +- Include prepare +- Include base_ip_removed +- Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix +- Env OCFT_check_prefix=$OCFT_target_prefix +- AgentRun start OCF_ERR_GENERIC +- Include base_ip_assigned +- +-# CASE No.16 +-# +-CASE "params with nic, cidr_netmask" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_target_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix +- Env OCFT_check_nic=$OCFT_target_nic +- Env OCFT_check_prefix=$OCFT_target_prefix +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.17 +-# +-CASE "force to use the specified nic and cidr_netmask (base netmask < assigned netmask)" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_force_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix +- Env OCFT_check_nic=$OCFT_force_nic +- Env OCFT_check_prefix=$OCFT_force_prefix +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.18 +-# This use case is now valid. It was not allowed until v3.9.2. +-# +-CASE "force to use the specified nic and cidr_netmask (base netmask > assigned netmask)" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_force_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 +- Env OCFT_check_nic=$OCFT_force_nic +- Env OCFT_check_prefix=$OCFT_force_prefix2 +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-# CASE No.19 +-# +-CASE "force to use the specified nic and cidr_netmask (base netmask > assigned netmask)" +- Include prepare +- Include base_ip_removed +- Env OCF_RESKEY_nic=$OCFT_force_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 +- Env OCFT_check_nic=$OCFT_force_nic +- Env OCFT_check_prefix=$OCFT_force_prefix2 +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- Include base_ip_assigned +- +diff --git a/tools/ocft/IPsrcaddr b/tools/ocft/IPsrcaddr +deleted file mode 100644 +index d95142e..0000000 +--- a/tools/ocft/IPsrcaddr ++++ /dev/null +@@ -1,63 +0,0 @@ +-# IPsrcaddr +- +-CONFIG +- Agent IPsrcaddr +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage iproute2 +- HangTimeout 20 +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_ipaddress= # put here your IP +- Env OCF_RESKEY_cidr_netmask= # and the netmask +- +-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_ipaddress'" +- Include prepare +- Unenv OCF_RESKEY_ipaddress +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: set invalid 'OCF_RESKEY_ipaddress'" +- Include prepare +- Env OCF_RESKEY_ipaddress=not_ip_address +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor with running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor with not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/IPv6addr b/tools/ocft/IPv6addr +deleted file mode 100644 +index 36a9642..0000000 +--- a/tools/ocft/IPv6addr ++++ /dev/null +@@ -1,150 +0,0 @@ +-# IPv6addr +- +-# Note: This test case uses two NICs(eth0, eth1) and +-# a IPv6 address prefix (2001:db8::/32, RFC3849). +-# Adjust them according to your environment at VARIABLE section if needed. +- +-CONFIG +- Agent IPv6addr +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- HangTimeout 20 +- +-VARIABLE +- OCFT_target_ipv6addr=2001:db8:1234::2 +- OCFT_target_nic=eth0 +- OCFT_target_prefix=64 +- OCFT_target_netaddr=2001:db8:1234::1/$OCFT_target_prefix +- OCFT_target_linklocal=fe80::2 +- OCFT_wrong_ipv6addr=2001:db8:5678::2 +- OCFT_force_nic=eth1 +- OCFT_force_prefix=80 +- +-SETUP-AGENT +- ip addr add $OCFT_target_netaddr dev $OCFT_target_nic +- +-CLEANUP-AGENT +- ip addr del $OCFT_target_netaddr dev $OCFT_target_nic +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_ipv6addr=$OCFT_target_ipv6addr +- Env OCFT_check_ipv6addr=$OCFT_target_ipv6addr +- Env OCFT_check_prefix=$OCFT_target_prefix +- Env OCFT_check_nic=$OCFT_target_nic +- +-CASE-BLOCK check_ip_assigned +- Bash ip -6 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ipv6addr/$OCFT_check_prefix >/dev/null # checking if the IPv6 address was assigned correctly +- +-CASE-BLOCK check_ip_removed +- Bash ! ip -6 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ipv6addr/$OCFT_check_prefix >/dev/null # checking if the IPv6 address was removed correctly +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include required_args +- Include default_status +- +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor with running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor with not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "params with nic, no cidr_netmask" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_target_nic +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-CASE "params with nic, cidr_netmask" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_target_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-CASE "normal usage for a link-local IPv6 address" +- Include prepare +- Env OCF_RESKEY_ipv6addr=$OCFT_target_linklocal +- Env OCFT_check_ipv6addr=$OCFT_target_linklocal +- # nic is mandatory for a link-local address +- Env OCF_RESKEY_nic=$OCFT_target_nic +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +- +-CASE "error start for a link-local IPv6 address when no nic" +- Include prepare +- Env OCF_RESKEY_ipv6addr=$OCFT_target_linklocal +- # nic is mandatory for a link-local address +- Unenv OCF_RESKEY_nic +- AgentRun start OCF_ERR_GENERIC +- Include check_ip_removed +- +-CASE "error params with wrong ipv6addr" +- Include prepare +- Env OCF_RESKEY_ipv6addr=$OCFT_wrong_ipv6addr +- AgentRun start OCF_ERR_GENERIC +- +-# Note: this result is different from IPaddr2/findif +-# IPaddr2 succeeds if the ip matched based on the netmask of the subnet +-# or fails if it did not match to any. +-# Recommended to always specify both nic and cidr_netmask when you needed. +-CASE "error params with wrong cidr_netmask" +- Include prepare +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix +- AgentRun start OCF_ERR_GENERIC +- +-# Note: this result is different from IPaddr2/findif +-# IPaddr2 succeeds but it uses /32 as a guessed cidr_netmask which +-# does not seem to be expected. +-# Recommended to always specify both nic and cidr_netmask when you needed. +-CASE "error params with wrong nic" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_force_nic +- AgentRun start OCF_ERR_GENERIC +- +-# Note: This use case is now valid. It was not allowed until v3.9.2. +-CASE "force to use the specified nic and cidr_netmask" +- Include prepare +- Env OCF_RESKEY_nic=$OCFT_force_nic +- Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix +- Env OCFT_check_nic=$OCFT_force_nic +- Env OCFT_check_prefix=$OCFT_force_prefix +- AgentRun start OCF_SUCCESS +- Include check_ip_assigned +- AgentRun monitor OCF_SUCCESS +- AgentRun stop OCF_SUCCESS +- Include check_ip_removed +diff --git a/tools/ocft/LVM b/tools/ocft/LVM +deleted file mode 100644 +index 4bd2b22..0000000 +--- a/tools/ocft/LVM ++++ /dev/null +@@ -1,86 +0,0 @@ +-# LVM +-# by dejan@suse.de on +-# Wed Feb 16 13:15:01 CET 2011 +- +-CONFIG +- Agent LVM +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- HangTimeout 20 +- +-VARIABLE +- OCFT_pv=/var/run/resource-agents/ocft-LVM-pv +- OCFT_vg=ocft-vg +- OCFT_lv=ocft-lv +- OCFT_loop=/dev/loop7 +- +-SETUP-AGENT +- losetup $OCFT_loop 2>/dev/null && exit 1 +- dd if=/dev/zero of=$OCFT_pv bs=1 count=0 seek=16M 2>/dev/null +- losetup $OCFT_loop $OCFT_pv +- pvcreate $OCFT_loop +- vgcreate -s 4K $OCFT_vg $OCFT_loop +- lvcreate -n $OCFT_lv -L 600K $OCFT_vg +- +-CLEANUP-AGENT +- vgchange -an $OCFT_vg +- lvremove -f /dev/$OCFT_vg/$OCFT_lv +- vgremove -f $OCFT_vg +- pvremove $OCFT_loop +- losetup -d $OCFT_loop +- rm $OCFT_pv +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_volgrpname=$OCFT_vg +- +-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: invalid 'OCF_RESKEY_volgrpname'" +- Include prepare +- Env OCF_RESKEY_volgrpname=/dev/no_such_device +- AgentRun start OCF_ERR_GENERIC +- +-CASE "check base env: unset 'OCF_RESKEY_volgrpname'" +- Include prepare +- Unenv OCF_RESKEY_volgrpname +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor when running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor when not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +- +diff --git a/tools/ocft/MailTo b/tools/ocft/MailTo +deleted file mode 100644 +index 8754035..0000000 +--- a/tools/ocft/MailTo ++++ /dev/null +@@ -1,57 +0,0 @@ +-# MailTo +- +-CONFIG +- Agent MailTo +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage mailx +- HangTimeout 20 +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_email=root@localhost +- +-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_email'" +- Include prepare +- Unenv OCF_RESKEY_email +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor with running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor with not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/Makefile.am b/tools/ocft/Makefile.am +index 733e487..9eab648 100644 +--- a/tools/ocft/Makefile.am ++++ b/tools/ocft/Makefile.am +@@ -22,29 +22,50 @@ EXTRA_DIST = $(ocftcfgs_DATA) $(ocft_DATA) + sbin_SCRIPTS = ocft + + ocftcfgsdir = $(datadir)/$(PACKAGE_NAME)/ocft/configs +-ocftcfgs_DATA = apache \ +- IPaddr2 \ +- IPaddr2v4 \ +- IPaddr2v6 \ +- IPv6addr \ +- Filesystem \ +- LVM \ +- Raid1 \ +- IPsrcaddr \ +- MailTo \ +- mysql \ +- mysql-proxy \ +- pgsql \ +- db2 \ +- oracle \ +- drbd.linbit \ +- nfsserver \ +- portblock \ +- iscsi \ +- named \ +- postfix \ +- Xinetd \ +- SendArp ++ ++ocftcfgs_DATA = ++if OCFT_FEDORA_CASES ++ocftcfgs_DATA += fedora/Filesystem \ ++ fedora/IPaddr2v4 \ ++ fedora/IPaddr2v6 \ ++ fedora/IPsrcaddr \ ++ fedora/SendArp \ ++ fedora/Xinetd \ ++ fedora/apache \ ++ fedora/mysql \ ++ fedora/nfsserver \ ++ fedora/pgsql \ ++ fedora/tomcat ++endif ++ ++if OCFT_DEFAULT_CASES ++ocftcfgs_DATA += default/apache \ ++ default/IPaddr2 \ ++ default/IPaddr2v4 \ ++ default/IPaddr2v6 \ ++ default/IPv6addr \ ++ default/Filesystem \ ++ default/LVM \ ++ default/Raid1 \ ++ default/IPsrcaddr \ ++ default/MailTo \ ++ default/jboss \ ++ default/mysql \ ++ default/mysql-proxy \ ++ default/pgsql \ ++ default/db2 \ ++ default/oracle \ ++ default/drbd.linbit \ ++ default/exportfs \ ++ default/nfsserver \ ++ default/portblock \ ++ default/iscsi \ ++ default/named \ ++ default/postfix \ ++ default/tomcat \ ++ default/Xinetd \ ++ default/SendArp ++endif + + ocftdir = $(datadir)/$(PACKAGE_NAME)/ocft + ocft_DATA = README \ +diff --git a/tools/ocft/Raid1 b/tools/ocft/Raid1 +deleted file mode 100644 +index 1c239c8..0000000 +--- a/tools/ocft/Raid1 ++++ /dev/null +@@ -1,146 +0,0 @@ +-# Raid1 +-# by dejan@suse.de on +-# Fri Aug 24 17:01:40 CEST 2012 +- +-CONFIG +- Agent Raid1 +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage mdadm +- HangTimeout 20 +- +-VARIABLE +- OCFT_disk0=/var/run/resource-agents/ocft-Raid1-disk0 +- OCFT_disk1=/var/run/resource-agents/ocft-Raid1-disk1 +- OCFT_disk2=/var/run/resource-agents/ocft-Raid1-disk2 +- OCFT_disk3=/var/run/resource-agents/ocft-Raid1-disk3 +- OCFT_raidconf=/var/run/resource-agents/ocft-mdadm.conf +- OCFT_raiddev=/dev/md8 +- OCFT_raiddev2=/dev/md9 +- OCFT_loop0=/dev/loop6 +- OCFT_loop1=/dev/loop7 +- OCFT_loop2=/dev/loop4 +- OCFT_loop3=/dev/loop5 +- +-SETUP-AGENT +- losetup $OCFT_loop0 2>/dev/null && exit 1 +- losetup $OCFT_loop1 2>/dev/null && exit 1 +- losetup $OCFT_loop2 2>/dev/null && exit 1 +- losetup $OCFT_loop3 2>/dev/null && exit 1 +- dd if=/dev/zero of=$OCFT_disk0 bs=1 count=0 seek=16M 2>/dev/null +- dd if=/dev/zero of=$OCFT_disk1 bs=1 count=0 seek=16M 2>/dev/null +- dd if=/dev/zero of=$OCFT_disk2 bs=1 count=0 seek=16M 2>/dev/null +- dd if=/dev/zero of=$OCFT_disk3 bs=1 count=0 seek=16M 2>/dev/null +- losetup $OCFT_loop0 $OCFT_disk0 +- losetup $OCFT_loop1 $OCFT_disk1 +- losetup $OCFT_loop2 $OCFT_disk2 +- losetup $OCFT_loop3 $OCFT_disk3 +- mdadm --create $OCFT_raiddev -l 0 --raid-devices=2 $OCFT_loop0 $OCFT_loop1 +- mdadm --create $OCFT_raiddev2 -l 0 --raid-devices=2 $OCFT_loop2 $OCFT_loop3 +- echo DEVICE $OCFT_loop0 $OCFT_loop1 > $OCFT_raidconf +- echo DEVICE $OCFT_loop2 $OCFT_loop3 >> $OCFT_raidconf +- echo ARRAY $OCFT_raiddev devices=$OCFT_loop0,$OCFT_loop1 >> $OCFT_raidconf +- echo ARRAY $OCFT_raiddev2 devices=$OCFT_loop2,$OCFT_loop3 >> $OCFT_raidconf +- +-CLEANUP-AGENT +- mdadm --zero-superblock $OCFT_loop0 +- mdadm --zero-superblock $OCFT_loop1 +- mdadm --zero-superblock $OCFT_loop2 +- mdadm --zero-superblock $OCFT_loop3 +- mdadm --remove $OCFT_raiddev 2>/dev/null +- mdadm --remove $OCFT_raiddev2 2>/dev/null +- losetup -d $OCFT_loop0 +- losetup -d $OCFT_loop1 +- losetup -d $OCFT_loop2 +- losetup -d $OCFT_loop3 +- rm $OCFT_disk0 $OCFT_disk1 $OCFT_raidconf +- rm $OCFT_disk2 $OCFT_disk3 +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_raidconf=$OCFT_raidconf +- Env OCF_RESKEY_raiddev=$OCFT_raiddev +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include required_args +- Include default_status +- +-CASE-BLOCK prepare_auto +- Include required_args +- Env OCF_RESKEY_raiddev="auto" +- Include default_status +- +-CASE-BLOCK prepare_multiple +- Include required_args +- Env OCF_RESKEY_raiddev="$OCFT_raiddev $OCFT_raiddev2" +- Include default_status +- +-CASE "check base env" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "check base env: invalid 'OCF_RESKEY_raiddev'" +- Include prepare +- Env OCF_RESKEY_raiddev=/dev/no_such_device +- AgentRun start OCF_ERR_GENERIC +- +-CASE "check base env: unset 'OCF_RESKEY_raiddev'" +- Include prepare +- Unenv OCF_RESKEY_raiddev +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor when running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor when not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "normal start (auto)" +- Include prepare_auto +- AgentRun start OCF_SUCCESS +- AgentRun monitor OCF_SUCCESS +- +-CASE "normal stop (auto)" +- Include prepare_auto +- AgentRun start +- AgentRun stop OCF_SUCCESS +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "normal start (multiple)" +- Include prepare +- AgentRun start OCF_SUCCESS +- AgentRun monitor OCF_SUCCESS +- +-CASE "normal stop (multiple)" +- Include prepare +- Env OCF_RESKEY_raiddev="$OCFT_raiddev $OCFT_raiddev2" +- AgentRun start +- AgentRun stop OCF_SUCCESS +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +- +diff --git a/tools/ocft/SendArp b/tools/ocft/SendArp +deleted file mode 100644 +index 7880388..0000000 +--- a/tools/ocft/SendArp ++++ /dev/null +@@ -1,74 +0,0 @@ +-# SendArp +- +-CONFIG +- Agent SendArp +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage resource-agents +- HangTimeout 15 +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_ip=127.0.0.1 +- Env OCF_RESKEY_nic=lo +- Env OCF_RESKEY_background=false +- +-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_ip'" +- Include prepare +- Unenv OCF_RESKEY_ip +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: set invalid 'OCF_RESKEY_ip'" +- Include prepare +- Env OCF_RESKEY_ip=not_ip_address +- AgentRun start OCF_ERR_GENERIC +- +-CASE "check base env: unset 'OCF_RESKEY_nic'" +- Include prepare +- Unenv OCF_RESKEY_nic +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: set invalid 'OCF_RESKEY_nic'" +- Include prepare +- Env OCF_RESKEY_nic=not_nic +- AgentRun start OCF_ERR_GENERIC +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor with running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor with not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/Xinetd b/tools/ocft/Xinetd +deleted file mode 100644 +index ba9c85c..0000000 +--- a/tools/ocft/Xinetd ++++ /dev/null +@@ -1,56 +0,0 @@ +-# Xinetd +- +-CONFIG +- Agent Xinetd +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage xinetd +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_service=discard +- +-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_protocol'" +- Include prepare +- Unenv OCF_RESKEY_service +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor with running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor with not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/apache b/tools/ocft/apache +deleted file mode 100644 +index 797412d..0000000 +--- a/tools/ocft/apache ++++ /dev/null +@@ -1,63 +0,0 @@ +-# apache +-# make sure that your apache configuration loads mod_status +- +-CONFIG +- Agent apache +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage apache2 +- HangTimeout 20 +- +-SETUP-AGENT +- /etc/init.d/apache2 start +- /etc/init.d/apache2 stop +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include default_status +- +-CASE "check base env" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "check base env: set non-existing OCF_RESKEY_statusurl" +- Include prepare +- Env OCF_RESKEY_statusurl="yoyoyoyo" +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: set non-existing OCF_RESKEY_configfile" +- Include prepare +- Env OCF_RESKEY_configfile="/yoyoyoyo/nosuchfile" +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "running monitor" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "not running monitor" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/db2 b/tools/ocft/db2 +deleted file mode 100644 +index 7013a99..0000000 +--- a/tools/ocft/db2 ++++ /dev/null +@@ -1,164 +0,0 @@ +-# db2 +-# +-# This test assumes a db2 ESE instance with two partions and a database. +-# Default is instance=db2inst1, database=ocft +-# adapt this in set_testenv below +-# +-# Simple steps to generate a test environment (if you don't have one): +-# +-# A virtual machine with 1200MB RAM is sufficient +-# +-# - download an eval version of DB2 server from IBM +-# - create an user "db2inst1" in group "db2inst1" +-# +-# As root +-# - install DB2 software in some location +-# - create instance +-# cd /instance +-# ./db2icrt -s ese -u db2inst1 db2inst1 +-# - adapt profile of db2inst1 as instructed by db2icrt +-# +-# As db2inst1 +-# # allow to run with small memory footprint +-# db2set DB2_FCM_SETTINGS=FCM_MAXIMIZE_SET_SIZE:FALSE +-# db2start +-# db2start dbpartitionnum 1 add dbpartitionnum hostname $(uname -n) port 1 without tablespaces +-# db2stop +-# db2start +-# db2 create database ocft +-# Done +-# In order to install a real cluster refer to http://www.linux-ha.org/wiki/db2_(resource_agent) +- +-CONFIG +- Agent db2 +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- HangTimeout 40 +- +-SETUP-AGENT +- # nothing +- +-CASE-BLOCK set_testenv +- Env OCFT_instance=db2inst1 +- Env OCFT_db=ocft +- +-CASE-BLOCK crm_setting +- Env OCF_RESKEY_instance=$OCFT_instance +- Env OCF_RESKEY_CRM_meta_timeout=30000 +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include set_testenv +- Include crm_setting +- Include default_status +- +-CASE "check base env" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "check base env: invalid 'OCF_RESKEY_instance'" +- Include prepare +- Env OCF_RESKEY_instance=no_such +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "invalid instance config" +- Include prepare +- Bash eval mv ~$OCFT_instance/sqllib ~$OCFT_instance/sqllib- +- BashAtExit eval mv ~$OCFT_instance/sqllib- ~$OCFT_instance/sqllib +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "started: monitor" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "not started: monitor" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "killed instance: monitor" +- Include prepare +- AgentRun start OCF_SUCCESS +- AgentRun monitor OCF_SUCCESS +- BashAtExit rm /tmp/ocft-helper1 +- Bash echo "su $OCFT_instance -c '. ~$OCFT_instance/sqllib/db2profile; db2nkill 0 >/dev/null 2>&1'" > /tmp/ocft-helper1 +- Bash sh -x /tmp/ocft-helper1 +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "overload param instance by admin" +- Include prepare +- Env OCF_RESKEY_instance=no_such +- Env OCF_RESKEY_admin=$OCFT_instance +- AgentRun start OCF_SUCCESS +- +-CASE "check start really activates db" +- Include prepare +- AgentRun start OCF_SUCCESS +- +- BashAtExit rm /tmp/ocft-helper2 +- Bash echo "su $OCFT_instance -c '. ~$OCFT_instance/sqllib/db2profile; db2 get snapshot for database on $OCFT_db>/dev/null'" > /tmp/ocft-helper2 +- Bash sh -x /tmp/ocft-helper2 +- +-CASE "multipartion test" +- Include prepare +- AgentRun start OCF_SUCCESS +- AgentRun monitor OCF_SUCCESS +- +- # start does not start partion 1 +- Env OCF_RESKEY_dbpartitionnum=1 +- AgentRun monitor OCF_NOT_RUNNING +- +- # now start 1 +- AgentRun start OCF_SUCCESS +- AgentRun monitor OCF_SUCCESS +- +- # now stop 1 +- AgentRun stop OCF_SUCCESS +- AgentRun monitor OCF_NOT_RUNNING +- +- # does not affect 0 +- Env OCF_RESKEY_dbpartitionnum=0 +- AgentRun monitor OCF_SUCCESS +- +-# fault injection does not work on the 1.0.4 client due to a hardcoded path +-CASE "simulate hanging db2stop (not meaningful for 1.0.4 agent)" +- Include prepare +- AgentRun start OCF_SUCCESS +- Bash [ ! -f /usr/local/bin/db2stop ] +- BashAtExit rm /usr/local/bin/db2stop +- Bash echo -e "#!/bin/sh\necho fake db2stop\nsleep 10000" > /usr/local/bin/db2stop +- Bash chmod +x /usr/local/bin/db2stop +- AgentRun stop OCF_SUCCESS +- +-# fault injection does not work on the 1.0.4 client due to a hardcoded path +-CASE "simulate not stopping db2stop (not meaningful for 1.0.4 agent)" +- Include prepare +- AgentRun start OCF_SUCCESS +- Bash [ ! -f /usr/local/bin/db2stop ] +- BashAtExit rm /usr/local/bin/db2stop +- Bash echo -e "#!/bin/sh\necho fake db2stop\nexit 0" > /usr/local/bin/db2stop +- Bash chmod +x /usr/local/bin/db2stop +- AgentRun stop OCF_SUCCESS +diff --git a/tools/ocft/default/Filesystem b/tools/ocft/default/Filesystem +new file mode 100644 +index 0000000..75203d7 +--- /dev/null ++++ b/tools/ocft/default/Filesystem +@@ -0,0 +1,110 @@ ++# Filesystem ++# by dejan@suse.de on ++# Tue Feb 15 18:50:04 CET 2011 ++ ++CONFIG ++ Agent Filesystem ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 20 ++ ++VARIABLE ++ OCFT_fs=/var/run/resource-agents/ocft-Filesystem-fs ++ OCFT_loop=/dev/loop7 ++ OCFT_dir=/var/run/resource-agents/ocft-Filesystem-mnt ++ ++SETUP-AGENT ++ losetup $OCFT_loop 2>/dev/null && exit 1 ++ rmdir $OCFT_dir 2>/dev/null || true ++ mkdir $OCFT_dir ++ dd if=/dev/zero of=$OCFT_fs bs=1 count=0 seek=16M 2>/dev/null ++ mke2fs -j -Fq -m 0 $OCFT_fs ++ losetup $OCFT_loop $OCFT_fs ++ ++CLEANUP-AGENT ++ rmdir $OCFT_dir ++ rm $OCFT_fs ++ losetup -d $OCFT_loop ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_device=$OCFT_loop ++ Env OCF_RESKEY_fstype=ext3 ++ Env OCF_RESKEY_directory=$OCFT_dir ++ ++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: invalid 'OCF_RESKEY_device'" ++ Include prepare ++ Env OCF_RESKEY_device=/dev/no_such_device ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "check base env: unset 'OCF_RESKEY_device'" ++ Include prepare ++ Unenv OCF_RESKEY_device ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor when running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor when not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "monitor depth 10 when running" ++ Include prepare ++ AgentRun start ++ Env OCF_CHECK_LEVEL=10 ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor depth 20 with running" ++ Include prepare ++ AgentRun start ++ Env OCF_CHECK_LEVEL=20 ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "start insert failure (remove device)" ++ Include prepare ++ Bash losetup -d $OCFT_loop ++ BashAtExit losetup $OCFT_loop $OCFT_fs ++ AgentRun start OCF_ERR_GENERIC ++ ++CASE "monitor depth 20 insert failure (r/o fs)" ++ Include prepare ++ AgentRun start ++ Bash mount -o remount,ro $OCFT_dir ++ BashAtExit mount -o remount,rw $OCFT_dir ++ Env OCF_CHECK_LEVEL=20 ++ AgentRun monitor OCF_ERR_GENERIC ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ +diff --git a/tools/ocft/default/IPaddr2 b/tools/ocft/default/IPaddr2 +new file mode 100644 +index 0000000..1cf81bf +--- /dev/null ++++ b/tools/ocft/default/IPaddr2 +@@ -0,0 +1,137 @@ ++# IPaddr2 ++ ++CONFIG ++ Agent IPaddr2 ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 20 ++ ++SETUP-AGENT ++ ip addr add 192.168.144.1/24 dev eth0 brd 192.168.144.255 ++ ++CLEANUP-AGENT ++ ip addr del 192.168.144.1/24 dev eth0 ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_ip=192.168.144.2 ++ ++CASE-BLOCK check_iflabel_assigned ++ Bash ip -4 -o addr show eth0 | grep -w 192.168.144.2/24 | grep -w eth0:iflabel >/dev/null # checking iflabel was assigned correctly ++ ++CASE-BLOCK check_iflabel_removed ++ Bash ! ip -4 -o addr show eth0 | grep -w 192.168.144.2/24 | grep -w eth0:iflabel >/dev/null # checking iflabel was removed correctly ++ ++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_ip'" ++ Include prepare ++ Unenv OCF_RESKEY_ip ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: set invalid 'OCF_RESKEY_ip'" ++ Include prepare ++ Env OCF_RESKEY_ip=not_ip_address ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: set 'OCF_RESKEY_cidr_netmask'" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=24 ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: set invalid 'OCF_RESKEY_cidr_netmask'" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=not_netmask ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: set 'OCF_RESKEY_broadcast'" ++ Include prepare ++ Env OCF_RESKEY_broadcast=192.168.144.255 ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: set invalid 'OCF_RESKEY_broadcast'" ++ Include prepare ++ Env OCF_RESKEY_broadcast=not_broadcast ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: set 'OCF_RESKEY_nic'" ++ Include prepare ++ Env OCF_RESKEY_nic=eth0 ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: set invalid 'OCF_RESKEY_nic'" ++ Include prepare ++ Env OCF_RESKEY_nic=not_nic ++ AgentRun start OCF_ERR_CONFIGURED ++ AgentRun validate-all OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ ++CASE "Attachment to loopback interface" ++ Env OCF_RESKEY_ip=127.0.0.3 ++ AgentRun start OCF_SUCCESS ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ ++CASE "check additional env: set 'OCF_RESKEY_iflabel'" ++ Include prepare ++ Env OCF_RESKEY_nic=eth0 ++ Env OCF_RESKEY_iflabel=iflabel ++ AgentRun start OCF_SUCCESS ++ Include check_iflabel_assigned ++ AgentRun stop OCF_SUCCESS ++ Include check_iflabel_removed ++ ++# This is deprecated but still supported for the compatibility. ++CASE "check additional env: specify iflabel in 'OCF_RESKEY_nic'" ++ Include prepare ++ Env OCF_RESKEY_nic=eth0:iflabel ++ AgentRun start OCF_SUCCESS ++ Include check_iflabel_assigned ++ AgentRun stop OCF_SUCCESS ++ Include check_iflabel_removed ++ ++# monitor should return OCF_ERR_GENERIC rather than OCF_ERR_CONFIGURED ++# when the specified OCF_RESKEY_nic is disappeard by a failure. ++# This has been changed as of 3.9.6. ++CASE "monitor failure when 'OCF_RESKEY_nic' is disappeared" ++ Include prepare ++ Env OCF_RESKEY_nic=ethDisappear ++ Env OCF_RESKEY_CRM_meta_interval=10 # not in probe ++ AgentRun monitor OCF_ERR_GENERIC +diff --git a/tools/ocft/default/IPaddr2v4 b/tools/ocft/default/IPaddr2v4 +new file mode 100644 +index 0000000..4d37168 +--- /dev/null ++++ b/tools/ocft/default/IPaddr2v4 +@@ -0,0 +1,323 @@ ++# IPaddr2v4 ++ ++# Note: This test case uses two NICs(eth0, eth1) and ++# a IPv4 address prefix (192.168.144.0/24). ++# Adjust them according to your environment at VARIABLE section if needed. ++ ++CONFIG ++ Agent IPaddr2 ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 20 ++ ++VARIABLE ++ OCFT_target_ip=192.168.144.2 ++ OCFT_target_nic=eth0 ++ OCFT_target_prefix=24 ++ OCFT_target_netaddr=192.168.144.1/$OCFT_target_prefix ++ OCFT_target_brd=192.168.144.255 ++ OCFT_wrong_ip=192.168.120.1 ++ OCFT_force_nic=eth1 ++ OCFT_force_prefix=16 ++ OCFT_force_prefix2=28 ++ OCFT_force_brd=192.168.255.255 ++ ++SETUP-AGENT ++ ip addr add $OCFT_target_netaddr dev $OCFT_target_nic brd $OCFT_target_brd ++ ++CLEANUP-AGENT ++ ip addr del $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_ip=$OCFT_target_ip ++ Env OCFT_check_ip=$OCFT_target_ip ++ Env OCFT_check_prefix=$OCFT_target_prefix ++ Env OCFT_check_nic=$OCFT_target_nic ++ ++CASE-BLOCK check_ip_assigned ++ Bash ip -4 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv4 address was assigned correctly ++ ++CASE-BLOCK check_ip_removed ++ Bash ! ip -4 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv4 address was removed correctly ++ ++CASE-BLOCK base_ip_assigned ++ Bash ip addr add $OCFT_target_netaddr dev $OCFT_target_nic brd $OCFT_target_brd ++ ++CASE-BLOCK base_ip_removed ++ Bash ip addr del $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include required_args ++ Include default_status ++ ++# CASE No.0 ++# ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ ++# CASE No.1 ++# ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.2 ++# ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++# CASE No.3 ++# ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++# CASE No.4 ++# ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++# CASE No.5 ++# ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++# CASE No.6 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 succeeds if the ip matched based on the netmask of the subnet ++# or fails if it did not match to any. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 was using a wrong subnet mask (constant of 32) in this case. ++# ++CASE "params with nic, no cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.7 ++# ++CASE "params with nic, cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.8 ++# ++CASE "error params with wrong ip" ++ Include prepare ++ Env OCF_RESKEY_ip=$OCFT_wrong_ip ++ AgentRun start OCF_ERR_GENERIC ++ ++# CASE No.9 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 fails when it could not determine the correct subnet mask. ++# When it could not get base ip, it becomes the error. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 was using a wrong subnet mask (constant of 32) in this case. ++# ++CASE "params with force nic" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ Env OCFT_check_nic=$OCFT_force_nic ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ Unenv OCF_RESKEY_nic ++ ++# CASE No.10 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 fails when it could not determine the broadcast. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 succeeded but it's considered ambiguous. ++# ++CASE "params with force cidr_netmask (base netmask > assigned netmask)" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++ Env OCFT_check_prefix=$OCFT_force_prefix ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ ++# CASE No.11 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 succeeds but the broadcast is not set. ++# This is because findif.sh can not calculate a broadcast from a netmask. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 succeeded with using a calculated broadcast. ++# ++CASE "force to use the specified nic and cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++ Env OCFT_check_nic=$OCFT_force_nic ++ Env OCFT_check_prefix=$OCFT_force_prefix ++ AgentRun start OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ Unenv OCF_RESKEY_cidr_netmask ++ ++ ++# CASE No.12 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 fails when it could not determine the correct subnet mask. ++# When it could not get base ip, it becomes the error. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 was using a wrong subnet mask (constant of 32) in this case. ++# ++CASE "error params with wrong ip and nic (not exist base_ip)" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ Env OCFT_check_nic=$OCFT_target_nic ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ Include base_ip_assigned ++ ++# CASE No.13 ++# ++CASE "params with cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.14 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 does not override the broadcast by cidr_netmask. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 overrode the broadcast calculated by cidr_netmask. ++# ++CASE "params with force cidr_netmask (base netmask < assigned netmask)" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++ Env OCFT_check_prefix=$OCFT_force_prefix2 ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.15 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 fails when it could not determine the broadcast. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 succeeded but it's considered ambiguous. ++# ++CASE "error params with wrong ip and cidr_netmask (not exist base_ip)" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ AgentRun start OCF_ERR_GENERIC ++ Include base_ip_assigned ++ ++# CASE No.16 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 succeeds but the broadcast is not set. ++# This is because findif.sh can not calculate a broadcast from a netmask. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 succeeded with using a calculated broadcast. ++# ++CASE "force to use the specified nic and cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++ Env OCFT_check_prefix=$OCFT_force_prefix2 ++ Env OCFT_check_nic=$OCFT_force_nic ++ AgentRun start OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.17 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 succeeds but the broadcast is not set. ++# This is because findif.sh can not calculate a broadcast from a netmask. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 succeeded with using a calculated broadcast. ++# ++CASE "force to use the specified nic and cidr_netmask (not exist base_ip)" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++ Env OCFT_check_prefix=$OCFT_force_prefix2 ++ Env OCFT_check_nic=$OCFT_force_nic ++ AgentRun start OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Unenv OCF_RESKEY_nic ++ Unenv OCF_RESKEY_cidr_netmask ++ Include base_ip_assigned ++ ++# CASE No.18 ++# ++CASE "params with broadcast, no nic, no cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_broadcast=$OCFT_force_brd ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.19 ++# ++CASE "params with broadcast, no nic, no cidr_netmask" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_broadcast=$OCFT_force_brd ++ AgentRun start OCF_ERR_GENERIC ++ Include base_ip_assigned ++ ++# CASE No.20 ++# ++CASE "force to use the specified nic and cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++ Env OCF_RESKEY_broadcast=$OCFT_force_brd ++ Env OCFT_check_nic=$OCFT_force_nic ++ Env OCFT_check_prefix=$OCFT_force_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ Unenv OCF_RESKEY_cidr_netmask ++ ++# CASE No.21 ++# ++CASE "force to use the specified nic and cidr_netmask" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++ Env OCF_RESKEY_broadcast=$OCFT_target_brd ++ Env OCFT_check_nic=$OCFT_force_nic ++ Env OCFT_check_prefix=$OCFT_force_prefix2 ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ Include base_ip_assigned ++ +diff --git a/tools/ocft/default/IPaddr2v6 b/tools/ocft/default/IPaddr2v6 +new file mode 100644 +index 0000000..d24d890 +--- /dev/null ++++ b/tools/ocft/default/IPaddr2v6 +@@ -0,0 +1,250 @@ ++# IPaddr2v6 ++ ++# Note: This test case uses two NICs(eth0, eth1) and ++# a IPv6 address prefix (2001:db8::/32, RFC3849). ++# Adjust them according to your environment at VARIABLE section if needed. ++ ++CONFIG ++ Agent IPaddr2 ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 20 ++ ++VARIABLE ++ OCFT_target_ip=2001:db8:1234::2 ++ OCFT_target_nic=eth0 ++ OCFT_target_prefix=64 ++ OCFT_target_netaddr=2001:db8:1234::1/$OCFT_target_prefix ++ OCFT_target_linklocal=fe80::2 ++ OCFT_wrong_ip=2001:db8:5678::2 ++ OCFT_force_nic=eth1 ++ OCFT_force_prefix=80 ++ OCFT_force_prefix2=48 ++ ++SETUP-AGENT ++ ip addr add $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CLEANUP-AGENT ++ ip addr del $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_ip=$OCFT_target_ip ++ Env OCFT_check_ip=$OCFT_target_ip ++ Env OCFT_check_prefix=$OCFT_target_prefix ++ Env OCFT_check_nic=$OCFT_target_nic ++ ++CASE-BLOCK check_ip_assigned ++ Bash ip -6 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv6 address was assigned correctly ++ ++CASE-BLOCK check_ip_removed ++ Bash ! ip -6 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv6 address was removed correctly ++ ++CASE-BLOCK base_ip_assigned ++ Bash ip addr add $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CASE-BLOCK base_ip_removed ++ Bash ip addr del $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include required_args ++ Include default_status ++ ++# CASE No.0 ++# ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ ++# CASE No.1 ++# ++CASE "normal stop" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.2 ++# ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++# CASE No.3 ++# ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++# CASE No.4 ++# ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++# CASE No.5 ++# ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++# CASE No.6 ++# ++CASE "error params with wrong ip" ++ Include prepare ++ Env OCF_RESKEY_ip=$OCFT_wrong_ip ++ AgentRun start OCF_ERR_GENERIC ++ ++# CASE No.7 ++# ++CASE "error params with no nic for a link-local IPv6 address" ++ Include prepare ++ Env OCF_RESKEY_ip=$OCFT_target_linklocal ++ Env OCFT_check_ip=$OCFT_target_linklocal ++ # nic is mandatory for a link-local address ++ AgentRun start OCF_ERR_CONFIGURED ++ ++# CASE No.8 ++# ++CASE "params with nic, no cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.9 ++# ++CASE "normal usage for a link-local IPv6 address, params with nic" ++ Include prepare ++ Env OCF_RESKEY_ip=$OCFT_target_linklocal ++ Env OCFT_check_ip=$OCFT_target_linklocal ++ # nic is mandatory for a link-local address ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ Env OCFT_check_nic=$OCFT_target_nic ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.10 ++# ++CASE "error params with wrong ip and nic (not exist base_ip)" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ Env OCFT_check_nic=$OCFT_target_nic ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ Include base_ip_assigned ++ ++# CASE No.11 ++# ++CASE "params with force nic" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ Env OCFT_check_nic=$OCFT_force_nic ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ Unenv OCF_RESKEY_nic ++ ++# CASE No.12 ++# ++CASE "params with force cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ Env OCFT_check_prefix=$OCFT_target_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.13 ++# ++CASE "params with force cidr_netmask (base netmask < assigned netmask)" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++ Env OCFT_check_prefix=$OCFT_force_prefix ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ ++# CASE No.14 ++# ++CASE "params with force cidr_netmask (base netmask > assigned netmask)" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++ Env OCFT_check_prefix=$OCFT_force_prefix2 ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ ++# CASE No.15 ++# ++CASE "params with cidr_netmask" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ Env OCFT_check_prefix=$OCFT_target_prefix ++ AgentRun start OCF_ERR_GENERIC ++ Include base_ip_assigned ++ ++# CASE No.16 ++# ++CASE "params with nic, cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ Env OCFT_check_nic=$OCFT_target_nic ++ Env OCFT_check_prefix=$OCFT_target_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.17 ++# ++CASE "force to use the specified nic and cidr_netmask (base netmask < assigned netmask)" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++ Env OCFT_check_nic=$OCFT_force_nic ++ Env OCFT_check_prefix=$OCFT_force_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.18 ++# This use case is now valid. It was not allowed until v3.9.2. ++# ++CASE "force to use the specified nic and cidr_netmask (base netmask > assigned netmask)" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++ Env OCFT_check_nic=$OCFT_force_nic ++ Env OCFT_check_prefix=$OCFT_force_prefix2 ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.19 ++# ++CASE "force to use the specified nic and cidr_netmask (base netmask > assigned netmask)" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++ Env OCFT_check_nic=$OCFT_force_nic ++ Env OCFT_check_prefix=$OCFT_force_prefix2 ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ Include base_ip_assigned ++ +diff --git a/tools/ocft/default/IPsrcaddr b/tools/ocft/default/IPsrcaddr +new file mode 100644 +index 0000000..d95142e +--- /dev/null ++++ b/tools/ocft/default/IPsrcaddr +@@ -0,0 +1,63 @@ ++# IPsrcaddr ++ ++CONFIG ++ Agent IPsrcaddr ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage iproute2 ++ HangTimeout 20 ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_ipaddress= # put here your IP ++ Env OCF_RESKEY_cidr_netmask= # and the netmask ++ ++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_ipaddress'" ++ Include prepare ++ Unenv OCF_RESKEY_ipaddress ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: set invalid 'OCF_RESKEY_ipaddress'" ++ Include prepare ++ Env OCF_RESKEY_ipaddress=not_ip_address ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/default/IPv6addr b/tools/ocft/default/IPv6addr +new file mode 100644 +index 0000000..36a9642 +--- /dev/null ++++ b/tools/ocft/default/IPv6addr +@@ -0,0 +1,150 @@ ++# IPv6addr ++ ++# Note: This test case uses two NICs(eth0, eth1) and ++# a IPv6 address prefix (2001:db8::/32, RFC3849). ++# Adjust them according to your environment at VARIABLE section if needed. ++ ++CONFIG ++ Agent IPv6addr ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 20 ++ ++VARIABLE ++ OCFT_target_ipv6addr=2001:db8:1234::2 ++ OCFT_target_nic=eth0 ++ OCFT_target_prefix=64 ++ OCFT_target_netaddr=2001:db8:1234::1/$OCFT_target_prefix ++ OCFT_target_linklocal=fe80::2 ++ OCFT_wrong_ipv6addr=2001:db8:5678::2 ++ OCFT_force_nic=eth1 ++ OCFT_force_prefix=80 ++ ++SETUP-AGENT ++ ip addr add $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CLEANUP-AGENT ++ ip addr del $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_ipv6addr=$OCFT_target_ipv6addr ++ Env OCFT_check_ipv6addr=$OCFT_target_ipv6addr ++ Env OCFT_check_prefix=$OCFT_target_prefix ++ Env OCFT_check_nic=$OCFT_target_nic ++ ++CASE-BLOCK check_ip_assigned ++ Bash ip -6 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ipv6addr/$OCFT_check_prefix >/dev/null # checking if the IPv6 address was assigned correctly ++ ++CASE-BLOCK check_ip_removed ++ Bash ! ip -6 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ipv6addr/$OCFT_check_prefix >/dev/null # checking if the IPv6 address was removed correctly ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include required_args ++ Include default_status ++ ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "params with nic, no cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++CASE "params with nic, cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++CASE "normal usage for a link-local IPv6 address" ++ Include prepare ++ Env OCF_RESKEY_ipv6addr=$OCFT_target_linklocal ++ Env OCFT_check_ipv6addr=$OCFT_target_linklocal ++ # nic is mandatory for a link-local address ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++CASE "error start for a link-local IPv6 address when no nic" ++ Include prepare ++ Env OCF_RESKEY_ipv6addr=$OCFT_target_linklocal ++ # nic is mandatory for a link-local address ++ Unenv OCF_RESKEY_nic ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ ++CASE "error params with wrong ipv6addr" ++ Include prepare ++ Env OCF_RESKEY_ipv6addr=$OCFT_wrong_ipv6addr ++ AgentRun start OCF_ERR_GENERIC ++ ++# Note: this result is different from IPaddr2/findif ++# IPaddr2 succeeds if the ip matched based on the netmask of the subnet ++# or fails if it did not match to any. ++# Recommended to always specify both nic and cidr_netmask when you needed. ++CASE "error params with wrong cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++ AgentRun start OCF_ERR_GENERIC ++ ++# Note: this result is different from IPaddr2/findif ++# IPaddr2 succeeds but it uses /32 as a guessed cidr_netmask which ++# does not seem to be expected. ++# Recommended to always specify both nic and cidr_netmask when you needed. ++CASE "error params with wrong nic" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ AgentRun start OCF_ERR_GENERIC ++ ++# Note: This use case is now valid. It was not allowed until v3.9.2. ++CASE "force to use the specified nic and cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_force_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++ Env OCFT_check_nic=$OCFT_force_nic ++ Env OCFT_check_prefix=$OCFT_force_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed +diff --git a/tools/ocft/default/LVM b/tools/ocft/default/LVM +new file mode 100644 +index 0000000..4bd2b22 +--- /dev/null ++++ b/tools/ocft/default/LVM +@@ -0,0 +1,86 @@ ++# LVM ++# by dejan@suse.de on ++# Wed Feb 16 13:15:01 CET 2011 ++ ++CONFIG ++ Agent LVM ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 20 ++ ++VARIABLE ++ OCFT_pv=/var/run/resource-agents/ocft-LVM-pv ++ OCFT_vg=ocft-vg ++ OCFT_lv=ocft-lv ++ OCFT_loop=/dev/loop7 ++ ++SETUP-AGENT ++ losetup $OCFT_loop 2>/dev/null && exit 1 ++ dd if=/dev/zero of=$OCFT_pv bs=1 count=0 seek=16M 2>/dev/null ++ losetup $OCFT_loop $OCFT_pv ++ pvcreate $OCFT_loop ++ vgcreate -s 4K $OCFT_vg $OCFT_loop ++ lvcreate -n $OCFT_lv -L 600K $OCFT_vg ++ ++CLEANUP-AGENT ++ vgchange -an $OCFT_vg ++ lvremove -f /dev/$OCFT_vg/$OCFT_lv ++ vgremove -f $OCFT_vg ++ pvremove $OCFT_loop ++ losetup -d $OCFT_loop ++ rm $OCFT_pv ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_volgrpname=$OCFT_vg ++ ++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: invalid 'OCF_RESKEY_volgrpname'" ++ Include prepare ++ Env OCF_RESKEY_volgrpname=/dev/no_such_device ++ AgentRun start OCF_ERR_GENERIC ++ ++CASE "check base env: unset 'OCF_RESKEY_volgrpname'" ++ Include prepare ++ Unenv OCF_RESKEY_volgrpname ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor when running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor when not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ +diff --git a/tools/ocft/default/MailTo b/tools/ocft/default/MailTo +new file mode 100644 +index 0000000..8754035 +--- /dev/null ++++ b/tools/ocft/default/MailTo +@@ -0,0 +1,57 @@ ++# MailTo ++ ++CONFIG ++ Agent MailTo ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage mailx ++ HangTimeout 20 ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_email=root@localhost ++ ++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_email'" ++ Include prepare ++ Unenv OCF_RESKEY_email ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/default/Raid1 b/tools/ocft/default/Raid1 +new file mode 100644 +index 0000000..1c239c8 +--- /dev/null ++++ b/tools/ocft/default/Raid1 +@@ -0,0 +1,146 @@ ++# Raid1 ++# by dejan@suse.de on ++# Fri Aug 24 17:01:40 CEST 2012 ++ ++CONFIG ++ Agent Raid1 ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage mdadm ++ HangTimeout 20 ++ ++VARIABLE ++ OCFT_disk0=/var/run/resource-agents/ocft-Raid1-disk0 ++ OCFT_disk1=/var/run/resource-agents/ocft-Raid1-disk1 ++ OCFT_disk2=/var/run/resource-agents/ocft-Raid1-disk2 ++ OCFT_disk3=/var/run/resource-agents/ocft-Raid1-disk3 ++ OCFT_raidconf=/var/run/resource-agents/ocft-mdadm.conf ++ OCFT_raiddev=/dev/md8 ++ OCFT_raiddev2=/dev/md9 ++ OCFT_loop0=/dev/loop6 ++ OCFT_loop1=/dev/loop7 ++ OCFT_loop2=/dev/loop4 ++ OCFT_loop3=/dev/loop5 ++ ++SETUP-AGENT ++ losetup $OCFT_loop0 2>/dev/null && exit 1 ++ losetup $OCFT_loop1 2>/dev/null && exit 1 ++ losetup $OCFT_loop2 2>/dev/null && exit 1 ++ losetup $OCFT_loop3 2>/dev/null && exit 1 ++ dd if=/dev/zero of=$OCFT_disk0 bs=1 count=0 seek=16M 2>/dev/null ++ dd if=/dev/zero of=$OCFT_disk1 bs=1 count=0 seek=16M 2>/dev/null ++ dd if=/dev/zero of=$OCFT_disk2 bs=1 count=0 seek=16M 2>/dev/null ++ dd if=/dev/zero of=$OCFT_disk3 bs=1 count=0 seek=16M 2>/dev/null ++ losetup $OCFT_loop0 $OCFT_disk0 ++ losetup $OCFT_loop1 $OCFT_disk1 ++ losetup $OCFT_loop2 $OCFT_disk2 ++ losetup $OCFT_loop3 $OCFT_disk3 ++ mdadm --create $OCFT_raiddev -l 0 --raid-devices=2 $OCFT_loop0 $OCFT_loop1 ++ mdadm --create $OCFT_raiddev2 -l 0 --raid-devices=2 $OCFT_loop2 $OCFT_loop3 ++ echo DEVICE $OCFT_loop0 $OCFT_loop1 > $OCFT_raidconf ++ echo DEVICE $OCFT_loop2 $OCFT_loop3 >> $OCFT_raidconf ++ echo ARRAY $OCFT_raiddev devices=$OCFT_loop0,$OCFT_loop1 >> $OCFT_raidconf ++ echo ARRAY $OCFT_raiddev2 devices=$OCFT_loop2,$OCFT_loop3 >> $OCFT_raidconf ++ ++CLEANUP-AGENT ++ mdadm --zero-superblock $OCFT_loop0 ++ mdadm --zero-superblock $OCFT_loop1 ++ mdadm --zero-superblock $OCFT_loop2 ++ mdadm --zero-superblock $OCFT_loop3 ++ mdadm --remove $OCFT_raiddev 2>/dev/null ++ mdadm --remove $OCFT_raiddev2 2>/dev/null ++ losetup -d $OCFT_loop0 ++ losetup -d $OCFT_loop1 ++ losetup -d $OCFT_loop2 ++ losetup -d $OCFT_loop3 ++ rm $OCFT_disk0 $OCFT_disk1 $OCFT_raidconf ++ rm $OCFT_disk2 $OCFT_disk3 ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_raidconf=$OCFT_raidconf ++ Env OCF_RESKEY_raiddev=$OCFT_raiddev ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include required_args ++ Include default_status ++ ++CASE-BLOCK prepare_auto ++ Include required_args ++ Env OCF_RESKEY_raiddev="auto" ++ Include default_status ++ ++CASE-BLOCK prepare_multiple ++ Include required_args ++ Env OCF_RESKEY_raiddev="$OCFT_raiddev $OCFT_raiddev2" ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: invalid 'OCF_RESKEY_raiddev'" ++ Include prepare ++ Env OCF_RESKEY_raiddev=/dev/no_such_device ++ AgentRun start OCF_ERR_GENERIC ++ ++CASE "check base env: unset 'OCF_RESKEY_raiddev'" ++ Include prepare ++ Unenv OCF_RESKEY_raiddev ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor when running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor when not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "normal start (auto)" ++ Include prepare_auto ++ AgentRun start OCF_SUCCESS ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "normal stop (auto)" ++ Include prepare_auto ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "normal start (multiple)" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "normal stop (multiple)" ++ Include prepare ++ Env OCF_RESKEY_raiddev="$OCFT_raiddev $OCFT_raiddev2" ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ +diff --git a/tools/ocft/default/SendArp b/tools/ocft/default/SendArp +new file mode 100644 +index 0000000..7880388 +--- /dev/null ++++ b/tools/ocft/default/SendArp +@@ -0,0 +1,74 @@ ++# SendArp ++ ++CONFIG ++ Agent SendArp ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage resource-agents ++ HangTimeout 15 ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_ip=127.0.0.1 ++ Env OCF_RESKEY_nic=lo ++ Env OCF_RESKEY_background=false ++ ++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_ip'" ++ Include prepare ++ Unenv OCF_RESKEY_ip ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: set invalid 'OCF_RESKEY_ip'" ++ Include prepare ++ Env OCF_RESKEY_ip=not_ip_address ++ AgentRun start OCF_ERR_GENERIC ++ ++CASE "check base env: unset 'OCF_RESKEY_nic'" ++ Include prepare ++ Unenv OCF_RESKEY_nic ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: set invalid 'OCF_RESKEY_nic'" ++ Include prepare ++ Env OCF_RESKEY_nic=not_nic ++ AgentRun start OCF_ERR_GENERIC ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/default/Xinetd b/tools/ocft/default/Xinetd +new file mode 100644 +index 0000000..ba9c85c +--- /dev/null ++++ b/tools/ocft/default/Xinetd +@@ -0,0 +1,56 @@ ++# Xinetd ++ ++CONFIG ++ Agent Xinetd ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage xinetd ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_service=discard ++ ++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_protocol'" ++ Include prepare ++ Unenv OCF_RESKEY_service ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/default/apache b/tools/ocft/default/apache +new file mode 100644 +index 0000000..e939044 +--- /dev/null ++++ b/tools/ocft/default/apache +@@ -0,0 +1,63 @@ ++# apache ++# make sure that your apache configuration loads mod_status ++ ++CONFIG ++ Agent apache ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage apache2 ++ HangTimeout 20 ++ ++SETUP-AGENT ++ /etc/init.d/apache2 start ++ /etc/init.d/apache2 stop ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: set non-existing OCF_RESKEY_statusurl" ++ Include prepare ++ Env OCF_RESKEY_statusurl="yoyoyoyo" ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: set non-existing OCF_RESKEY_configfile" ++ Include prepare ++ Env OCF_RESKEY_configfile="/yoyoyoyo/nosuchfile" ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "running monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "not running monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/default/db2 b/tools/ocft/default/db2 +new file mode 100644 +index 0000000..7013a99 +--- /dev/null ++++ b/tools/ocft/default/db2 +@@ -0,0 +1,164 @@ ++# db2 ++# ++# This test assumes a db2 ESE instance with two partions and a database. ++# Default is instance=db2inst1, database=ocft ++# adapt this in set_testenv below ++# ++# Simple steps to generate a test environment (if you don't have one): ++# ++# A virtual machine with 1200MB RAM is sufficient ++# ++# - download an eval version of DB2 server from IBM ++# - create an user "db2inst1" in group "db2inst1" ++# ++# As root ++# - install DB2 software in some location ++# - create instance ++# cd /instance ++# ./db2icrt -s ese -u db2inst1 db2inst1 ++# - adapt profile of db2inst1 as instructed by db2icrt ++# ++# As db2inst1 ++# # allow to run with small memory footprint ++# db2set DB2_FCM_SETTINGS=FCM_MAXIMIZE_SET_SIZE:FALSE ++# db2start ++# db2start dbpartitionnum 1 add dbpartitionnum hostname $(uname -n) port 1 without tablespaces ++# db2stop ++# db2start ++# db2 create database ocft ++# Done ++# In order to install a real cluster refer to http://www.linux-ha.org/wiki/db2_(resource_agent) ++ ++CONFIG ++ Agent db2 ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 40 ++ ++SETUP-AGENT ++ # nothing ++ ++CASE-BLOCK set_testenv ++ Env OCFT_instance=db2inst1 ++ Env OCFT_db=ocft ++ ++CASE-BLOCK crm_setting ++ Env OCF_RESKEY_instance=$OCFT_instance ++ Env OCF_RESKEY_CRM_meta_timeout=30000 ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include set_testenv ++ Include crm_setting ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: invalid 'OCF_RESKEY_instance'" ++ Include prepare ++ Env OCF_RESKEY_instance=no_such ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "invalid instance config" ++ Include prepare ++ Bash eval mv ~$OCFT_instance/sqllib ~$OCFT_instance/sqllib- ++ BashAtExit eval mv ~$OCFT_instance/sqllib- ~$OCFT_instance/sqllib ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "started: monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "not started: monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "killed instance: monitor" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ AgentRun monitor OCF_SUCCESS ++ BashAtExit rm /tmp/ocft-helper1 ++ Bash echo "su $OCFT_instance -c '. ~$OCFT_instance/sqllib/db2profile; db2nkill 0 >/dev/null 2>&1'" > /tmp/ocft-helper1 ++ Bash sh -x /tmp/ocft-helper1 ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "overload param instance by admin" ++ Include prepare ++ Env OCF_RESKEY_instance=no_such ++ Env OCF_RESKEY_admin=$OCFT_instance ++ AgentRun start OCF_SUCCESS ++ ++CASE "check start really activates db" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++ BashAtExit rm /tmp/ocft-helper2 ++ Bash echo "su $OCFT_instance -c '. ~$OCFT_instance/sqllib/db2profile; db2 get snapshot for database on $OCFT_db>/dev/null'" > /tmp/ocft-helper2 ++ Bash sh -x /tmp/ocft-helper2 ++ ++CASE "multipartion test" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ AgentRun monitor OCF_SUCCESS ++ ++ # start does not start partion 1 ++ Env OCF_RESKEY_dbpartitionnum=1 ++ AgentRun monitor OCF_NOT_RUNNING ++ ++ # now start 1 ++ AgentRun start OCF_SUCCESS ++ AgentRun monitor OCF_SUCCESS ++ ++ # now stop 1 ++ AgentRun stop OCF_SUCCESS ++ AgentRun monitor OCF_NOT_RUNNING ++ ++ # does not affect 0 ++ Env OCF_RESKEY_dbpartitionnum=0 ++ AgentRun monitor OCF_SUCCESS ++ ++# fault injection does not work on the 1.0.4 client due to a hardcoded path ++CASE "simulate hanging db2stop (not meaningful for 1.0.4 agent)" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ Bash [ ! -f /usr/local/bin/db2stop ] ++ BashAtExit rm /usr/local/bin/db2stop ++ Bash echo -e "#!/bin/sh\necho fake db2stop\nsleep 10000" > /usr/local/bin/db2stop ++ Bash chmod +x /usr/local/bin/db2stop ++ AgentRun stop OCF_SUCCESS ++ ++# fault injection does not work on the 1.0.4 client due to a hardcoded path ++CASE "simulate not stopping db2stop (not meaningful for 1.0.4 agent)" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ Bash [ ! -f /usr/local/bin/db2stop ] ++ BashAtExit rm /usr/local/bin/db2stop ++ Bash echo -e "#!/bin/sh\necho fake db2stop\nexit 0" > /usr/local/bin/db2stop ++ Bash chmod +x /usr/local/bin/db2stop ++ AgentRun stop OCF_SUCCESS +diff --git a/tools/ocft/default/drbd.linbit b/tools/ocft/default/drbd.linbit +new file mode 100644 +index 0000000..4cc5519 +--- /dev/null ++++ b/tools/ocft/default/drbd.linbit +@@ -0,0 +1,183 @@ ++# linbit: drbd ++ ++CONFIG ++ Agent drbd ++ AgentRoot /usr/lib/ocf/resource.d/linbit ++ InstallPackage drbd ++ HangTimeout 20 ++ ++VARIABLE ++ DRBDCONF=/tmp/ocft_drbd_tmp.conf ++ ++ # should be this machine's hostname/ip, please modify it by yourself. ++ NAME_1=HOSTNAME1 ++ IP_1=IP_ADDRESS1 ++ ++ # the block device just for test, please modify it by yourself. ++ DISK_1=/dev/DEVICE1 ++ ++ PORT_1=5735 ++ DEVICE_1=/dev/drbd0 ++ ++ #################################################################### ++ ++ # please modify it by yourself. ++ NAME_2=HOSTNAME2 ++ IP_2=IP_ADDRESS2 ++ ++ # the block device just for test, please modify it by yourself. ++ DISK_2=/dev/DEVICE2 ++ ++ PORT_2=5735 ++ DEVICE_2=/dev/drbd0 ++ ++ ++ ++SETUP-AGENT ++ cat >$DRBDCONF </dev/null 2>&1 ++ if [ $? -eq 255 ]; then ++ $DRBDADM create-md ocft0 ++ fi ++ ++ # start drbd ++ $DRBDADM up ocft0 ++ ++ # UpToDate ++ if [ "$HOST" = "$NAME_1" ]; then ++ $DRBDADM wait-connect ocft0 ++ echo "drbd Syncing .." ++ $DRBDADM primary --force ocft0 ++ while true; do ++ CSTATE=$($DRBDADM cstate ocft0) ++ DSTATE=$($DRBDADM dstate ocft0) ++ if [ "$CSTATE" = "Connected" -a "$DSTATE" = "UpToDate/UpToDate" ]; then ++ break ++ else ++ sleep 3 ++ fi ++ done ++ echo "done" ++ fi ++ ++CLEANUP-AGENT ++ drbdadm -c $DRBDCONF down ocft0 ++ rm -f $DRBDCONF ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_drbdconf=$DRBDCONF ++ Env OCF_RESKEY_drbd_resource=ocft0 ++ Env OCF_RESKEY_CRM_meta_notify=true ++ Env OCF_RESKEY_CRM_meta_clone_max=2 ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include required_args ++ Include default_status ++ ++CASE "check base env" ++ Include required_args ++ AgentRun validate-all OCF_SUCCESS ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "wrong path of config file" ++ Include prepare ++ Env OCF_RESKEY_drbdconf=no_such_file ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "wrong resource name" ++ Include prepare ++ Env OCF_RESKEY_drbd_resource=no_such_src ++ # OCF_RESKEY_drbd_resource is a required parameter in agent meta-data, ++ # if wrong, I think the agent should return OCF_ERR_CONFIGURED. ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "running monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "not running monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "Primary/Secondary monitor" ++ Include prepare ++ AgentRun start ++ AgentRun promote ++ AgentRun monitor OCF_RUNNING_MASTER ++ AgentRun demote ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ ++CASE "try to 'promote' in single-primary mode" ++ Include prepare ++ Include@$IP_2 prepare ++ ++ # start drbd ++ AgentRun start ++ AgentRun@$IP_2 start ++ ++ # promote local drbd first ++ AgentRun promote OCF_SUCCESS ++ ++ # demote local drbd prepare for remote drbd promote ++ AgentRun demote ++ # remote drbd promote ++ AgentRun@$IP_2 promote OCF_SUCCESS ++ ++ # promote fails, because remote drbd promote first. ++ AgentRun promote OCF_ERR_GENERIC +diff --git a/tools/ocft/default/exportfs b/tools/ocft/default/exportfs +new file mode 100644 +index 0000000..c83520d +--- /dev/null ++++ b/tools/ocft/default/exportfs +@@ -0,0 +1,74 @@ ++# exportfs ++# ++# ++ ++CONFIG ++ Agent exportfs ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 40 ++ ++SETUP-AGENT ++ # nothing ++ ++CASE-BLOCK set_testenv ++ Env OCF_RESKEY_directory=/usr ++ Env OCF_RESKEY_fsid=105 ++ Env OCF_RESKEY_clientspec="*" ++ Env OCF_RESKEY_CRM_meta_timeout=30000 ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include set_testenv ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: no 'OCF_RESKEY_fsid'" ++ Include prepare ++ Env OCF_RESKEY_fsid= ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: invalid 'OCF_RESKEY_directory'" ++ Include prepare ++ Env OCF_RESKEY_directory=/no_such ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "stop with no env" ++ Include prepare ++ Env OCF_RESKEY_directory=/no_such ++ AgentRun stop OCF_SUCCESS ++ ++CASE "started: monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "not started: monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING +diff --git a/tools/ocft/default/iscsi b/tools/ocft/default/iscsi +new file mode 100644 +index 0000000..c1325a1 +--- /dev/null ++++ b/tools/ocft/default/iscsi +@@ -0,0 +1,82 @@ ++# iscsi ++ ++CONFIG ++ Agent iscsi ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage open-iscsi ++ InstallPackage iscsitarget ++ HangTimeout 20 ++ ++VARIABLE ++ OCFT_disk=/var/run/resource-agents/ocft-iscsi ++ OCFT_target="iqn.2011-03.ocft.localhost:disk0" ++ OCFT_portal="127.0.0.1:3260" ++ ++SETUP-AGENT ++ dd if=/dev/zero of=$OCFT_disk bs=1024k count=1 2>/dev/null ++ echo Target $OCFT_target >> /etc/ietd.conf ++ echo " Lun 0 Path=$OCFT_disk,Type=fileio" >> /etc/ietd.conf ++ /etc/init.d/iscsitarget start ++ /etc/init.d/open-iscsi start ++ /etc/init.d/iscsitarget restart ++ ++CLEANUP-AGENT ++ rm -f $OCFT_disk ++ sed -i "/^Target $OCFT_target/,+1d" /etc/ietd.conf ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_portal=$OCFT_portal ++ Env OCF_RESKEY_target=$OCFT_target ++ ++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: invalid 'OCF_RESKEY_portal'" ++ Include prepare ++ Unenv OCF_RESKEY_portal ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: unset 'OCF_RESKEY_target'" ++ Include prepare ++ Unenv OCF_RESKEY_target ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor when running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor when not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ +diff --git a/tools/ocft/default/jboss b/tools/ocft/default/jboss +new file mode 100644 +index 0000000..bc99d8f +--- /dev/null ++++ b/tools/ocft/default/jboss +@@ -0,0 +1,83 @@ ++# jboss ++# ++# NOTE: Clean up $jboss_home/standalone/log before running this test ++# otherwise creating the pid/log files may fail ++# in the test case with a different user. ++ ++CONFIG ++ Agent jboss ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 120 ++ ++# Note : Change setting by a version of JBoss. ++# ++VARIABLE ++ # JBoss5 Environment require ++# jboss_version=5 ++# jboss_home=/opt/jboss5/current ++# java_home=/usr/lib/jvm/java-1.6.0-openjdk.x86_64 ++# user=jboss5 ++ # JBoss6 Environment require ++ jboss_version=6 ++ jboss_home=/opt/jboss6/current ++ java_home=/usr/lib/jvm/java-1.7.0-openjdk.x86_64 ++ user=jboss6 ++ ++CASE-BLOCK required_args_jboss ++ Env OCF_RESKEY_jboss_home=${jboss_home} ++ Env OCF_RESKEY_java_home=${java_home} ++ Env OCF_RESKEY_jboss_version=${jboss_version} ++ Env OCF_RESKEY_user=${user} ++ ++CASE-BLOCK args_clear ++ Unenv OCF_RESKEY_jboss_home ++ Unenv OCF_RESKEY_java_home ++ Unenv OCF_RESKEY_jboss_version ++ Unenv OCF_RESKEY_user ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare_jboss ++ Include required_args_jboss ++ Include default_status ++ ++# Test CASE ++# ++CASE "normal start jboss require_args (user:user)" ++ Include prepare_jboss ++ AgentRun start OCF_SUCCESS ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ AgentRun monitor OCF_NOT_RUNNING ++ Include args_clear ++ ++CASE "normal start jboss require_args (user:root)" ++ Include prepare_jboss ++ Unenv OCF_RESKEY_user ++ AgentRun start OCF_SUCCESS ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ AgentRun monitor OCF_NOT_RUNNING ++ Include args_clear ++ ++CASE "error start jboss no jboss_home" ++ Include prepare_jboss ++ Unenv OCF_RESKEY_jboss_home ++ AgentRun start OCF_ERR_INSTALLED ++ Include args_clear ++ ++CASE "error start jboss no java_home" ++ Include prepare_jboss ++ Unenv OCF_RESKEY_java_home ++ AgentRun start OCF_ERR_INSTALLED ++ Include args_clear ++ ++CASE "error start jboss no java command" ++ Include prepare_jboss ++ Env OCF_RESKEY_java_home=/var ++ AgentRun start OCF_ERR_INSTALLED ++ AgentRun stop OCF_SUCCESS ++ AgentRun monitor OCF_NOT_RUNNING ++ Include args_clear ++ +diff --git a/tools/ocft/default/mysql b/tools/ocft/default/mysql +new file mode 100644 +index 0000000..27fcb58 +--- /dev/null ++++ b/tools/ocft/default/mysql +@@ -0,0 +1,77 @@ ++# mysql ++ ++CONFIG ++ Agent mysql ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage mariadb ++ InstallPackage mariadb-server ++ HangTimeout 20 ++ ++SETUP-AGENT ++ /etc/init.d/mysql start ++ /etc/init.d/mysql stop ++ ++CASE-BLOCK crm_setting ++ Env OCF_RESKEY_CRM_meta_timeout=15000 ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include crm_setting ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: invalid 'OCF_RESKEY_binary'" ++ Include prepare ++ Env OCF_RESKEY_binary=no_such ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "running monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "not running monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "check lib file" ++ Include prepare ++ Bash chmod u-w /var/lib/mysql ++ BashAtExit chmod u+w /var/lib/mysql ++ AgentRun start OCF_ERR_PERM ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ ++CASE "non-existent user" ++ Include prepare ++ Env OCF_RESKEY_user=no_user ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "invalid user" ++ Include prepare ++ Env OCF_RESKEY_user=nobody ++ AgentRun start OCF_ERR_PERM +diff --git a/tools/ocft/default/mysql-proxy b/tools/ocft/default/mysql-proxy +new file mode 100644 +index 0000000..e16d52b +--- /dev/null ++++ b/tools/ocft/default/mysql-proxy +@@ -0,0 +1,83 @@ ++# mysql-proxy ++# by r.bhatia@ipax.at ++# ++# test cases (to implement): ++# ++# * /usr/sbin/ocf-tester -n mp -o binary="/usr/sbin/mysql-proxy" -o defaults_file="" -o parameters="--proxy-skip-profiling" \ ++# -o admin_address="127.0.0.1:4041" -o admin_username="root" -o admin_password="la" -o admin_lua_script="/usr/lib/mysql-proxy/lua/admin.lua" \ ++# -o proxy_backend_addresses="192.168.100.200:42006" -o proxy_address="/var/run/mysqld/mysqld.sock" /usr/lib/ocf/resource.d/heartbeat/mysql-proxy ++# ++# * OCF_CHECK_LEVEL 20 check ++ ++CONFIG ++ Agent mysql-proxy ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat/ ++ InstallPackage mysql-proxy ++ HangTimeout 20 ++ ++SETUP-AGENT ++ # nothing ++ ++CASE-BLOCK crm_setting ++ Env OCF_RESKEY_CRM_meta_timeout=15000 ++ Env OCF_RESKEY_binary=/tmp/mysql-proxy ++ Env OCF_RESKEY_admin_username=root ++ Env OCF_RESKEY_admin_password=test123 ++ Env OCF_RESKEY_admin_lua_script=/usr/lib/mysql-proxy/lua/admin.lua ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Bash [ ! -x /tmp/mysql-proxy ] && ln -s `which mysql-proxy` /tmp/mysql-proxy || true ++ Include crm_setting ++ ++CASE-BLOCK teardown ++ AgentRun stop ++ BashAtExit rm -f /tmp/mysql-proxy ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ Include teardown ++ ++CASE "check base env: invalid 'OCF_RESKEY_binary'" ++ Include prepare ++ Env OCF_RESKEY_binary=no_such ++ AgentRun start OCF_ERR_INSTALLED ++ BashAtExit rm -f /tmp/mysql-proxy ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ Include teardown ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ Include teardown ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ Include teardown ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "running monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ Include teardown ++ ++CASE "not running monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/default/named b/tools/ocft/default/named +new file mode 100644 +index 0000000..90a4351 +--- /dev/null ++++ b/tools/ocft/default/named +@@ -0,0 +1,69 @@ ++#named ++ ++# To work properly this test requires that standard bind and bin-utils ++# packages installed. ++ ++CONFIG ++ Agent named ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage bind ++ InstallPackage bind-utils ++ ++SETUP-AGENT ++ /etc/init.d/named start ++ /etc/init.d/named stop ++ ++CASE-BLOCK crm_setting ++ Env OCF_RESKEY_CRM_meta_timeout=15000 ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include crm_setting ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: invalid 'OCF_RESKEY_named'" ++ Include prepare ++ Env OCF_RESKEY_named=no_such ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "running monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "not running monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ ++CASE "non-existent user" ++ Include prepare ++ Env OCF_RESKEY_named_user=no_user ++ AgentRun start OCF_ERR_INSTALLED +diff --git a/tools/ocft/default/nfsserver b/tools/ocft/default/nfsserver +new file mode 100644 +index 0000000..cd73164 +--- /dev/null ++++ b/tools/ocft/default/nfsserver +@@ -0,0 +1,75 @@ ++# nfsserver ++ ++CONFIG ++ Agent nfsserver ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage nfs-kernel-server ++ HangTimeout 20 ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_nfs_init_script=/etc/init.d/nfsserver ++ Env OCF_RESKEY_nfs_ip=127.0.0.1 ++ Env OCF_RESKEY_nfs_shared_infodir=/var/lib/nfs ++ Env OCF_RESKEY_nfs_notify_cmd=/usr/sbin/sm-notify ++ ++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: invalid 'OCF_RESKEY_nfs_init_script'" ++ Include prepare ++ Env OCF_RESKEY_nfs_init_script=no_such_script ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "check base env: unset 'OCF_RESKEY_nfs_ip'" ++ Include prepare ++ Unenv OCF_RESKEY_nfs_ip ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: unset 'OCF_RESKEY_nfs_shared_infodir'" ++ Include prepare ++ Unenv OCF_RESKEY_nfs_shared_infodir ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: invalid 'OCF_RESKEY_nfs_notify_cmd'" ++ Include prepare ++ Env OCF_RESKEY_nfs_notify_cmd=no_such_program ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/default/oracle b/tools/ocft/default/oracle +new file mode 100644 +index 0000000..6f145c7 +--- /dev/null ++++ b/tools/ocft/default/oracle +@@ -0,0 +1,81 @@ ++# oracle ++# (based on db2) ++# ++# Created on an SLE11SP2 running oracle 11g ++# database sid is orcl ++# adapt this in set_testenv below ++# TODO: need oracle expert to break it, then test it ++# ++ ++CONFIG ++ Agent oracle ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 40 ++ ++SETUP-AGENT ++ # nothing ++ ++CASE-BLOCK set_testenv ++ Env OCFT_sid=orcl ++ ++CASE-BLOCK crm_setting ++ Env OCF_RESKEY_sid=$OCFT_sid ++ Env OCF_RESKEY_CRM_meta_timeout=30000 ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include set_testenv ++ Include crm_setting ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: no 'OCF_RESKEY_sid'" ++ Include prepare ++ Env OCF_RESKEY_sid= ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: invalid 'OCF_RESKEY_home'" ++ Include prepare ++ Env OCF_RESKEY_home=/no_such ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "started: monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "not started: monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "try different ipcrm method" ++ Include prepare ++ Env OCF_RESKEY_ipcrm=none ++ AgentRun start OCF_SUCCESS +diff --git a/tools/ocft/default/pgsql b/tools/ocft/default/pgsql +new file mode 100644 +index 0000000..9944b09 +--- /dev/null ++++ b/tools/ocft/default/pgsql +@@ -0,0 +1,71 @@ ++# pgsql ++ ++CONFIG ++ Agent pgsql ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage postgresql-server ++ HangTimeout 20 ++ ++SETUP-AGENT ++ /etc/init.d/postgresql start ++ /etc/init.d/postgresql stop ++ ++CASE-BLOCK crm_setting ++ Env OCF_RESKEY_CRM_meta_timeout=15000 ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include crm_setting ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: invalid 'OCF_RESKEY_pgctl'" ++ Include prepare ++ Env OCF_RESKEY_pgctl=no_such ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "running monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "not running monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ ++CASE "non-existent user" ++ Include prepare ++ Env OCF_RESKEY_pgdba=no_user ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "invalid user" ++ Include prepare ++ Env OCF_RESKEY_pgdba=nobody ++ AgentRun start OCF_ERR_PERM +diff --git a/tools/ocft/default/portblock b/tools/ocft/default/portblock +new file mode 100644 +index 0000000..3475c63 +--- /dev/null ++++ b/tools/ocft/default/portblock +@@ -0,0 +1,69 @@ ++# portblock ++ ++CONFIG ++ Agent portblock ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage iptables ++ HangTimeout 15 ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_protocol=tcp ++ Env OCF_RESKEY_portno=80 ++ Env OCF_RESKEY_action=block ++ ++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_protocol'" ++ Include prepare ++ Unenv OCF_RESKEY_protocol ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: unset 'OCF_RESKEY_portno'" ++ Include prepare ++ Unenv OCF_RESKEY_portno ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: unset 'OCF_RESKEY_action'" ++ Include prepare ++ Unenv OCF_RESKEY_action ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/default/postfix b/tools/ocft/default/postfix +new file mode 100644 +index 0000000..f17e968 +--- /dev/null ++++ b/tools/ocft/default/postfix +@@ -0,0 +1,102 @@ ++# postfix ++# by r.bhatia@ipax.at ++# ++# test cases (to implement): ++# ++# * /usr/sbin/ocf-tester -n post1 /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? -> DONE ++# * /usr/sbin/ocf-tester -n post2 -o binary="/usr/sbin/postfix" \ ++# -o config_dir="" /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? -> DONE ++# * /usr/sbin/ocf-tester -n post3 -o binary="/usr/sbin/postfix" \ ++# -o config_dir="/etc/postfix" /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? -> DONE ++# * /usr/sbin/ocf-tester -n post4 -o binary="/usr/sbin/postfix" \ ++# -o config_dir="/root/postfix/" /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? ++ ++CONFIG ++ Agent postfix ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage postfix ++ HangTimeout 20 ++ ++SETUP-AGENT ++ # nothing ++ ++CASE-BLOCK crm_setting ++ Env OCF_RESKEY_CRM_meta_timeout=15000 ++ Env OCF_RESKEY_CRM_meta_interval=10000 ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include crm_setting ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: invalid 'OCF_RESKEY_binary'" ++ Include prepare ++ Env OCF_RESKEY_binary=no_such ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "check base env: invalid 'OCF_RESKEY_config_dir'" ++ Include prepare ++ Env OCF_RESKEY_config_dir=no_such ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "check base env: 'OCF_RESKEY_binary'" ++ Include prepare ++ Env OCF_RESKEY_binary=/usr/sbin/postfix ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "check base env: 'OCF_RESKEY_config_dir' without trailing slash" ++ Include prepare ++ Env OCF_RESKEY_config_dir="/etc/postfix" ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "check base env: 'OCF_RESKEY_config_dir' with trailing slash" ++ Include prepare ++ Env OCF_RESKEY_config_dir="/etc/postfix/" ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor a running resource" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "(initial) probe a stopped resource" ++ Include prepare ++ Env OCF_RESKEY_CRM_meta_interval=0 ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "(re-)probe a running resource" ++ Include prepare ++ Env OCF_RESKEY_CRM_meta_interval=0 ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/default/tomcat b/tools/ocft/default/tomcat +new file mode 100644 +index 0000000..56adf86 +--- /dev/null ++++ b/tools/ocft/default/tomcat +@@ -0,0 +1,73 @@ ++# tomcat ++# ++# NOTE: Clean up $catalina_home/logs before running this test ++# otherwise creating the pid/log files may fail ++# in the test case with a different user. ++ ++CONFIG ++ Agent tomcat ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 120 ++ ++VARIABLE ++ # Adjust accrding to your configuration ++ catalina_home=/opt/tomcat7 ++ tomcat_user=tomcat7 ++ java_home=/usr/lib/jvm/java-1.6.0-openjdk.x86_64 ++ ++CASE-BLOCK required_args_tomcat ++ Env OCF_RESKEY_catalina_home=${catalina_home} ++ Env OCF_RESKEY_tomcat_user=${tomcat_user} ++ Env OCF_RESKEY_java_home=${java_home} ++ ++CASE-BLOCK args_clear ++ Unenv OCF_RESKEY_catalina_home ++ Unenv OCF_RESKEY_tomcat_user ++ Unenv OCF_RESKEY_java_home ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare_tomcat ++ Include required_args_tomcat ++ Include default_status ++ ++# Test CASE ++# ++CASE "normal start tomcat require_args (user:user)" ++ Include prepare_tomcat ++ AgentRun start OCF_SUCCESS ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ AgentRun monitor OCF_NOT_RUNNING ++ Include args_clear ++ ++CASE "normal start tomcat require_args (user:root)" ++ Include prepare_tomcat ++ Unenv OCF_RESKEY_tomcat_user ++ AgentRun start OCF_SUCCESS ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ AgentRun monitor OCF_NOT_RUNNING ++ Include args_clear ++ ++CASE "error start tomcat no catalina_home" ++ Include prepare_tomcat ++ Unenv OCF_RESKEY_catalina_home ++ AgentRun start OCF_ERR_INSTALLED ++ Include args_clear ++ ++CASE "error start tomcat no java_home" ++ Include prepare_tomcat ++ Unenv OCF_RESKEY_java_home ++ AgentRun start OCF_ERR_INSTALLED ++ Include args_clear ++ ++CASE "error start tomcat no java command" ++ Include prepare_tomcat ++ Env OCF_RESKEY_java_home=/var ++ AgentRun start OCF_ERR_INSTALLED ++ AgentRun stop OCF_SUCCESS ++ AgentRun monitor OCF_NOT_RUNNING ++ Include args_clear ++ +diff --git a/tools/ocft/drbd.linbit b/tools/ocft/drbd.linbit +deleted file mode 100644 +index 4cc5519..0000000 +--- a/tools/ocft/drbd.linbit ++++ /dev/null +@@ -1,183 +0,0 @@ +-# linbit: drbd +- +-CONFIG +- Agent drbd +- AgentRoot /usr/lib/ocf/resource.d/linbit +- InstallPackage drbd +- HangTimeout 20 +- +-VARIABLE +- DRBDCONF=/tmp/ocft_drbd_tmp.conf +- +- # should be this machine's hostname/ip, please modify it by yourself. +- NAME_1=HOSTNAME1 +- IP_1=IP_ADDRESS1 +- +- # the block device just for test, please modify it by yourself. +- DISK_1=/dev/DEVICE1 +- +- PORT_1=5735 +- DEVICE_1=/dev/drbd0 +- +- #################################################################### +- +- # please modify it by yourself. +- NAME_2=HOSTNAME2 +- IP_2=IP_ADDRESS2 +- +- # the block device just for test, please modify it by yourself. +- DISK_2=/dev/DEVICE2 +- +- PORT_2=5735 +- DEVICE_2=/dev/drbd0 +- +- +- +-SETUP-AGENT +- cat >$DRBDCONF </dev/null 2>&1 +- if [ $? -eq 255 ]; then +- $DRBDADM create-md ocft0 +- fi +- +- # start drbd +- $DRBDADM up ocft0 +- +- # UpToDate +- if [ "$HOST" = "$NAME_1" ]; then +- $DRBDADM wait-connect ocft0 +- echo "drbd Syncing .." +- $DRBDADM primary --force ocft0 +- while true; do +- CSTATE=$($DRBDADM cstate ocft0) +- DSTATE=$($DRBDADM dstate ocft0) +- if [ "$CSTATE" = "Connected" -a "$DSTATE" = "UpToDate/UpToDate" ]; then +- break +- else +- sleep 3 +- fi +- done +- echo "done" +- fi +- +-CLEANUP-AGENT +- drbdadm -c $DRBDCONF down ocft0 +- rm -f $DRBDCONF +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_drbdconf=$DRBDCONF +- Env OCF_RESKEY_drbd_resource=ocft0 +- Env OCF_RESKEY_CRM_meta_notify=true +- Env OCF_RESKEY_CRM_meta_clone_max=2 +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include required_args +- Include default_status +- +-CASE "check base env" +- Include required_args +- AgentRun validate-all OCF_SUCCESS +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "wrong path of config file" +- Include prepare +- Env OCF_RESKEY_drbdconf=no_such_file +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "wrong resource name" +- Include prepare +- Env OCF_RESKEY_drbd_resource=no_such_src +- # OCF_RESKEY_drbd_resource is a required parameter in agent meta-data, +- # if wrong, I think the agent should return OCF_ERR_CONFIGURED. +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "running monitor" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "not running monitor" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "Primary/Secondary monitor" +- Include prepare +- AgentRun start +- AgentRun promote +- AgentRun monitor OCF_RUNNING_MASTER +- AgentRun demote +- AgentRun monitor OCF_SUCCESS +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +- +-CASE "try to 'promote' in single-primary mode" +- Include prepare +- Include@$IP_2 prepare +- +- # start drbd +- AgentRun start +- AgentRun@$IP_2 start +- +- # promote local drbd first +- AgentRun promote OCF_SUCCESS +- +- # demote local drbd prepare for remote drbd promote +- AgentRun demote +- # remote drbd promote +- AgentRun@$IP_2 promote OCF_SUCCESS +- +- # promote fails, because remote drbd promote first. +- AgentRun promote OCF_ERR_GENERIC +diff --git a/tools/ocft/fedora/Filesystem b/tools/ocft/fedora/Filesystem +new file mode 100644 +index 0000000..4e1981f +--- /dev/null ++++ b/tools/ocft/fedora/Filesystem +@@ -0,0 +1,110 @@ ++# Filesystem ++# by dejan@suse.de on ++# Tue Feb 15 18:50:04 CET 2011 ++ ++CONFIG ++ Agent Filesystem ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 20 ++ ++VARIABLE ++ OCFT_fs=/tmp/resource-agents/ocft-Filesystem-fs ++ OCFT_loop=/dev/loop7 ++ OCFT_dir=/tmp/resource-agents/ocft-Filesystem-mnt ++ ++SETUP-AGENT ++ losetup $OCFT_loop 2>/dev/null && exit 1 ++ rmdir $OCFT_dir 2>/dev/null || true ++ mkdir -p $OCFT_dir ++ dd if=/dev/zero of=$OCFT_fs bs=1 count=0 seek=16M 2>/dev/null ++ mke2fs -j -Fq -m 0 $OCFT_fs ++ losetup $OCFT_loop $OCFT_fs ++ ++CLEANUP-AGENT ++ rmdir $OCFT_dir ++ rm -f $OCFT_fs ++ losetup -d $OCFT_loop ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_device=$OCFT_loop ++ Env OCF_RESKEY_fstype=ext3 ++ Env OCF_RESKEY_directory=$OCFT_dir ++ ++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: invalid 'OCF_RESKEY_device'" ++ Include prepare ++ Env OCF_RESKEY_device=/dev/no_such_device ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "check base env: unset 'OCF_RESKEY_device'" ++ Include prepare ++ Unenv OCF_RESKEY_device ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor when running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor when not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "monitor depth 10 when running" ++ Include prepare ++ AgentRun start ++ Env OCF_CHECK_LEVEL=10 ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor depth 20 with running" ++ Include prepare ++ AgentRun start ++ Env OCF_CHECK_LEVEL=20 ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "start insert failure (remove device)" ++ Include prepare ++ Bash losetup -d $OCFT_loop ++ BashAtExit losetup $OCFT_loop $OCFT_fs ++ AgentRun start OCF_ERR_GENERIC ++ ++CASE "monitor depth 20 insert failure (r/o fs)" ++ Include prepare ++ AgentRun start ++ Bash mount -o remount,ro $OCFT_dir ++ BashAtExit mount -o remount,rw $OCFT_dir ++ Env OCF_CHECK_LEVEL=20 ++ AgentRun monitor OCF_ERR_GENERIC ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ +diff --git a/tools/ocft/fedora/IPaddr2v4 b/tools/ocft/fedora/IPaddr2v4 +new file mode 100644 +index 0000000..a0df278 +--- /dev/null ++++ b/tools/ocft/fedora/IPaddr2v4 +@@ -0,0 +1,323 @@ ++# IPaddr2v4 ++ ++# Note: This test case uses two NICs(eth0, eth1) and ++# a IPv4 address prefix (192.168.144.0/24). ++# Adjust them according to your environment at VARIABLE section if needed. ++ ++CONFIG ++ Agent IPaddr2 ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 20 ++ ++VARIABLE ++ OCFT_target_ip=192.168.144.2 ++ OCFT_target_nic=eth0 ++ OCFT_target_prefix=24 ++ OCFT_target_netaddr=192.168.144.1/$OCFT_target_prefix ++ OCFT_target_brd=192.168.144.255 ++ OCFT_wrong_ip=192.168.120.1 ++ OCFT_force_nic=eth1 ++ OCFT_force_prefix=16 ++ OCFT_force_prefix2=28 ++ OCFT_force_brd=192.168.255.255 ++ ++SETUP-AGENT ++ ip addr add $OCFT_target_netaddr dev $OCFT_target_nic brd $OCFT_target_brd ++ ++CLEANUP-AGENT ++ ip addr del $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_ip=$OCFT_target_ip ++ Env OCFT_check_ip=$OCFT_target_ip ++ Env OCFT_check_prefix=$OCFT_target_prefix ++ Env OCFT_check_nic=$OCFT_target_nic ++ ++CASE-BLOCK check_ip_assigned ++ Bash ip -4 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv4 address was assigned correctly ++ ++CASE-BLOCK check_ip_removed ++ Bash ! ip -4 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv4 address was removed correctly ++ ++CASE-BLOCK base_ip_assigned ++ Bash ip addr add $OCFT_target_netaddr dev $OCFT_target_nic brd $OCFT_target_brd ++ ++CASE-BLOCK base_ip_removed ++ Bash ip addr del $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include required_args ++ Include default_status ++ ++# CASE No.0 ++# ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ ++# CASE No.1 ++# ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.2 ++# ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++# CASE No.3 ++# ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++# CASE No.4 ++# ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++# CASE No.5 ++# ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++# CASE No.6 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 succeeds if the ip matched based on the netmask of the subnet ++# or fails if it did not match to any. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 was using a wrong subnet mask (constant of 32) in this case. ++# ++CASE "params with nic, no cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.7 ++# ++CASE "params with nic, cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.8 ++# ++CASE "error params with wrong ip" ++ Include prepare ++ Env OCF_RESKEY_ip=$OCFT_wrong_ip ++ AgentRun start OCF_ERR_GENERIC ++ ++# CASE No.9 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 fails when it could not determine the correct subnet mask. ++# When it could not get base ip, it becomes the error. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 was using a wrong subnet mask (constant of 32) in this case. ++# ++#CASE "params with force nic" ++# Include prepare ++# Env OCF_RESKEY_nic=$OCFT_force_nic ++# Env OCFT_check_nic=$OCFT_force_nic ++# AgentRun start OCF_ERR_GENERIC ++# Include check_ip_removed ++# Unenv OCF_RESKEY_nic ++ ++# CASE No.10 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 fails when it could not determine the broadcast. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 succeeded but it's considered ambiguous. ++# ++CASE "params with force cidr_netmask (base netmask > assigned netmask)" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++ Env OCFT_check_prefix=$OCFT_force_prefix ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ ++# CASE No.11 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 succeeds but the broadcast is not set. ++# This is because findif.sh can not calculate a broadcast from a netmask. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 succeeded with using a calculated broadcast. ++# ++#CASE "force to use the specified nic and cidr_netmask" ++# Include prepare ++# Env OCF_RESKEY_nic=$OCFT_force_nic ++# Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++# Env OCFT_check_nic=$OCFT_force_nic ++# Env OCFT_check_prefix=$OCFT_force_prefix ++# AgentRun start OCF_SUCCESS ++# AgentRun stop OCF_SUCCESS ++# Include check_ip_removed ++# Unenv OCF_RESKEY_cidr_netmask ++ ++ ++# CASE No.12 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 fails when it could not determine the correct subnet mask. ++# When it could not get base ip, it becomes the error. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 was using a wrong subnet mask (constant of 32) in this case. ++# ++CASE "error params with wrong ip and nic (not exist base_ip)" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ Env OCFT_check_nic=$OCFT_target_nic ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ Include base_ip_assigned ++ ++# CASE No.13 ++# ++CASE "params with cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.14 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 does not override the broadcast by cidr_netmask. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 overrode the broadcast calculated by cidr_netmask. ++# ++CASE "params with force cidr_netmask (base netmask < assigned netmask)" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++ Env OCFT_check_prefix=$OCFT_force_prefix2 ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.15 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 fails when it could not determine the broadcast. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 succeeded but it's considered ambiguous. ++# ++CASE "error params with wrong ip and cidr_netmask (not exist base_ip)" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ AgentRun start OCF_ERR_GENERIC ++ Include base_ip_assigned ++ ++# CASE No.16 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 succeeds but the broadcast is not set. ++# This is because findif.sh can not calculate a broadcast from a netmask. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 succeeded with using a calculated broadcast. ++# ++#CASE "force to use the specified nic and cidr_netmask" ++# Include prepare ++# Env OCF_RESKEY_nic=$OCFT_force_nic ++# Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++# Env OCFT_check_prefix=$OCFT_force_prefix2 ++# Env OCFT_check_nic=$OCFT_force_nic ++# AgentRun start OCF_SUCCESS ++# AgentRun stop OCF_SUCCESS ++# Include check_ip_removed ++ ++# CASE No.17 ++# Note: this result is different from IPaddr2 in 3.9.3. ++# IPaddr2 succeeds but the broadcast is not set. ++# This is because findif.sh can not calculate a broadcast from a netmask. ++# Recommended to always specify both nic, cidr_netmask, and broadcast when you needed. ++# IPaddr2 in 3.9.3 succeeded with using a calculated broadcast. ++# ++#CASE "force to use the specified nic and cidr_netmask (not exist base_ip)" ++# Include prepare ++# Include base_ip_removed ++# Env OCF_RESKEY_nic=$OCFT_force_nic ++# Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++# Env OCFT_check_prefix=$OCFT_force_prefix2 ++# Env OCFT_check_nic=$OCFT_force_nic ++# AgentRun start OCF_SUCCESS ++# AgentRun stop OCF_SUCCESS ++# Unenv OCF_RESKEY_nic ++# Unenv OCF_RESKEY_cidr_netmask ++# Include base_ip_assigned ++ ++# CASE No.18 ++# ++CASE "params with broadcast, no nic, no cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_broadcast=$OCFT_force_brd ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.19 ++# ++CASE "params with broadcast, no nic, no cidr_netmask" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_broadcast=$OCFT_force_brd ++ AgentRun start OCF_ERR_GENERIC ++ Include base_ip_assigned ++ ++# CASE No.20 ++# ++#CASE "force to use the specified nic and cidr_netmask" ++# Include prepare ++# Env OCF_RESKEY_nic=$OCFT_force_nic ++# Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++# Env OCF_RESKEY_broadcast=$OCFT_force_brd ++# Env OCFT_check_nic=$OCFT_force_nic ++# Env OCFT_check_prefix=$OCFT_force_prefix ++# AgentRun start OCF_SUCCESS ++# Include check_ip_assigned ++# AgentRun monitor OCF_SUCCESS ++# AgentRun stop OCF_SUCCESS ++# Include check_ip_removed ++# Unenv OCF_RESKEY_cidr_netmask ++ ++# CASE No.21 ++# ++#CASE "force to use the specified nic and cidr_netmask" ++# Include prepare ++# Include base_ip_removed ++# Env OCF_RESKEY_nic=$OCFT_force_nic ++# Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++# Env OCF_RESKEY_broadcast=$OCFT_target_brd ++# Env OCFT_check_nic=$OCFT_force_nic ++# Env OCFT_check_prefix=$OCFT_force_prefix2 ++# AgentRun start OCF_SUCCESS ++# Include check_ip_assigned ++# AgentRun monitor OCF_SUCCESS ++# AgentRun stop OCF_SUCCESS ++# Include check_ip_removed ++# Include base_ip_assigned ++ +diff --git a/tools/ocft/fedora/IPaddr2v6 b/tools/ocft/fedora/IPaddr2v6 +new file mode 100644 +index 0000000..fe35046 +--- /dev/null ++++ b/tools/ocft/fedora/IPaddr2v6 +@@ -0,0 +1,250 @@ ++# IPaddr2v6 ++ ++# Note: This test case uses two NICs(eth0, eth1) and ++# a IPv6 address prefix (2001:db8::/32, RFC3849). ++# Adjust them according to your environment at VARIABLE section if needed. ++ ++CONFIG ++ Agent IPaddr2 ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 20 ++ ++VARIABLE ++ OCFT_target_ip=2001:db8:1234::2 ++ OCFT_target_nic=eth0 ++ OCFT_target_prefix=64 ++ OCFT_target_netaddr=2001:db8:1234::1/$OCFT_target_prefix ++ OCFT_target_linklocal=fe80::2 ++ OCFT_wrong_ip=2001:db8:5678::2 ++ OCFT_force_nic=eth1 ++ OCFT_force_prefix=80 ++ OCFT_force_prefix2=48 ++ ++SETUP-AGENT ++ ip addr add $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CLEANUP-AGENT ++ ip addr del $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_ip=$OCFT_target_ip ++ Env OCFT_check_ip=$OCFT_target_ip ++ Env OCFT_check_prefix=$OCFT_target_prefix ++ Env OCFT_check_nic=$OCFT_target_nic ++ ++CASE-BLOCK check_ip_assigned ++ Bash ip -6 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv6 address was assigned correctly ++ ++CASE-BLOCK check_ip_removed ++ Bash ! ip -6 -o addr show $OCFT_check_nic | grep -w $OCFT_check_ip/$OCFT_check_prefix >/dev/null # checking if the IPv6 address was removed correctly ++ ++CASE-BLOCK base_ip_assigned ++ Bash ip addr add $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CASE-BLOCK base_ip_removed ++ Bash ip addr del $OCFT_target_netaddr dev $OCFT_target_nic ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include required_args ++ Include default_status ++ ++# CASE No.0 ++# ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ ++# CASE No.1 ++# ++CASE "normal stop" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.2 ++# ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++# CASE No.3 ++# ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++# CASE No.4 ++# ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++# CASE No.5 ++# ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++# CASE No.6 ++# ++CASE "error params with wrong ip" ++ Include prepare ++ Env OCF_RESKEY_ip=$OCFT_wrong_ip ++ AgentRun start OCF_ERR_GENERIC ++ ++# CASE No.7 ++# ++CASE "error params with no nic for a link-local IPv6 address" ++ Include prepare ++ Env OCF_RESKEY_ip=$OCFT_target_linklocal ++ Env OCFT_check_ip=$OCFT_target_linklocal ++ # nic is mandatory for a link-local address ++ AgentRun start OCF_ERR_CONFIGURED ++ ++# CASE No.8 ++# ++CASE "params with nic, no cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun monitor OCF_SUCCESS ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.9 ++# ++CASE "normal usage for a link-local IPv6 address, params with nic" ++ Include prepare ++ Env OCF_RESKEY_ip=$OCFT_target_linklocal ++ Env OCFT_check_ip=$OCFT_target_linklocal ++ # nic is mandatory for a link-local address ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ Env OCFT_check_nic=$OCFT_target_nic ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.10 ++# ++CASE "error params with wrong ip and nic (not exist base_ip)" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ Env OCFT_check_nic=$OCFT_target_nic ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ Include base_ip_assigned ++ ++# CASE No.11 ++# ++#CASE "params with force nic" ++# Include prepare ++# Env OCF_RESKEY_nic=$OCFT_force_nic ++# Env OCFT_check_nic=$OCFT_force_nic ++# AgentRun start OCF_ERR_GENERIC ++# Include check_ip_removed ++# Unenv OCF_RESKEY_nic ++ ++# CASE No.12 ++# ++CASE "params with force cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ Env OCFT_check_prefix=$OCFT_target_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.13 ++# ++CASE "params with force cidr_netmask (base netmask < assigned netmask)" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++ Env OCFT_check_prefix=$OCFT_force_prefix ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ ++# CASE No.14 ++# ++CASE "params with force cidr_netmask (base netmask > assigned netmask)" ++ Include prepare ++ Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++ Env OCFT_check_prefix=$OCFT_force_prefix2 ++ AgentRun start OCF_ERR_GENERIC ++ Include check_ip_removed ++ ++# CASE No.15 ++# ++CASE "params with cidr_netmask" ++ Include prepare ++ Include base_ip_removed ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ Env OCFT_check_prefix=$OCFT_target_prefix ++ AgentRun start OCF_ERR_GENERIC ++ Include base_ip_assigned ++ ++# CASE No.16 ++# ++CASE "params with nic, cidr_netmask" ++ Include prepare ++ Env OCF_RESKEY_nic=$OCFT_target_nic ++ Env OCF_RESKEY_cidr_netmask=$OCFT_target_prefix ++ Env OCFT_check_nic=$OCFT_target_nic ++ Env OCFT_check_prefix=$OCFT_target_prefix ++ AgentRun start OCF_SUCCESS ++ Include check_ip_assigned ++ AgentRun stop OCF_SUCCESS ++ Include check_ip_removed ++ ++# CASE No.17 ++# ++#CASE "force to use the specified nic and cidr_netmask (base netmask < assigned netmask)" ++# Include prepare ++# Env OCF_RESKEY_nic=$OCFT_force_nic ++# Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix ++# Env OCFT_check_nic=$OCFT_force_nic ++# Env OCFT_check_prefix=$OCFT_force_prefix ++# AgentRun start OCF_SUCCESS ++# Include check_ip_assigned ++# AgentRun stop OCF_SUCCESS ++# Include check_ip_removed ++ ++# CASE No.18 ++# This use case is now valid. It was not allowed until v3.9.2. ++# ++#CASE "force to use the specified nic and cidr_netmask (base netmask > assigned netmask)" ++# Include prepare ++# Env OCF_RESKEY_nic=$OCFT_force_nic ++# Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++# Env OCFT_check_nic=$OCFT_force_nic ++# Env OCFT_check_prefix=$OCFT_force_prefix2 ++# AgentRun start OCF_SUCCESS ++# Include check_ip_assigned ++# AgentRun stop OCF_SUCCESS ++# Include check_ip_removed ++ ++# CASE No.19 ++# ++#CASE "force to use the specified nic and cidr_netmask (base netmask > assigned netmask)" ++# Include prepare ++# Include base_ip_removed ++# Env OCF_RESKEY_nic=$OCFT_force_nic ++# Env OCF_RESKEY_cidr_netmask=$OCFT_force_prefix2 ++# Env OCFT_check_nic=$OCFT_force_nic ++# Env OCFT_check_prefix=$OCFT_force_prefix2 ++# AgentRun start OCF_SUCCESS ++# Include check_ip_assigned ++# AgentRun stop OCF_SUCCESS ++# Include check_ip_removed ++# Include base_ip_assigned ++ +diff --git a/tools/ocft/fedora/IPsrcaddr b/tools/ocft/fedora/IPsrcaddr +new file mode 100644 +index 0000000..934801d +--- /dev/null ++++ b/tools/ocft/fedora/IPsrcaddr +@@ -0,0 +1,61 @@ ++# IPsrcaddr ++ ++CONFIG ++ Agent IPsrcaddr ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 20 ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_ipaddress=$(ip addr | grep "inet " | tail -n 1 | sed "s/\// /g" | awk '{print $2}') ++ ++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_ipaddress'" ++ Include prepare ++ Unenv OCF_RESKEY_ipaddress ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: set invalid 'OCF_RESKEY_ipaddress'" ++ Include prepare ++ Env OCF_RESKEY_ipaddress=not_ip_address ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/fedora/SendArp b/tools/ocft/fedora/SendArp +new file mode 100644 +index 0000000..adae63e +--- /dev/null ++++ b/tools/ocft/fedora/SendArp +@@ -0,0 +1,73 @@ ++# SendArp ++ ++CONFIG ++ Agent SendArp ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ HangTimeout 15 ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_ip=127.0.0.1 ++ Env OCF_RESKEY_nic=eth0 ++ Env OCF_RESKEY_background=false ++ ++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_ip'" ++ Include prepare ++ Unenv OCF_RESKEY_ip ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: set invalid 'OCF_RESKEY_ip'" ++ Include prepare ++ Env OCF_RESKEY_ip=not_ip_address ++ AgentRun start OCF_ERR_GENERIC ++ ++CASE "check base env: unset 'OCF_RESKEY_nic'" ++ Include prepare ++ Unenv OCF_RESKEY_nic ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: set invalid 'OCF_RESKEY_nic'" ++ Include prepare ++ Env OCF_RESKEY_nic=not_nic ++ AgentRun start OCF_ERR_GENERIC ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/fedora/Xinetd b/tools/ocft/fedora/Xinetd +new file mode 100644 +index 0000000..e26f495 +--- /dev/null ++++ b/tools/ocft/fedora/Xinetd +@@ -0,0 +1,62 @@ ++# Xinetd ++ ++CONFIG ++ Agent Xinetd ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage xinetd ++ ++SETUP-AGENT ++ service xinetd start ++ ++CLEANUP-AGENT ++ service xinetd stop ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_service=echo-stream ++ ++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_protocol'" ++ Include prepare ++ Unenv OCF_RESKEY_service ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/fedora/apache b/tools/ocft/fedora/apache +new file mode 100644 +index 0000000..23cce28 +--- /dev/null ++++ b/tools/ocft/fedora/apache +@@ -0,0 +1,81 @@ ++# apache ++# make sure that your apache configuration loads mod_status ++ ++CONFIG ++ Agent apache ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage httpd ++ HangTimeout 20 ++ ++SETUP-AGENT ++ ++ cat << END >> /var/www/html/index.html ++ ++ My Test Site ++ ++END ++ ++ cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bu ++ cat << END >> /etc/httpd/conf/httpd.conf ++ ++ SetHandler server-status ++ Order deny,allow ++ Deny from all ++ Allow from 127.0.0.1 ++ ++END ++ ++CLEANUP-AGENT ++ mv -f /etc/httpd/conf/httpd.conf.bu /etc/httpd/conf/httpd.conf ++ rm -f /var/www/html/index.html ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: set non-existing OCF_RESKEY_statusurl" ++ Include prepare ++ Env OCF_RESKEY_statusurl="yoyoyoyo" ++ AgentRun start OCF_ERR_GENERIC ++ ++CASE "check base env: set non-existing OCF_RESKEY_configfile" ++ Include prepare ++ Env OCF_RESKEY_configfile="/yoyoyoyo/nosuchfile" ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "running monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "not running monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/fedora/mysql b/tools/ocft/fedora/mysql +new file mode 100644 +index 0000000..c03be4f +--- /dev/null ++++ b/tools/ocft/fedora/mysql +@@ -0,0 +1,76 @@ ++# mysql ++ ++CONFIG ++ Agent mysql ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage mysql ++ InstallPackage mysql-server ++ HangTimeout 20 ++ ++ ++CASE-BLOCK crm_setting ++ Env OCF_RESKEY_CRM_meta_timeout=15000 ++ Env OCF_RESKEY_enable_creation=1 ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include crm_setting ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: invalid 'OCF_RESKEY_binary'" ++ Include prepare ++ Env OCF_RESKEY_binary=no_such ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "running monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "not running monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "check lib file" ++ Include prepare ++ Bash chmod u-w /var/lib/mysql ++ BashAtExit chmod u+w /var/lib/mysql ++ AgentRun start OCF_ERR_PERM ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ ++CASE "non-existent user" ++ Include prepare ++ Env OCF_RESKEY_user=no_user ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "invalid user" ++ Include prepare ++ Env OCF_RESKEY_user=nobody ++ AgentRun start OCF_ERR_PERM +diff --git a/tools/ocft/fedora/nfsserver b/tools/ocft/fedora/nfsserver +new file mode 100644 +index 0000000..5eadff4 +--- /dev/null ++++ b/tools/ocft/fedora/nfsserver +@@ -0,0 +1,74 @@ ++# nfsserver ++ ++CONFIG ++ Agent nfsserver ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage nfs-utils ++ HangTimeout 20 ++ ++CASE-BLOCK required_args ++ Env OCF_RESKEY_nfs_ip=127.0.0.1 ++ Env OCF_RESKEY_nfs_shared_infodir=/var/lib/nfs ++ Env OCF_RESKEY_nfs_init_script=/etc/init.d/nfs ++ ++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: invalid 'OCF_RESKEY_nfs_init_script'" ++ Include prepare ++ Env OCF_RESKEY_nfs_init_script=no_such_script ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "check base env: unset 'OCF_RESKEY_nfs_ip'" ++ Include prepare ++ Unenv OCF_RESKEY_nfs_ip ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: unset 'OCF_RESKEY_nfs_shared_infodir'" ++ Include prepare ++ Unenv OCF_RESKEY_nfs_shared_infodir ++ AgentRun start OCF_ERR_CONFIGURED ++ ++CASE "check base env: invalid 'OCF_RESKEY_nfs_notify_cmd'" ++ Include prepare ++ Env OCF_RESKEY_nfs_notify_cmd=no_such_program ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "monitor with running" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "monitor with not running" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/fedora/pgsql b/tools/ocft/fedora/pgsql +new file mode 100644 +index 0000000..fd61ee9 +--- /dev/null ++++ b/tools/ocft/fedora/pgsql +@@ -0,0 +1,72 @@ ++# pgsql ++ ++CONFIG ++ Agent pgsql ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage postgresql-server ++ HangTimeout 20 ++ ++SETUP-AGENT ++ service postgresql initdb > /dev/null 2>&1 ++ /etc/init.d/postgresql start ++ /etc/init.d/postgresql stop ++ ++CASE-BLOCK crm_setting ++ Env OCF_RESKEY_CRM_meta_timeout=15000 ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare ++ Include crm_setting ++ Include default_status ++ ++CASE "check base env" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "check base env: invalid 'OCF_RESKEY_pgctl'" ++ Include prepare ++ Env OCF_RESKEY_pgctl=no_such ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "normal start" ++ Include prepare ++ AgentRun start OCF_SUCCESS ++ ++CASE "normal stop" ++ Include prepare ++ AgentRun start ++ AgentRun stop OCF_SUCCESS ++ ++CASE "double start" ++ Include prepare ++ AgentRun start ++ AgentRun start OCF_SUCCESS ++ ++CASE "double stop" ++ Include prepare ++ AgentRun stop OCF_SUCCESS ++ ++CASE "running monitor" ++ Include prepare ++ AgentRun start ++ AgentRun monitor OCF_SUCCESS ++ ++CASE "not running monitor" ++ Include prepare ++ AgentRun monitor OCF_NOT_RUNNING ++ ++CASE "unimplemented command" ++ Include prepare ++ AgentRun no_cmd OCF_ERR_UNIMPLEMENTED ++ ++CASE "non-existent user" ++ Include prepare ++ Env OCF_RESKEY_pgdba=no_user ++ AgentRun start OCF_ERR_INSTALLED ++ ++CASE "invalid user" ++ Include prepare ++ Env OCF_RESKEY_pgdba=nobody ++ AgentRun start OCF_ERR_PERM +diff --git a/tools/ocft/fedora/tomcat b/tools/ocft/fedora/tomcat +new file mode 100644 +index 0000000..2cd5ae1 +--- /dev/null ++++ b/tools/ocft/fedora/tomcat +@@ -0,0 +1,72 @@ ++# tomcat ++# ++# NOTE: Clean up $catalina_home/logs before running this test ++# otherwise creating the pid/log files may fail ++# in the test case with a different user. ++ ++CONFIG ++ Agent tomcat ++ AgentRoot /usr/lib/ocf/resource.d/heartbeat ++ InstallPackage tomcat ++ HangTimeout 120 ++ ++VARIABLE ++ # Adjust accrding to your configuration ++ catalina_home=/usr/share/tomcat ++ java_home=/usr/lib/jvm/jre-openjdk ++ ++CASE-BLOCK required_args_tomcat ++ Env OCF_RESKEY_catalina_home=${catalina_home} ++ Env OCF_RESKEY_java_home=${java_home} ++ ++CASE-BLOCK args_clear ++ Unenv OCF_RESKEY_catalina_home ++ Unenv OCF_RESKEY_tomcat_user ++ Unenv OCF_RESKEY_java_home ++ ++CASE-BLOCK default_status ++ AgentRun stop ++ ++CASE-BLOCK prepare_tomcat ++ Include required_args_tomcat ++ Include default_status ++ ++# Test CASE ++# ++#CASE "normal start tomcat require_args (user:user)" ++# Include prepare_tomcat ++# AgentRun start OCF_SUCCESS ++# AgentRun monitor OCF_SUCCESS ++# AgentRun stop OCF_SUCCESS ++# AgentRun monitor OCF_NOT_RUNNING ++# Include args_clear ++ ++#CASE "normal start tomcat require_args (user:root)" ++# Include prepare_tomcat ++# Unenv OCF_RESKEY_tomcat_user ++# AgentRun start OCF_SUCCESS ++# AgentRun monitor OCF_SUCCESS ++# AgentRun stop OCF_SUCCESS ++# AgentRun monitor OCF_NOT_RUNNING ++# Include args_clear ++ ++CASE "error start tomcat no catalina_home" ++ Include prepare_tomcat ++ Unenv OCF_RESKEY_catalina_home ++ AgentRun start OCF_ERR_INSTALLED ++ Include args_clear ++ ++CASE "error start tomcat no java_home" ++ Include prepare_tomcat ++ Unenv OCF_RESKEY_java_home ++ AgentRun start OCF_ERR_INSTALLED ++ Include args_clear ++ ++CASE "error start tomcat no java command" ++ Include prepare_tomcat ++ Env OCF_RESKEY_java_home=/var ++ AgentRun start OCF_ERR_INSTALLED ++ AgentRun stop OCF_SUCCESS ++ AgentRun monitor OCF_NOT_RUNNING ++ Include args_clear ++ +diff --git a/tools/ocft/iscsi b/tools/ocft/iscsi +deleted file mode 100644 +index c1325a1..0000000 +--- a/tools/ocft/iscsi ++++ /dev/null +@@ -1,82 +0,0 @@ +-# iscsi +- +-CONFIG +- Agent iscsi +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage open-iscsi +- InstallPackage iscsitarget +- HangTimeout 20 +- +-VARIABLE +- OCFT_disk=/var/run/resource-agents/ocft-iscsi +- OCFT_target="iqn.2011-03.ocft.localhost:disk0" +- OCFT_portal="127.0.0.1:3260" +- +-SETUP-AGENT +- dd if=/dev/zero of=$OCFT_disk bs=1024k count=1 2>/dev/null +- echo Target $OCFT_target >> /etc/ietd.conf +- echo " Lun 0 Path=$OCFT_disk,Type=fileio" >> /etc/ietd.conf +- /etc/init.d/iscsitarget start +- /etc/init.d/open-iscsi start +- /etc/init.d/iscsitarget restart +- +-CLEANUP-AGENT +- rm -f $OCFT_disk +- sed -i "/^Target $OCFT_target/,+1d" /etc/ietd.conf +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_portal=$OCFT_portal +- Env OCF_RESKEY_target=$OCFT_target +- +-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: invalid 'OCF_RESKEY_portal'" +- Include prepare +- Unenv OCF_RESKEY_portal +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: unset 'OCF_RESKEY_target'" +- Include prepare +- Unenv OCF_RESKEY_target +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor when running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor when not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +- +diff --git a/tools/ocft/mysql b/tools/ocft/mysql +deleted file mode 100644 +index 27fcb58..0000000 +--- a/tools/ocft/mysql ++++ /dev/null +@@ -1,77 +0,0 @@ +-# mysql +- +-CONFIG +- Agent mysql +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage mysql +- HangTimeout 20 +- +-SETUP-AGENT +- /etc/init.d/mysql start +- /etc/init.d/mysql stop +- +-CASE-BLOCK crm_setting +- Env OCF_RESKEY_CRM_meta_timeout=15000 +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include crm_setting +- Include default_status +- +-CASE "check base env" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "check base env: invalid 'OCF_RESKEY_binary'" +- Include prepare +- Env OCF_RESKEY_binary=no_such +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "running monitor" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "not running monitor" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "check lib file" +- Include prepare +- Bash chmod u-w /var/lib/mysql +- BashAtExit chmod u+w /var/lib/mysql +- AgentRun start OCF_ERR_PERM +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +- +-CASE "non-existent user" +- Include prepare +- Env OCF_RESKEY_user=no_user +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "invalid user" +- Include prepare +- Env OCF_RESKEY_user=nobody +- AgentRun start OCF_ERR_PERM +diff --git a/tools/ocft/mysql-proxy b/tools/ocft/mysql-proxy +deleted file mode 100644 +index e16d52b..0000000 +--- a/tools/ocft/mysql-proxy ++++ /dev/null +@@ -1,83 +0,0 @@ +-# mysql-proxy +-# by r.bhatia@ipax.at +-# +-# test cases (to implement): +-# +-# * /usr/sbin/ocf-tester -n mp -o binary="/usr/sbin/mysql-proxy" -o defaults_file="" -o parameters="--proxy-skip-profiling" \ +-# -o admin_address="127.0.0.1:4041" -o admin_username="root" -o admin_password="la" -o admin_lua_script="/usr/lib/mysql-proxy/lua/admin.lua" \ +-# -o proxy_backend_addresses="192.168.100.200:42006" -o proxy_address="/var/run/mysqld/mysqld.sock" /usr/lib/ocf/resource.d/heartbeat/mysql-proxy +-# +-# * OCF_CHECK_LEVEL 20 check +- +-CONFIG +- Agent mysql-proxy +- AgentRoot /usr/lib/ocf/resource.d/heartbeat/ +- InstallPackage mysql-proxy +- HangTimeout 20 +- +-SETUP-AGENT +- # nothing +- +-CASE-BLOCK crm_setting +- Env OCF_RESKEY_CRM_meta_timeout=15000 +- Env OCF_RESKEY_binary=/tmp/mysql-proxy +- Env OCF_RESKEY_admin_username=root +- Env OCF_RESKEY_admin_password=test123 +- Env OCF_RESKEY_admin_lua_script=/usr/lib/mysql-proxy/lua/admin.lua +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Bash [ ! -x /tmp/mysql-proxy ] && ln -s `which mysql-proxy` /tmp/mysql-proxy || true +- Include crm_setting +- +-CASE-BLOCK teardown +- AgentRun stop +- BashAtExit rm -f /tmp/mysql-proxy +- +-CASE "check base env" +- Include prepare +- AgentRun start OCF_SUCCESS +- Include teardown +- +-CASE "check base env: invalid 'OCF_RESKEY_binary'" +- Include prepare +- Env OCF_RESKEY_binary=no_such +- AgentRun start OCF_ERR_INSTALLED +- BashAtExit rm -f /tmp/mysql-proxy +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- Include teardown +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- Include teardown +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- Include teardown +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "running monitor" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- Include teardown +- +-CASE "not running monitor" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/named b/tools/ocft/named +deleted file mode 100644 +index 90a4351..0000000 +--- a/tools/ocft/named ++++ /dev/null +@@ -1,69 +0,0 @@ +-#named +- +-# To work properly this test requires that standard bind and bin-utils +-# packages installed. +- +-CONFIG +- Agent named +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage bind +- InstallPackage bind-utils +- +-SETUP-AGENT +- /etc/init.d/named start +- /etc/init.d/named stop +- +-CASE-BLOCK crm_setting +- Env OCF_RESKEY_CRM_meta_timeout=15000 +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include crm_setting +- Include default_status +- +-CASE "check base env" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "check base env: invalid 'OCF_RESKEY_named'" +- Include prepare +- Env OCF_RESKEY_named=no_such +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "running monitor" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "not running monitor" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +- +-CASE "non-existent user" +- Include prepare +- Env OCF_RESKEY_named_user=no_user +- AgentRun start OCF_ERR_INSTALLED +diff --git a/tools/ocft/nfsserver b/tools/ocft/nfsserver +deleted file mode 100644 +index cd73164..0000000 +--- a/tools/ocft/nfsserver ++++ /dev/null +@@ -1,75 +0,0 @@ +-# nfsserver +- +-CONFIG +- Agent nfsserver +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage nfs-kernel-server +- HangTimeout 20 +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_nfs_init_script=/etc/init.d/nfsserver +- Env OCF_RESKEY_nfs_ip=127.0.0.1 +- Env OCF_RESKEY_nfs_shared_infodir=/var/lib/nfs +- Env OCF_RESKEY_nfs_notify_cmd=/usr/sbin/sm-notify +- +-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: invalid 'OCF_RESKEY_nfs_init_script'" +- Include prepare +- Env OCF_RESKEY_nfs_init_script=no_such_script +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "check base env: unset 'OCF_RESKEY_nfs_ip'" +- Include prepare +- Unenv OCF_RESKEY_nfs_ip +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: unset 'OCF_RESKEY_nfs_shared_infodir'" +- Include prepare +- Unenv OCF_RESKEY_nfs_shared_infodir +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: invalid 'OCF_RESKEY_nfs_notify_cmd'" +- Include prepare +- Env OCF_RESKEY_nfs_notify_cmd=no_such_program +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor with running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor with not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/oracle b/tools/ocft/oracle +deleted file mode 100644 +index 6f145c7..0000000 +--- a/tools/ocft/oracle ++++ /dev/null +@@ -1,81 +0,0 @@ +-# oracle +-# (based on db2) +-# +-# Created on an SLE11SP2 running oracle 11g +-# database sid is orcl +-# adapt this in set_testenv below +-# TODO: need oracle expert to break it, then test it +-# +- +-CONFIG +- Agent oracle +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- HangTimeout 40 +- +-SETUP-AGENT +- # nothing +- +-CASE-BLOCK set_testenv +- Env OCFT_sid=orcl +- +-CASE-BLOCK crm_setting +- Env OCF_RESKEY_sid=$OCFT_sid +- Env OCF_RESKEY_CRM_meta_timeout=30000 +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include set_testenv +- Include crm_setting +- Include default_status +- +-CASE "check base env" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "check base env: no 'OCF_RESKEY_sid'" +- Include prepare +- Env OCF_RESKEY_sid= +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: invalid 'OCF_RESKEY_home'" +- Include prepare +- Env OCF_RESKEY_home=/no_such +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "started: monitor" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "not started: monitor" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "try different ipcrm method" +- Include prepare +- Env OCF_RESKEY_ipcrm=none +- AgentRun start OCF_SUCCESS +diff --git a/tools/ocft/pgsql b/tools/ocft/pgsql +deleted file mode 100644 +index 9944b09..0000000 +--- a/tools/ocft/pgsql ++++ /dev/null +@@ -1,71 +0,0 @@ +-# pgsql +- +-CONFIG +- Agent pgsql +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage postgresql-server +- HangTimeout 20 +- +-SETUP-AGENT +- /etc/init.d/postgresql start +- /etc/init.d/postgresql stop +- +-CASE-BLOCK crm_setting +- Env OCF_RESKEY_CRM_meta_timeout=15000 +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include crm_setting +- Include default_status +- +-CASE "check base env" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "check base env: invalid 'OCF_RESKEY_pgctl'" +- Include prepare +- Env OCF_RESKEY_pgctl=no_such +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "running monitor" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "not running monitor" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +- +-CASE "non-existent user" +- Include prepare +- Env OCF_RESKEY_pgdba=no_user +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "invalid user" +- Include prepare +- Env OCF_RESKEY_pgdba=nobody +- AgentRun start OCF_ERR_PERM +diff --git a/tools/ocft/portblock b/tools/ocft/portblock +deleted file mode 100644 +index 3475c63..0000000 +--- a/tools/ocft/portblock ++++ /dev/null +@@ -1,69 +0,0 @@ +-# portblock +- +-CONFIG +- Agent portblock +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage iptables +- HangTimeout 15 +- +-CASE-BLOCK required_args +- Env OCF_RESKEY_protocol=tcp +- Env OCF_RESKEY_portno=80 +- Env OCF_RESKEY_action=block +- +-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_protocol'" +- Include prepare +- Unenv OCF_RESKEY_protocol +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: unset 'OCF_RESKEY_portno'" +- Include prepare +- Unenv OCF_RESKEY_portno +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "check base env: unset 'OCF_RESKEY_action'" +- Include prepare +- Unenv OCF_RESKEY_action +- AgentRun start OCF_ERR_CONFIGURED +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor with running" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "monitor with not running" +- Include prepare +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +diff --git a/tools/ocft/postfix b/tools/ocft/postfix +deleted file mode 100644 +index f17e968..0000000 +--- a/tools/ocft/postfix ++++ /dev/null +@@ -1,102 +0,0 @@ +-# postfix +-# by r.bhatia@ipax.at +-# +-# test cases (to implement): +-# +-# * /usr/sbin/ocf-tester -n post1 /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? -> DONE +-# * /usr/sbin/ocf-tester -n post2 -o binary="/usr/sbin/postfix" \ +-# -o config_dir="" /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? -> DONE +-# * /usr/sbin/ocf-tester -n post3 -o binary="/usr/sbin/postfix" \ +-# -o config_dir="/etc/postfix" /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? -> DONE +-# * /usr/sbin/ocf-tester -n post4 -o binary="/usr/sbin/postfix" \ +-# -o config_dir="/root/postfix/" /usr/lib/ocf/resource.d/heartbeat/postfix; echo $? +- +-CONFIG +- Agent postfix +- AgentRoot /usr/lib/ocf/resource.d/heartbeat +- InstallPackage postfix +- HangTimeout 20 +- +-SETUP-AGENT +- # nothing +- +-CASE-BLOCK crm_setting +- Env OCF_RESKEY_CRM_meta_timeout=15000 +- Env OCF_RESKEY_CRM_meta_interval=10000 +- +-CASE-BLOCK default_status +- AgentRun stop +- +-CASE-BLOCK prepare +- Include crm_setting +- Include default_status +- +-CASE "check base env" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "check base env: invalid 'OCF_RESKEY_binary'" +- Include prepare +- Env OCF_RESKEY_binary=no_such +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "check base env: invalid 'OCF_RESKEY_config_dir'" +- Include prepare +- Env OCF_RESKEY_config_dir=no_such +- AgentRun start OCF_ERR_INSTALLED +- +-CASE "check base env: 'OCF_RESKEY_binary'" +- Include prepare +- Env OCF_RESKEY_binary=/usr/sbin/postfix +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "check base env: 'OCF_RESKEY_config_dir' without trailing slash" +- Include prepare +- Env OCF_RESKEY_config_dir="/etc/postfix" +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "check base env: 'OCF_RESKEY_config_dir' with trailing slash" +- Include prepare +- Env OCF_RESKEY_config_dir="/etc/postfix/" +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "normal start" +- Include prepare +- AgentRun start OCF_SUCCESS +- +-CASE "normal stop" +- Include prepare +- AgentRun start +- AgentRun stop OCF_SUCCESS +- +-CASE "double start" +- Include prepare +- AgentRun start +- AgentRun start OCF_SUCCESS +- +-CASE "double stop" +- Include prepare +- AgentRun stop OCF_SUCCESS +- +-CASE "monitor a running resource" +- Include prepare +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "(initial) probe a stopped resource" +- Include prepare +- Env OCF_RESKEY_CRM_meta_interval=0 +- AgentRun monitor OCF_NOT_RUNNING +- +-CASE "(re-)probe a running resource" +- Include prepare +- Env OCF_RESKEY_CRM_meta_interval=0 +- AgentRun start +- AgentRun monitor OCF_SUCCESS +- +-CASE "unimplemented command" +- Include prepare +- AgentRun no_cmd OCF_ERR_UNIMPLEMENTED +-- +1.7.1 + diff --git a/SOURCES/bz917681_nodename_fixes.patch b/SOURCES/bz917681_nodename_fixes.patch new file mode 100644 index 0000000..52d53f9 --- /dev/null +++ b/SOURCES/bz917681_nodename_fixes.patch @@ -0,0 +1,116 @@ +diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance +index 510de7b..da394f5 100755 +--- a/heartbeat/SAPInstance ++++ b/heartbeat/SAPInstance +@@ -856,7 +856,7 @@ sapinstance_notify() { + # that is, when a slave resource was startet after the promote event of a already running master (e.g. node of slave was down) + # We also have to make sure to overrule the globaly set resource_stickiness or any fail-count factors => INFINITY + local n_uname="$OCF_RESKEY_CRM_meta_notify_demote_uname" +- if [ ${n_uname} != ${HOSTNAME} ]; then ++ if [ ${n_uname} != ${NODENAME} ]; then + ${HA_SBIN_DIR}/crm_master -v INFINITY -l reboot + fi + fi +@@ -879,6 +879,7 @@ SAPCONTROL="" + DIR_PROFILE="" + SAPSTARTPROFILE="" + CLONE=0 ++NODENAME=$(ocf_local_nodename) + + + if +diff --git a/heartbeat/mysql b/heartbeat/mysql +index c1c5573..f7eb9f2 100755 +--- a/heartbeat/mysql ++++ b/heartbeat/mysql +@@ -137,8 +137,8 @@ MYSQL_OPTIONS_TEST="$MYSQL_OPTIONS_LOCAL --user=$OCF_RESKEY_test_user --password + MYSQL_TOO_MANY_CONN_ERR=1040 + + CRM_MASTER="${HA_SBIN_DIR}/crm_master -l reboot " +-HOSTNAME=`uname -n` +-CRM_ATTR="${HA_SBIN_DIR}/crm_attribute -N $HOSTNAME " ++NODENAME=$(ocf_local_nodename) ++CRM_ATTR="${HA_SBIN_DIR}/crm_attribute -N $NODENAME " + INSTANCE_ATTR_NAME=`echo ${OCF_RESOURCE_INSTANCE}| awk -F : '{print $1}'` + CRM_ATTR_REPL_INFO="${HA_SBIN_DIR}/crm_attribute --type crm_config --name ${INSTANCE_ATTR_NAME}_REPL_INFO -s mysql_replication" + +@@ -998,7 +998,7 @@ mysql_start() { + # node that is just joining the cluster, and the CRM may have + # promoted a master before. + master_host=`echo $OCF_RESKEY_CRM_meta_notify_master_uname|tr -d " "` +- if [ "$master_host" -a "$master_host" != ${HOSTNAME} ]; then ++ if [ "$master_host" -a "$master_host" != ${NODENAME} ]; then + ocf_log info "Changing MySQL configuration to replicate from $master_host." + set_master + start_slave +@@ -1147,7 +1147,7 @@ mysql_notify() { + # time to check whether our replication slave is working + # correctly. + master_host=`echo $OCF_RESKEY_CRM_meta_notify_promote_uname|tr -d " "` +- if [ "$master_host" = ${HOSTNAME} ]; then ++ if [ "$master_host" = ${NODENAME} ]; then + ocf_log info "This will be the new master, ignoring post-promote notification." + else + ocf_log info "Resetting replication" +@@ -1172,7 +1172,7 @@ mysql_notify() { + ;; + 'pre-demote') + demote_host=`echo $OCF_RESKEY_CRM_meta_notify_demote_uname|tr -d " "` +- if [ $demote_host = ${HOSTNAME} ]; then ++ if [ $demote_host = ${NODENAME} ]; then + ocf_log info "post-demote notification for $demote_host" + set_read_only on + if [ $? -ne 0 ]; then +@@ -1199,7 +1199,7 @@ mysql_notify() { + ;; + 'post-demote') + demote_host=`echo $OCF_RESKEY_CRM_meta_notify_demote_uname|tr -d " "` +- if [ $demote_host = ${HOSTNAME} ]; then ++ if [ $demote_host = ${NODENAME} ]; then + ocf_log info "Ignoring post-demote notification for my own demotion." + return $OCF_SUCCESS + fi +diff --git a/heartbeat/ocf-shellfuncs.in b/heartbeat/ocf-shellfuncs.in +index 35b0a5a..1406c80 100644 +--- a/heartbeat/ocf-shellfuncs.in ++++ b/heartbeat/ocf-shellfuncs.in +@@ -513,6 +513,25 @@ ocf_version_cmp() { + fi + } + ++ocf_local_nodename() { ++ # use crm_node -n for pacemaker > 1.1.8 ++ which pacemakerd > /dev/null 2>&1 ++ if [ $? -eq 0 ]; then ++ local version=$(pacemakerd -$ | grep "Pacemaker .*" | awk '{ print $2 }') ++ ocf_version_cmp "$version" "1.1.8" ++ if [ $? -eq 2 ]; then ++ which crm_node > /dev/null 2>&1 ++ if [ $? -eq 0 ]; then ++ crm_node -n ++ return ++ fi ++ fi ++ fi ++ ++ # otherwise use uname -n ++ uname -n ++} ++ + # usage: dirname DIR + dirname() + { +diff --git a/heartbeat/pgsql b/heartbeat/pgsql +index 14fdfa6..b6b54b0 100755 +--- a/heartbeat/pgsql ++++ b/heartbeat/pgsql +@@ -1734,7 +1734,7 @@ BACKUPLABEL=${OCF_RESKEY_pgdata}/backup_label + RESOURCE_NAME=`echo $OCF_RESOURCE_INSTANCE | cut -d ":" -f 1` + PGSQL_WAL_RECEIVER_STATUS_ATTR="${RESOURCE_NAME}-receiver-status" + RECOVERY_CONF=${OCF_RESKEY_pgdata}/recovery.conf +-NODENAME=`uname -n | tr '[A-Z]' '[a-z]'` ++NODENAME=$(ocf_local_nodename | tr '[A-Z]' '[a-z]') + + if is_replication; then + REP_MODE_CONF=${OCF_RESKEY_tmpdir}/rep_mode.conf + diff --git a/SOURCES/bz917806-oracle-tns-admin.patch b/SOURCES/bz917806-oracle-tns-admin.patch new file mode 100644 index 0000000..f16ca01 --- /dev/null +++ b/SOURCES/bz917806-oracle-tns-admin.patch @@ -0,0 +1,96 @@ +From bc521235c8b630dd1f379e005c51b106a4cce701 Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Tue, 10 Sep 2013 18:17:21 -0500 +Subject: [PATCH] Low: oralsnr: Add tns_admin option for setting custom + TNS_ADMIN path + +--- + heartbeat/ora-common.sh | 9 +++++++-- + heartbeat/oracle | 2 +- + heartbeat/oralsnr | 14 +++++++++++++- + 3 files changed, 21 insertions(+), 4 deletions(-) + +diff --git a/heartbeat/ora-common.sh b/heartbeat/ora-common.sh +index f52dbc5..5bbb163 100644 +--- a/heartbeat/ora-common.sh ++++ b/heartbeat/ora-common.sh +@@ -19,6 +19,7 @@ ora_common_getconfig() { + ORACLE_SID=$1 + ORACLE_HOME=$2 + ORACLE_OWNER=$3 ++ TNS_ADMIN=$4 + + # get ORACLE_HOME from /etc/oratab if not set + [ x = "x$ORACLE_HOME" ] && +@@ -28,9 +29,13 @@ ora_common_getconfig() { + [ x = "x$ORACLE_OWNER" ] && + ORACLE_OWNER=`ls -ld $ORACLE_HOME/. 2>/dev/null | awk 'NR==1{print $3}'` + ++ # There are use-cases were users want to be able to set a custom TMS_ADMIN path. ++ # When TNS_ADMIN is not provided, use the default path. ++ [ x = "x$TNS_ADMIN" ] && ++ TNS_ADMIN=$ORACLE_HOME/network/admin ++ + LD_LIBRARY_PATH=$ORACLE_HOME/lib + LIBPATH=$ORACLE_HOME/lib +- TNS_ADMIN=$ORACLE_HOME/network/admin + PATH=$ORACLE_HOME/bin:$ORACLE_HOME/dbs:$PATH + export ORACLE_SID ORACLE_HOME ORACLE_OWNER TNS_ADMIN + export LD_LIBRARY_PATH LIBPATH +@@ -70,7 +75,7 @@ ORACLE_HOME=$ORACLE_HOME + ORACLE_OWNER=$ORACLE_OWNER + LD_LIBRARY_PATH=$ORACLE_HOME/lib + LIBPATH=$ORACLE_HOME/lib +-TNS_ADMIN=$ORACLE_HOME/network/admin ++TNS_ADMIN=$TNS_ADMIN + export ORACLE_SID ORACLE_HOME ORACLE_OWNER TNS_ADMIN + export LD_LIBRARY_PATH LIBPATH + EOF +diff --git a/heartbeat/oracle b/heartbeat/oracle +index 2d17e1a..d6b2c50 100755 +--- a/heartbeat/oracle ++++ b/heartbeat/oracle +@@ -473,7 +473,7 @@ ora_cleanup() { + } + + oracle_getconfig() { +- ora_common_getconfig "$OCF_RESKEY_sid" "$OCF_RESKEY_home" "$OCF_RESKEY_user" ++ ora_common_getconfig "$OCF_RESKEY_sid" "$OCF_RESKEY_home" "$OCF_RESKEY_user" "$OCF_RESKEY_tns_admin" + + clear_backupmode=${OCF_RESKEY_clear_backupmode:-"false"} + shutdown_method=${OCF_RESKEY_shutdown_method:-"checkpoint/abort"} +diff --git a/heartbeat/oralsnr b/heartbeat/oralsnr +index 3a6d6f2..98fb120 100755 +--- a/heartbeat/oralsnr ++++ b/heartbeat/oralsnr +@@ -104,6 +104,18 @@ Defaults to LISTENER. + + + ++ ++ ++ Full path to the directory that contains the Oracle ++ listener tnsnames.ora configuration file. The shell ++ variable TNS_ADMIN is set to the value provided. ++ ++ ++ Full path to the directory containing tnsnames.ora ++ ++ ++ ++ + + + +@@ -245,7 +257,7 @@ oralsnr_status() { + } + + oralsnr_getconfig() { +- ora_common_getconfig "$OCF_RESKEY_sid" "$OCF_RESKEY_home" "$OCF_RESKEY_user" ++ ora_common_getconfig "$OCF_RESKEY_sid" "$OCF_RESKEY_home" "$OCF_RESKEY_user" "$OCF_RESKEY_tns_admin" + listener=${OCF_RESKEY_listener:-"LISTENER"} + } + +-- +1.8.1 + diff --git a/SOURCES/bz984054.patch b/SOURCES/bz984054.patch new file mode 100644 index 0000000..54c7a61 --- /dev/null +++ b/SOURCES/bz984054.patch @@ -0,0 +1,76 @@ +From de258066eafa7a2c3a42ef88e2c7657ae95d1e99 Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Tue, 16 Jul 2013 18:29:42 -0500 +Subject: [PATCH] Low: LVM: Detect duplicate resources with the same volgrpname + name when using exclusive activation with tags. + +For exclusive activation with tags, we already detect +if the resource is a clone and prevent the LVM resource +from activating. This check goes a step further and +detects if there is another primitive attempting to access +the same volume group in pacemaker's configuraiton. This +check is ignored if pacemaker is not in use, allowing this +agent to continue to be portable to other cluster managers +in the future. + +This patch also re-words the 'exclusive' option's documentation +in order to clarify how volume_list filtering works. + +Resolves: rhbz#984054 +--- + heartbeat/LVM | 32 +++++++++++++++++++++++++++++--- + 1 file changed, 29 insertions(+), 3 deletions(-) + +diff --git a/heartbeat/LVM b/heartbeat/LVM +index 0ff6ba7..27315df 100755 +--- a/heartbeat/LVM ++++ b/heartbeat/LVM +@@ -80,9 +80,17 @@ The name of volume group. + If set, the volume group will be activated exclusively. This option works one of + two ways. If the volume group has the cluster attribute set, then the volume group + will be activated exclusively using clvmd across the cluster. If the cluster attribute +-is not set, the volume group will be activated exclusively using a tag and the volume_list +-filter. When the tag option is in use, the volume_list in lvm.con must be initialized. This +-can be as simple as setting 'volume_list = []' depending on your setup. ++is not set, the volume group will be activated exclusively through the use of the ++volume_list filter in lvm.conf. In the filter scenario, the LVM agent verifies ++that pacemaker's configuration will result in the volume group only being active on a ++single node in the cluster and that the local node's volume_list filter will prevent ++the volume group from activating outside of the resource agent. On activation this ++agent claims the volume group through the use of a unique tag, and then overrides the ++volume_list field in a way that allows the volume group to be activated only by the ++agent. To use exclusive activation without clvmd, the volume_list in lvm.conf must be ++initialized. If volume groups exist locally that are not controlled by the cluster, such ++as the root volume group, make sure those volume groups are listed in the volume_list ++so they will be allowed to activate on bootup. + + Exclusive activation + +@@ -191,6 +199,24 @@ verify_tags_environment() + return $OCF_ERR_GENERIC + fi + ++ ++ ## ++ # Verify that if this agent is being used in a Pacemaker cluster, ++ # no other LVM agents in the cib contain the same volgrpname ++ ## ++ if have_binary "cibadmin" ; then ++ # This detects if there is any other LVM primitive (besides this instance) that ++ # is already assigned the same volume group. If so, do not activate this instance. ++ cibadmin --local -Q --xpath '//primitive[@type="LVM"][@id!="'${OCF_RESOURCE_INSTANCE}'"]//instance_attributes//nvpair[@name="volgrpname"][@value="'${OCF_RESKEY_volgrpname}'"]' \ ++ > /dev/null 2>&1 ++ ++ if [ $? -eq 0 ]; then ++ ocf_log err "LVM: Improper setup detected" ++ ocf_log err "Duplicate LVM resource controlling vg '$OCF_RESKEY_volgrpname' detected in cib configuration. Can not activate exclusively" ++ return $OCF_ERR_GENERIC ++ fi ++ ++ fi + return $OCF_SUCCESS + } + +-- +1.8.1 + diff --git a/SOURCES/fix-LVM-clvmd-retry.patch b/SOURCES/fix-LVM-clvmd-retry.patch new file mode 100644 index 0000000..126181a --- /dev/null +++ b/SOURCES/fix-LVM-clvmd-retry.patch @@ -0,0 +1,25 @@ +From b1baea609901fff82e8318e9b7527f73253e0ec3 Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Thu, 12 Sep 2013 19:56:27 -0500 +Subject: [PATCH] Low: LVM: fix invalid return statement + +--- + heartbeat/LVM | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/heartbeat/LVM b/heartbeat/LVM +index 0ff6ba7..ec1ee7d 100755 +--- a/heartbeat/LVM ++++ b/heartbeat/LVM +@@ -405,7 +405,7 @@ retry_exclusive_start() + shift 2 + done + +- return ocf_run vgchange $vgchange_options $OCF_RESKEY_volgrpname ++ ocf_run vgchange $vgchange_options $OCF_RESKEY_volgrpname + } + + # +-- +1.8.1 + diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec new file mode 100644 index 0000000..26638fe --- /dev/null +++ b/SPECS/resource-agents.spec @@ -0,0 +1,840 @@ +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. +# + + + + + + +# +# Since this spec file supports multiple distributions, ensure we +# use the correct group for each. +# + +%global upstream_prefix ClusterLabs-resource-agents +%global upstream_version 5434e96 + +%global sap_script_prefix sap_redhat_cluster_connector +%global sap_hash 6353d27 + +# determine the ras-set to process based on configure invokation +%bcond_with rgmanager +%bcond_without linuxha + +Name: resource-agents +Summary: Open Source HA Reusable Cluster Resource Scripts +Version: 3.9.5 +Release: 18%{?dist} +License: GPLv2+ and LGPLv2+ +URL: https://github.com/ClusterLabs/resource-agents +%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} +Group: System Environment/Base +%else +Group: Productivity/Clustering/HA +%endif +Source0: %{upstream_prefix}-%{upstream_version}.tar.gz +Source1: %{sap_script_prefix}-%{sap_hash}.tar.gz +Patch1: bz984054.patch +Patch2: bz884164-multi-lib-fixes.patch +Patch3: bz10005924-default-apache-config.patch +Patch4: bz799065-apache-simple-monitor.patch +Patch5: fix-LVM-clvmd-retry.patch +Patch6: bz917806-oracle-tns-admin.patch +Patch7: bz917681-VirtualDomain-heartbeat-updates.patch +Patch8: bz917681_nodename_fixes.patch +Patch9: bz1014641-VirtualDomain-syntax-error.patch +Patch10: bz917681-VirtualDomain-heartbeat-updates_v2.patch +Patch11: bz1016140-start-predefined-domains.patch +Patch12: bz917681-ipv6-send_ua-fix.patch +Patch13: bz917681-ocft_fedora_supported_test_cases.patch +Obsoletes: heartbeat-resources <= %{version} +Provides: heartbeat-resources = %{version} + +## Setup/build bits +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +# Build dependencies +BuildRequires: automake autoconf pkgconfig +BuildRequires: perl python-devel +BuildRequires: libxslt glib2-devel +BuildRequires: which + +%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} +#BuildRequires: cluster-glue-libs-devel +BuildRequires: docbook-style-xsl docbook-dtds +%if 0%{?rhel} == 0 +BuildRequires: libnet-devel +%endif +%endif + +## Runtime deps +## These apply to rgmanager agents only to guarantee agents +## are functional +%if %{with rgmanager} +# system tools shared by several agents +Requires: /bin/bash /bin/grep /bin/sed /bin/gawk +Requires: /bin/ps /usr/bin/pkill /bin/hostname +Requires: /sbin/fuser +Requires: /sbin/findfs /bin/mount + +# fs.sh +Requires: /sbin/quotaon /sbin/quotacheck +Requires: /sbin/fsck +Requires: /usr/sbin/fsck.ext2 /usr/sbin/fsck.ext3 /usr/sbin/fsck.ext4 +Requires: /usr/sbin/fsck.xfs + +# ip.sh +Requires: /sbin/ip /usr/sbin/ethtool +Requires: /sbin/rdisc /usr/sbin/arping /bin/ping /bin/ping6 + +# lvm.sh +Requires: /usr/sbin/lvm + +# netfs.sh +Requires: /sbin/mount.nfs /sbin/mount.nfs4 /usr/sbin/mount.cifs +Requires: /usr/sbin/rpc.nfsd /sbin/rpc.statd /usr/sbin/rpc.mountd +%endif + +## Runtime dependencies required to guarantee heartbeat agents +## are functional +%if %{with linuxha} +# tools needed for Filesystem resource +Requires: psmisc +%endif + +%description +A set of scripts to interface with several services to operate in a +High Availability environment for both Pacemaker and rgmanager +service managers. + +%package sap +License: GPLv2+ +Summary: SAP cluster resource agents and connector script +%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} +Group: System Environment/Base +%else +Group: Productivity/Clustering/HA +%endif +Requires: %{name} = %{version}-%{release} +Requires: perl + +%description sap +The SAP resource agents and connector script interface with +Pacemaker to allow SAP instances to be managed in a cluster +environment. + +%prep +%if 0%{?suse_version} == 0 && 0%{?fedora} == 0 && 0%{?centos_version} == 0 && 0%{?rhel} == 0 +%{error:Unable to determine the distribution/version. This is generally caused by missing /etc/rpm/macros.dist. Please install the correct build packages or define the required macros manually.} +exit 1 +%endif +%setup -q -n %{upstream_prefix}-%{upstream_version} +%setup -a 1 -n %{upstream_prefix}-%{upstream_version} +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 -b .bz917681.1 +%patch13 -p1 -b .bz917681.1 + +%build +if [ ! -f configure ]; then + ./autogen.sh +fi + +%if 0%{?fedora} >= 11 || 0%{?centos_version} > 5 || 0%{?rhel} > 5 +CFLAGS="$(echo '%{optflags}')" +%global conf_opt_fatal "--enable-fatal-warnings=no" +%else +CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}" +%global conf_opt_fatal "--enable-fatal-warnings=yes" +%endif + +%if %{with rgmanager} +%global rasset rgmanager +%endif +%if %{with linuxha} +%global rasset linux-ha +%endif +%if %{with rgmanager} && %{with linuxha} +%global rasset all +%endif + +export CFLAGS + +%configure \ + %{conf_opt_fatal} \ + --with-pkg-name=%{name} \ + --with-ras-set=%{rasset} \ + --with-ocft-cases=fedora + +%if %{defined jobs} +JFLAGS="$(echo '-j%{jobs}')" +%else +JFLAGS="$(echo '%{_smp_mflags}')" +%endif + +make $JFLAGS + +%install +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} + +test -d %{buildroot}/usr/sbin || mkdir %{buildroot}/usr/sbin +mv %{sap_script_prefix}-%{sap_hash}/sap_redhat_cluster_connector %{buildroot}/usr/sbin/sap_redhat_cluster_connector + +## tree fixup +# remove docs (there is only one and they should come from doc sections in files) +rm -rf %{buildroot}/usr/share/doc/resource-agents + +## +# Create symbolic link between IPAddr and IPAddr2 +## +rm -f %{buildroot}/usr/lib/ocf/resource.d/heartbeat/IPaddr +ln -s /usr/lib/ocf/resource.d/heartbeat/IPaddr2 %{buildroot}/usr/lib/ocf/resource.d/heartbeat/IPaddr + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%doc AUTHORS COPYING COPYING.GPLv3 ChangeLog +%if %{with linuxha} +%doc doc/README.webapps +%doc %{_datadir}/%{name}/ra-api-1.dtd +%endif + +%if %{with rgmanager} +%{_datadir}/cluster +%{_sbindir}/rhev-check.sh +%endif + +%if %{with linuxha} +%dir /usr/lib/ocf +%dir /usr/lib/ocf/resource.d +%dir /usr/lib/ocf/lib + +/usr/lib/ocf/lib/heartbeat + +/usr/lib/ocf/resource.d/heartbeat +%if %{with rgmanager} +/usr/lib/ocf/resource.d/redhat +%endif + +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/ocft +%{_datadir}/%{name}/ocft/configs +%{_datadir}/%{name}/ocft/caselib +%{_datadir}/%{name}/ocft/README +%{_datadir}/%{name}/ocft/README.zh_CN + +%{_sbindir}/ocft + +%{_includedir}/heartbeat + +%dir %attr (1755, root, root) %{_var}/run/resource-agents + +%{_mandir}/man7/*.7* + +### +# Supported, but in another sub package +### +%exclude %{_sbindir}/sap_redhat_cluster_connector +%exclude /usr/lib/ocf/resource.d/heartbeat/SAP* +%exclude /usr/lib/ocf/lib/heartbeat/sap* +%exclude %{_mandir}/man7/*SAP* + +### +# Unsupported +### +%exclude /usr/lib/ocf/resource.d/heartbeat/AoEtarget +%exclude /usr/lib/ocf/resource.d/heartbeat/AudibleAlarm +%exclude /usr/lib/ocf/resource.d/heartbeat/ClusterMon +%exclude /usr/lib/ocf/resource.d/heartbeat/Delay +%exclude /usr/lib/ocf/resource.d/heartbeat/EvmsSCC +%exclude /usr/lib/ocf/resource.d/heartbeat/Evmsd +%exclude /usr/lib/ocf/resource.d/heartbeat/ICP +%exclude /usr/lib/ocf/resource.d/heartbeat/LinuxSCSI +%exclude /usr/lib/ocf/resource.d/heartbeat/ManageRAID +%exclude /usr/lib/ocf/resource.d/heartbeat/ManageVE +%exclude /usr/lib/ocf/resource.d/heartbeat/Pure-FTPd +%exclude /usr/lib/ocf/resource.d/heartbeat/Raid1 +%exclude /usr/lib/ocf/resource.d/heartbeat/ServeRAID +%exclude /usr/lib/ocf/resource.d/heartbeat/SphinxSearchDaemon +%exclude /usr/lib/ocf/resource.d/heartbeat/Stateful +%exclude /usr/lib/ocf/resource.d/heartbeat/SysInfo +%exclude /usr/lib/ocf/resource.d/heartbeat/VIPArip +%exclude /usr/lib/ocf/resource.d/heartbeat/WAS +%exclude /usr/lib/ocf/resource.d/heartbeat/WAS6 +%exclude /usr/lib/ocf/resource.d/heartbeat/WinPopup +%exclude /usr/lib/ocf/resource.d/heartbeat/Xen +%exclude /usr/lib/ocf/resource.d/heartbeat/anything +%exclude /usr/lib/ocf/resource.d/heartbeat/asterisk +%exclude /usr/lib/ocf/resource.d/heartbeat/db2 +%exclude /usr/lib/ocf/resource.d/heartbeat/eDir88 +%exclude /usr/lib/ocf/resource.d/heartbeat/fio +%exclude /usr/lib/ocf/resource.d/heartbeat/iSCSILogicalUnit +%exclude /usr/lib/ocf/resource.d/heartbeat/iSCSITarget +%exclude /usr/lib/ocf/resource.d/heartbeat/ids +%exclude /usr/lib/ocf/resource.d/heartbeat/iscsi +%exclude /usr/lib/ocf/resource.d/heartbeat/jboss +%exclude /usr/lib/ocf/resource.d/heartbeat/ldirectord +%exclude /usr/lib/ocf/resource.d/heartbeat/lxc +%exclude /usr/lib/ocf/resource.d/heartbeat/oracle +%exclude /usr/lib/ocf/resource.d/heartbeat/oralsnr +%exclude /usr/lib/ocf/resource.d/heartbeat/pingd +%exclude /usr/lib/ocf/resource.d/heartbeat/portblock +%exclude /usr/lib/ocf/resource.d/heartbeat/pound +%exclude /usr/lib/ocf/resource.d/heartbeat/proftpd +%exclude /usr/lib/ocf/resource.d/heartbeat/scsi2reservation +%exclude /usr/lib/ocf/resource.d/heartbeat/sfex +%exclude /usr/lib/ocf/resource.d/heartbeat/syslog-ng +%exclude /usr/lib/ocf/resource.d/heartbeat/varnish +%exclude /usr/lib/ocf/resource.d/heartbeat/vmware +%exclude /usr/lib/ocf/resource.d/heartbeat/zabbixserver +%exclude /usr/lib/ocf/resource.d/heartbeat/mysql-proxy +%exclude /usr/lib/ocf/resource.d/heartbeat/nginx +%exclude /usr/lib/ocf/resource.d/heartbeat/rsyslog +%exclude %{_mandir}/man7/ocf_heartbeat_AoEtarget.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_AudibleAlarm.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_ClusterMon.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_Delay.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_EvmsSCC.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_Evmsd.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_ICP.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_IPaddr.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_LinuxSCSI.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_ManageRAID.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_ManageVE.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_Pure-FTPd.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_Raid1.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_ServeRAID.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_SphinxSearchDaemon.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_Stateful.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_SysInfo.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_VIPArip.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_WAS.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_WAS6.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_WinPopup.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_Xen.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_anything.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_asterisk.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_db2.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_eDir88.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_fio.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_iSCSILogicalUnit.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_iSCSITarget.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_ids.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_iscsi.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_jboss.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_lxc.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_oracle.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_oralsnr.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_pingd.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_portblock.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_pound.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_proftpd.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_scsi2reservation.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_sfex.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_syslog-ng.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_varnish.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_vmware.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_zabbixserver.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_mysql-proxy.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_nginx.7.gz +%exclude %{_mandir}/man7/ocf_heartbeat_rsyslog.7.gz + +### +# Other excluded files. +### +# This tool has to be updated for the new pacemaker lrmd. +%exclude %{_sbindir}/ocf-tester +%exclude %{_mandir}/man8/ocf-tester.8* +# ldirectord is not supported +%exclude /etc/ha.d/resource.d/ldirectord +%exclude /etc/init.d/ldirectord +%exclude /etc/logrotate.d/ldirectord +%exclude /usr/sbin/ldirectord +%exclude %{_mandir}/man8/ldirectord.8.gz + +# For compatability with pre-existing agents +%dir %{_sysconfdir}/ha.d +%{_sysconfdir}/ha.d/shellfuncs + +%{_libexecdir}/heartbeat +%endif + +%if %{with rgmanager} +%post -n resource-agents +ccs_update_schema > /dev/null 2>&1 ||: +%endif + +%files sap +%defattr(-,root,root) +%{_sbindir}/sap_redhat_cluster_connector +/usr/lib/ocf/resource.d/heartbeat/SAP* +/usr/lib/ocf/lib/heartbeat/sap* +%{_mandir}/man7/*SAP* + +%changelog +* Thu Nov 07 2013 David Vossel - 3.9.5-18 +- Remove support for (nginx, mysql-proxy, rsyslog). nginx and + mysql-proxy are not a supported projects. Rsyslog is not an + agent we will be supporting in an HA environment. + + Resolves: rhbz#917681 + +* Wed Nov 06 2013 David Vossel - 3.9.5-17 +- Split send_ua utility out of IPv6addr.c source so it can be + re-used in IPaddr2 without requiring cluster-glue. +- Fixes issue with pgsql and SAPInstance not setting transient + attributes correctly when local corosync node name is not + equal to 'uname -n' +- High: ocft: Fedora supported test cases + + Resolves: rhbz#917681 + +* Mon Oct 07 2013 David Vossel - 3.9.5-16 +- Fixes issue with mysql agent not being able to set transient + attributes on local node correctly. +- Fixes bash syntax error in VirtualDomain during 'stop' +- Fixes VirtualDomain default hypervisor usage. +- Fixes VirtualDomain 'start' of pre-defined domain + + Resolves: rhbz#917681 + Resolves: rhbz#1014641 + Resolves: rhbz#1016140 + +* Thu Sep 26 2013 David Vossel - 3.9.5-15 +- Update VirtualDomain heartbeat agent for heartbeat merger. +- Includes upstream fixes for pacemaker_remote lxc test case. + + Resolves: rhbz#917681 + +* Thu Sep 12 2013 David Vossel - 3.9.5-14 +- Add ability for apache agent to perform simple monitoring + of server request/response without requiring server-status + to be enabled. +- Fixes invalid return statement in LVM agent. +- Oracle TNS_ADMIN option + + Resolves: rhbz#917806 + Resolves: rhbz#917681 + Resolves: rhbz#799065 + +* Mon Sep 9 2013 David Vossel - 3.9.5-13 +- Use correct default config for apache + Resolves: rhbz#1005924 + +* Tue Jul 30 2013 David Vossel - 3.9.5-12 +- Symbolic links do not have file permissions. + +* Tue Jul 30 2013 David Vossel - 3.9.5-11 +- Fixes file permissions problem detected in rpmdiff test + +* Tue Jul 30 2013 David Vossel - 3.9.5-10 +- Removes ldirectord package +- Puts sap agents and connector script in subpackage +- exclude unsupported packages +- symlink ipaddr to ipaddr2 so only a single agent is supported + +* Mon Jul 29 2013 David Vossel - 3.9.5-9 +- Fixes more multi-lib problems. + +* Mon Jul 29 2013 David Vossel - 3.9.5-8 +- Add runtime dependencies section for Heartbeat agents. +- Fix multi-lib inconsistencies found during rpm diff testing. +- Add dist field back to rpm release name. + +* Tue Jul 16 2013 David Vossel - 3.9.5-7 +- Detect duplicate resources with the same volgrpname + name when using exclusive activation with tags + + Resolves: # rhbz984054 + +* Tue Jun 18 2013 David Vossel - 3.9.5-6 +- Restores rsctmp directory to upstream default. + +* Tue Jun 18 2013 David Vossel - 3.9.5-5 +- Merges redhat provider into heartbeat provider. Remove + rgmanager's redhat provider. + + Resolves: rhbz#917681 + Resolves: rhbz#928890 + Resolves: rhbz#952716 + Resolves: rhbz#960555 + +* Tue Mar 12 2013 David Vossel - 3.9.5-4 +- Fixes build system error with conditional logic involving + IPv6addr. + +* Mon Mar 11 2013 David Vossel - 3.9.5-3 +- Fixes build dependency for pod2man when building against + rhel-7. + +* Mon Mar 11 2013 David Vossel - 3.9.5-2 +- Resolves rhbz#915050 + +* Mon Mar 11 2013 David Vossel - 3.9.5-1 +- New upstream release. + +* Fri Nov 09 2012 Chris Feist - 3.9.2-5 +- Fixed upstream tarball location + +* Fri Nov 09 2012 Chris Feist - 3.9.2-4 +- Removed version after dist tag +- Resolves: rhbz#875250 + +* Mon Oct 29 2012 Chris Feist - 3.9.2-3.8 +- Remove cluster-glue-libs-devel +- Disable IPv6addr & sfex to fix deps on libplumgpl & libplum (due to + disappearance of cluster-glue in F18) + +* Sat Jul 21 2012 Fedora Release Engineering - 3.9.2-3.5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jul 05 2012 Chris Feist - 3.9.2-3.4 +- Fix location of lvm (change from /sbin to /usr/sbin) + +* Tue Apr 04 2012 Jon Ciesla - 3.9.2-3.3 +- Rebuilt to fix rawhide dependency issues (caused by move of fsck from + /sbin to /usr/sbin). + +* Fri Mar 30 2012 Jon Ciesla - 3.9.2-3.1 +- libnet rebuild. + +* Sat Jan 14 2012 Fedora Release Engineering - 3.9.2-2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Fri Jul 8 2011 Fabio M. Di Nitto - 3.9.2-2 +- add post call to resource-agents to integrate with cluster 3.1.4 + +* Thu Jun 30 2011 Fabio M. Di Nitto - 3.9.2-1 +- new upstream release +- fix 2 regressions from 3.9.1 + +* Mon Jun 20 2011 Fabio M. Di Nitto - 3.9.1-1 +- new upstream release +- import spec file from upstream + +* Tue Mar 1 2011 Fabio M. Di Nitto - 3.1.1-1 +- new upstream release 3.1.1 and 1.0.4 + +* Wed Feb 09 2011 Fedora Release Engineering - 3.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Dec 2 2010 Fabio M. Di Nitto - 3.1.0-1 +- new upstream release +- spec file update: + Update upstream URL + Update source URL + use standard configure macro + use standard make invokation + +* Thu Oct 7 2010 Fabio M. Di Nitto - 3.0.17-1 +- new upstream release + Resolves: rhbz#632595, rhbz#633856, rhbz#632385, rhbz#628013 + Resolves: rhbz#621313, rhbz#595383, rhbz#580492, rhbz#605733 + Resolves: rhbz#636243, rhbz#591003, rhbz#637913, rhbz#634718 + Resolves: rhbz#617247, rhbz#617247, rhbz#617234, rhbz#631943 + Resolves: rhbz#639018 + +* Thu Oct 7 2010 Andrew Beekhof - 3.0.16-2 +- new upstream release of the Pacemaker agents: 71b1377f907c + +* Thu Sep 2 2010 Fabio M. Di Nitto - 3.0.16-1 +- new upstream release + Resolves: rhbz#619096, rhbz#614046, rhbz#620679, rhbz#619680 + Resolves: rhbz#621562, rhbz#621694, rhbz#608887, rhbz#622844 + Resolves: rhbz#623810, rhbz#617306, rhbz#623816, rhbz#624691 + Resolves: rhbz#622576 + +* Thu Jul 29 2010 Fabio M. Di Nitto - 3.0.14-1 +- new upstream release + Resolves: rhbz#553383, rhbz#557563, rhbz#578625, rhbz#591003 + Resolves: rhbz#593721, rhbz#593726, rhbz#595455, rhbz#595547 + Resolves: rhbz#596918, rhbz#601315, rhbz#604298, rhbz#606368 + Resolves: rhbz#606470, rhbz#606480, rhbz#606754, rhbz#606989 + Resolves: rhbz#607321, rhbz#608154, rhbz#608887, rhbz#609181 + Resolves: rhbz#609866, rhbz#609978, rhbz#612097, rhbz#612110 + Resolves: rhbz#612165, rhbz#612941, rhbz#614127, rhbz#614356 + Resolves: rhbz#614421, rhbz#614457, rhbz#614961, rhbz#615202 + Resolves: rhbz#615203, rhbz#615255, rhbz#617163, rhbz#617566 + Resolves: rhbz#618534, rhbz#618703, rhbz#618806, rhbz#618814 + +* Mon Jun 7 2010 Fabio M. Di Nitto - 3.0.13-1 +- new upstream release + Resolves: rhbz#592103, rhbz#593108, rhbz#578617, rhbz#594626 + Resolves: rhbz#594511, rhbz#596046, rhbz#594111, rhbz#597002 + Resolves: rhbz#599643 + +* Tue May 18 2010 Andrew Beekhof - 3.0.12-2 +- libnet is not available on RHEL +- Do not package ldirectord on RHEL + Resolves: rhbz#577264 + +* Mon May 10 2010 Fabio M. Di Nitto - 3.0.12-1 +- new upstream release + Resolves: rhbz#585217, rhbz#586100, rhbz#581533, rhbz#582753 + Resolves: rhbz#582754, rhbz#585083, rhbz#587079, rhbz#588890 + Resolves: rhbz#588925, rhbz#583789, rhbz#589131, rhbz#588010 + Resolves: rhbz#576871, rhbz#576871, rhbz#590000, rhbz#589823 + +* Mon May 10 2010 Andrew Beekhof - 3.0.12-1 +- New pacemaker agents upstream release: a7c0f35916bf + + High: pgsql: properly implement pghost parameter + + High: RA: mysql: fix syntax error + + High: SAPInstance RA: do not rely on op target rc when monitoring clones (lf#2371) + + High: set the HA_RSCTMP directory to /var/run/resource-agents (lf#2378) + + Medium: IPaddr/IPaddr2: add a description of the assumption in meta-data + + Medium: IPaddr: return the correct code if interface delete failed + + Medium: nfsserver: rpc.statd as the notify cmd does not work with -v (thanks to Carl Lewis) + + Medium: oracle: reduce output from sqlplus to the last line for queries (bnc#567815) + + Medium: pgsql: implement "config" parameter + + Medium: RA: iSCSITarget: follow changed IET access policy + +* Wed Apr 21 2010 Fabio M. Di Nitto - 3.0.11-1 +- new upstream release + Resolves: rhbz#583945, rhbz#581047, rhbz#576330, rhbz#583017 + Resolves: rhbz#583019, rhbz#583948, rhbz#584003, rhbz#582017 + Resolves: rhbz#555901, rhbz#582754, rhbz#582573, rhbz#581533 +- Switch to file based Requires. + Also address several other problems related to missing runtime + components in different agents. + With the current Requires: set, we guarantee all basic functionalities + out of the box for lvm/fs/clusterfs/netfs/networking. + Resolves: rhbz#570008 + +* Sat Apr 17 2010 Andrew Beekhof - 3.0.10-2 +- New pacemaker agents upstream release + + High: RA: vmware: fix set_environment() invocation (LF 2342) + + High: RA: vmware: update to version 0.2 + + Medium: Filesystem: prefer /proc/mounts to /etc/mtab for non-bind mounts (lf#2388) + + Medium: IPaddr2: don't bring the interface down on stop (thanks to Lars Ellenberg) + + Medium: IPsrcaddr: modify the interface route (lf#2367) + + Medium: ldirectord: Allow multiple email addresses (LF 2168) + + Medium: ldirectord: fix setting defaults for configfile and ldirectord (lf#2328) + + Medium: meta-data: improve timeouts in most resource agents + + Medium: nfsserver: use default values (lf#2321) + + Medium: ocf-shellfuncs: don't log but print to stderr if connected to a terminal + + Medium: ocf-shellfuncs: don't output to stderr if using syslog + + Medium: oracle/oralsnr: improve exit codes if the environment isn't valid + + Medium: RA: iSCSILogicalUnit: fix monitor for STGT + + Medium: RA: make sure that OCF_RESKEY_CRM_meta_interval is always defined (LF 2284) + + Medium: RA: ManageRAID: require bash + + Medium: RA: ManageRAID: require bash + + Medium: RA: VirtualDomain: bail out early if config file can't be read during probe (Novell 593988) + + Medium: RA: VirtualDomain: fix incorrect use of __OCF_ACTION + + Medium: RA: VirtualDomain: improve error messages + + Medium: RA: VirtualDomain: spin on define until we definitely have a domain name + + Medium: Route: add route table parameter (lf#2335) + + Medium: sfex: don't use pid file (lf#2363,bnc#585416) + + Medium: sfex: exit with success on stop if sfex has never been started (bnc#585416) + +* Fri Apr 9 2010 Fabio M. Di Nitto - 3.0.10-1 +- New rgmanager resource agents upstream release + Resolves: rhbz#519491, rhbz#570525, rhbz#571806, rhbz#574027 + Resolves: rhbz#574215, rhbz#574886, rhbz#576322, rhbz#576335 + Resolves: rhbz#575103, rhbz#577856, rhbz#577874, rhbz#578249 + Resolves: rhbz#578625, rhbz#578626, rhbz#578628, rhbz#578626 + Resolves: rhbz#579621, rhbz#579623, rhbz#579625, rhbz#579626 + Resolves: rhbz#579059 + +* Wed Mar 24 2010 Andrew Beekhof - 3.0.9-2 +- Resolves: rhbz#572993 - Patched build process to correctly generate ldirectord man page +- Resolves: rhbz#574732 - Add libnet-devel as a dependancy to ensure IPaddrv6 is built + +* Mon Mar 1 2010 Fabio M. Di Nitto - 3.0.9-1 +- New rgmanager resource agents upstream release + Resolves: rhbz#455300, rhbz#568446, rhbz#561862, rhbz#536902 + Resolves: rhbz#512171, rhbz#519491 + +* Mon Feb 22 2010 Fabio M. Di Nitto - 3.0.8-1 +- New rgmanager resource agents upstream release + Resolves: rhbz#548133, rhbz#565907, rhbz#545602, rhbz#555901 + Resolves: rhbz#564471, rhbz#515717, rhbz#557128, rhbz#536157 + Resolves: rhbz#455300, rhbz#561416, rhbz#562237, rhbz#537201 + Resolves: rhbz#536962, rhbz#553383, rhbz#556961, rhbz#555363 + Resolves: rhbz#557128, rhbz#455300, rhbz#557167, rhbz#459630 + Resolves: rhbz#532808, rhbz#556603, rhbz#554968, rhbz#555047 + Resolves: rhbz#554968, rhbz#555047 +- spec file update: + * update spec file copyright date + * use bz2 tarball + +* Fri Jan 15 2010 Fabio M. Di Nitto - 3.0.7-2 +- Add python as BuildRequires + +* Mon Jan 11 2010 Fabio M. Di Nitto - 3.0.7-1 +- New rgmanager resource agents upstream release + Resolves: rhbz#526286, rhbz#533461 + +* Mon Jan 11 2010 Andrew Beekhof - 3.0.6-2 +- Update Pacameker agents to upstream version: c76b4a6eb576 + + High: RA: VirtualDomain: fix forceful stop (LF 2283) + + High: apache: monitor operation of depth 10 for web applications (LF 2234) + + Medium: IPaddr2: CLUSTERIP/iptables rule not always inserted on failed monitor (LF 2281) + + Medium: RA: Route: improve validate (LF 2232) + + Medium: mark obsolete RAs as deprecated (LF 2244) + + Medium: mysql: escalate stop to KILL if regular shutdown doesn't work + +* Mon Dec 7 2009 Fabio M. Di Nitto - 3.0.6-1 +- New rgmanager resource agents upstream release +- spec file update: + * use global instead of define + * use new Source0 url + * use %name macro more aggressively + +* Mon Dec 7 2009 Andrew Beekhof - 3.0.5-2 +- Update Pacameker agents to upstream version: bc00c0b065d9 + + High: RA: introduce OCF_FUNCTIONS_DIR, allow it to be overridden (LF2239) + + High: doc: add man pages for all RAs (LF2237) + + High: syslog-ng: new RA + + High: vmware: make meta-data work and several cleanups (LF 2212) + + Medium: .ocf-shellfuncs: add ocf_is_probe function + + Medium: Dev: make RAs executable (LF2239) + + Medium: IPv6addr: ifdef out the ip offset hack for libnet v1.1.4 (LF 2034) + + Medium: add mercurial repository version information to .ocf-shellfuncs + + Medium: build: add perl-MailTools runtime dependency to ldirectord package (LF 1469) + + Medium: iSCSITarget, iSCSILogicalUnit: support LIO + + Medium: nfsserver: use check_binary properly in validate (LF 2211) + + Medium: nfsserver: validate should not check if nfs_shared_infodir exists (thanks to eelco@procolix.com) (LF 2219) + + Medium: oracle/oralsnr: export variables properly + + Medium: pgsql: remove the previous backup_label if it exists + + Medium: postfix: fix double stop (thanks to Dinh N. Quoc) + + RA: LVM: Make monitor operation quiet in logs (bnc#546353) + + RA: Xen: Remove instance_attribute "allow_migrate" (bnc#539968) + + ldirectord: OCF agent: overhaul + +* Fri Nov 20 2009 Fabio M. Di Nitto - 3.0.5-1 +- New rgmanager resource agents upstream release +- Allow pacemaker to use rgmanager resource agents + +* Wed Oct 28 2009 Andrew Beekhof - 3.0.4-2 +- Update Pacameker agents to upstream version: e2338892f59f + + High: send_arp - turn on unsolicited mode for compatibilty with the libnet version's exit codes + + High: Trap sigterm for compatibility with the libnet version of send_arp + + Medium: Bug - lf#2147: IPaddr2: behave if the interface is down + + Medium: IPv6addr: recognize network masks properly + + Medium: RA: VirtualDomain: avoid needlessly invoking "virsh define" + +* Wed Oct 21 2009 Fabio M. Di Nitto - 3.0.4-1 +- New rgmanager resource agents upstream release + +* Mon Oct 12 2009 Andrew Beekhof - 3.0.3-3 +- Update Pacameker agents to upstream version: 099c0e5d80db + + Add the ha_parameter function back into .ocf-shellfuncs. + + Bug bnc#534803 - Provide a default for MAILCMD + + Fix use of undefined macro @HA_NOARCHDATAHBDIR@ + + High (LF 2138): IPsrcaddr: replace 0/0 with proper ip prefix (thanks to Michael Ricordeau and Michael Schwartzkopff) + + Import shellfuncs from heartbeat as badly written RAs use it + + Medium (LF 2173): nfsserver: exit properly in nfsserver_validate + + Medium: RA: Filesystem: implement monitor operation + + Medium: RA: VirtualDomain: loop on status if libvirtd is unreachable + + Medium: RA: VirtualDomain: loop on status if libvirtd is unreachable (addendum) + + Medium: RA: iSCSILogicalUnit: use a 16-byte default SCSI ID + + Medium: RA: iSCSITarget: be more persistent deleting targets on stop + + Medium: RA: portblock: add per-IP filtering capability + + Medium: mysql-proxy: log_level and keepalive parameters + + Medium: oracle: drop spurious output from sqlplus + + RA: Filesystem: allow configuring smbfs mounts as clones + +* Wed Sep 23 2009 Fabio M. Di Nitto - 3.0.3-1 +- New rgmanager resource agents upstream release + +* Thu Aug 20 2009 Fabio M. Di Nitto - 3.0.1-1 +- New rgmanager resource agents upstream release + +* Tue Aug 18 2009 Andrew Beekhof - 3.0.0-16 +- Create an ldirectord package +- Update Pacameker agents to upstream version: 2198dc90bec4 + + Build: Import ldirectord. + + Ensure HA_VARRUNDIR has a value to substitute + + High: Add findif tool (mandatory for IPaddr/IPaddr2) + + High: IPv6addr: new nic and cidr_netmask parameters + + High: postfix: new resource agent + + Include license information + + Low (LF 2159): Squid: make the regexp match more precisely output of netstat + + Low: configure: Fix package name. + + Low: ldirectord: add dependency on $remote_fs. + + Low: ldirectord: add mandatory required header to init script. + + Medium (LF 2165): IPaddr2: remove all colons from the mac address before passing it to send_arp + + Medium: VirtualDomain: destroy domain shortly before timeout expiry + + Medium: shellfuncs: Make the mktemp wrappers work. + + Remove references to Echo function + + Remove references to heartbeat shellfuncs. + + Remove useless path lookups + + findif: actually include the right header. Simplify configure. + + ldirectord: Remove superfluous configure artifact. + + ocf-tester: Fix package reference and path to DTD. + +* Tue Aug 11 2009 Ville Skyttä - 3.0.0-15 +- Use bzipped upstream hg tarball. + +* Wed Jul 29 2009 Fabio M. Di Nitto - 3.0.0-14 +- Merge Pacemaker cluster resource agents: + * Add Source1. + * Drop noarch. We have real binaries now. + * Update BuildRequires. + * Update all relevant prep/build/install/files/description sections. + +* Sun Jul 26 2009 Fedora Release Engineering - 3.0.0-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Jul 8 2009 Fabio M. Di Nitto - 3.0.0-12 +- spec file updates: + * Update copyright header + * final release.. undefine alphatag + +* Thu Jul 2 2009 Fabio M. Di Nitto - 3.0.0-11.rc4 +- New upstream release. + +* Sat Jun 20 2009 Fabio M. Di Nitto - 3.0.0-10.rc3 +- New upstream release. + +* Wed Jun 10 2009 Fabio M. Di Nitto - 3.0.0-9.rc2 +- New upstream release + git94df30ca63e49afb1e8aeede65df8a3e5bcd0970 + +* Tue Mar 24 2009 Fabio M. Di Nitto - 3.0.0-8.rc1 +- New upstream release. +- Update BuildRoot usage to preferred versions/names + +* Mon Mar 9 2009 Fabio M. Di Nitto - 3.0.0-7.beta1 +- New upstream release. + +* Fri Mar 6 2009 Fabio M. Di Nitto - 3.0.0-6.alpha7 +- New upstream release. + +* Tue Mar 3 2009 Fabio M. Di Nitto - 3.0.0-5.alpha6 +- New upstream release. + +* Tue Feb 24 2009 Fabio M. Di Nitto - 3.0.0-4.alpha5 +- Drop Conflicts with rgmanager. + +* Mon Feb 23 2009 Fabio M. Di Nitto - 3.0.0-3.alpha5 +- New upstream release. + +* Thu Feb 19 2009 Fabio M. Di Nitto - 3.0.0-2.alpha4 +- Add comments on how to build this package. + +* Thu Feb 5 2009 Fabio M. Di Nitto - 3.0.0-1.alpha4 +- New upstream release. +- Fix datadir/cluster directory ownership. + +* Tue Jan 27 2009 Fabio M. Di Nitto - 3.0.0-1.alpha3 + - Initial packaging