diff --git a/bz2103374-ocf-tester-update.patch b/bz2103374-ocf-tester-1-update.patch similarity index 100% rename from bz2103374-ocf-tester-update.patch rename to bz2103374-ocf-tester-1-update.patch diff --git a/bz2103374-ocf-tester-2-remove-deprecated-lrmd-lrmadmin-code.patch b/bz2103374-ocf-tester-2-remove-deprecated-lrmd-lrmadmin-code.patch new file mode 100644 index 0000000..a932397 --- /dev/null +++ b/bz2103374-ocf-tester-2-remove-deprecated-lrmd-lrmadmin-code.patch @@ -0,0 +1,166 @@ +From 687aa646852d5fd5d4e811b2ec562ebffa15e23d Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Thu, 14 Jul 2022 14:52:07 +0200 +Subject: [PATCH] ocf-tester: remove deprecated lrmd/lrmadmin code that hasnt + worked since pre-pacemaker days + +--- + tools/ocf-tester.8 | 12 ++----- + tools/ocf-tester.in | 81 --------------------------------------------- + 2 files changed, 2 insertions(+), 91 deletions(-) + +diff --git a/tools/ocf-tester.8 b/tools/ocf-tester.8 +index 850ec0be04..3f398282d2 100644 +--- a/tools/ocf-tester.8 ++++ b/tools/ocf-tester.8 +@@ -1,9 +1,9 @@ +-.TH OCF-TESTER "8" "January 2012" "Tool for testing if a cluster resource is OCF compliant" "System Administration Utilities" ++.TH OCF-TESTER "8" "July 2022" "Tool for testing if a cluster resource is OCF compliant" "System Administration Utilities" + .SH NAME + ocf-tester \- Part of the Linux-HA project + .SH SYNOPSIS + .B ocf-tester +-[\fI-LhvqdX\fR] \fI-n resource_name \fR[\fI-o name=value\fR]\fI* /full/path/to/resource/agent\fR ++[\fI-hvqdX\fR] \fI-n resource_name \fR[\fI-o name=value\fR]\fI* /full/path/to/resource/agent\fR + .SH DESCRIPTION + Tool for testing if a cluster resource is OCF compliant + .SH OPTIONS +@@ -26,11 +26,6 @@ Name of the resource + \fB\-o\fR name=value + Name and value of any parameters required by the agent + .TP +-\fB\-L\fR +-Use lrmadmin/lrmd for tests +-.PP +-Usage: ocf\-tester [\-Lh] \fB\-n\fR resource_name [\-o name=value]* /full/path/to/resource/agent +-.TP + \fB\-h\fR + This text + .TP +@@ -51,6 +46,3 @@ Name of the resource + .TP + \fB\-o\fR name=value + Name and value of any parameters required by the agent +-.TP +-\fB\-L\fR +-Use lrmadmin/lrmd for tests +diff --git a/tools/ocf-tester.in b/tools/ocf-tester.in +index 10822a5a06..15b14e51ea 100755 +--- a/tools/ocf-tester.in ++++ b/tools/ocf-tester.in +@@ -25,8 +25,6 @@ + # Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. + # + +-LRMD=@libdir@/heartbeat/lrmd +-LRMADMIN=@sbindir@/lrmadmin + DATADIR=@datadir@ + METADATA_LINT="xmllint --noout --valid -" + +@@ -61,7 +59,6 @@ usage() { + echo " -X Turn on RA tracing (expect large output)" + echo " -n name Name of the resource" + echo " -o name=value Name and value of any parameters required by the agent" +- echo " -L Use lrmadmin/lrmd for tests" + exit $1 + } + +@@ -104,7 +101,6 @@ while test "$done" = "0"; do + -o) name=${2%%=*}; value=${2#*=}; + lrm_ra_args="$lrm_ra_args $2"; + ra_args="$ra_args OCF_RESKEY_$name='$value'"; shift; shift;; +- -L) use_lrmd=1; shift;; + -v) verbose=1; shift;; + -d) export HA_debug=1; shift;; + -X) export OCF_TRACE_RA=1; verbose=1; shift;; +@@ -140,79 +136,6 @@ stopped_rc=7 + has_demote=1 + has_promote=1 + +-start_lrmd() { +- lrmd_timeout=0 +- lrmd_interval=0 +- lrmd_target_rc=EVERYTIME +- lrmd_started="" +- $LRMD -s 2>/dev/null +- rc=$? +- if [ $rc -eq 3 ]; then +- lrmd_started=1 +- $LRMD & +- sleep 1 +- $LRMD -s 2>/dev/null +- else +- return $rc +- fi +-} +-add_resource() { +- $LRMADMIN -A $OCF_RESOURCE_INSTANCE \ +- ocf \ +- `basename $agent` \ +- $(basename `dirname $agent`) \ +- $lrm_ra_args > /dev/null +-} +-del_resource() { +- $LRMADMIN -D $OCF_RESOURCE_INSTANCE +-} +-parse_lrmadmin_output() { +- awk ' +-BEGIN{ rc=1; } +-/Waiting for lrmd to callback.../ { n=1; next; } +-n==1 && /----------------operation--------------/ { n++; next; } +-n==2 && /return code:/ { rc=$0; sub("return code: *","",rc); next } +-n==2 && /---------------------------------------/ { +- n++; +- next; +-} +-END{ +- if( n!=3 ) exit 1; +- else exit rc; +-} +-' +-} +-exec_resource() { +- op="$1" +- args="$2" +- $LRMADMIN -E $OCF_RESOURCE_INSTANCE \ +- $op $lrmd_timeout $lrmd_interval \ +- $lrmd_target_rc \ +- $args | parse_lrmadmin_output +-} +- +-if [ "$use_lrmd" = 1 ]; then +- echo "Using lrmd/lrmadmin for all tests" +- start_lrmd || { +- echo "could not start lrmd" >&2 +- exit 1 +- } +- trap ' +- [ "$lrmd_started" = 1 ] && $LRMD -k +- ' EXIT +- add_resource || { +- echo "failed to add resource to lrmd" >&2 +- exit 1 +- } +-fi +- +-lrm_test_command() { +- action="$1" +- msg="$2" +- debug "$msg" +- exec_resource $action "$lrm_ra_args" +-} +- + test_permissions() { + action=meta-data + debug ${1:-"Testing permissions with uid nobody"} +@@ -233,10 +156,6 @@ test_command() { + action=$1; shift + export __OCF_ACTION=$action + msg=${1:-"Testing: $action"} +- if [ "$use_lrmd" = 1 ]; then +- lrm_test_command $action "$msg" +- return $? +- fi + #echo Running: "export $ra_args; $agent $action 2>&1 > /dev/null" + if [ $verbose -eq 0 ]; then + command_output=`$agent $action 2>&1` diff --git a/resource-agents.spec b/resource-agents.spec index 96ad544..171022a 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -45,7 +45,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.10.0 -Release: 21%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 22%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: %{upstream_prefix}-%{upstream_version}.tar.gz @@ -75,7 +75,8 @@ Patch22: bz2083090-openstack-info-fix-bashism.patch Patch23: bz2083081-bz2083086-bz2083092-openstack-agents-fixes.patch Patch24: bz2083081-bz2083086-bz2083090-bz2083092-openstack-agents-warn-when-openstackcli-slow.patch Patch25: bz2083081-bz2083086-bz2083090-bz2083092-openstack-agents-set-domain-parameters-default.patch -Patch26: bz2103374-ocf-tester-update.patch +Patch26: bz2103374-ocf-tester-1-update.patch +Patch27: bz2103374-ocf-tester-2-remove-deprecated-lrmd-lrmadmin-code.patch # bundled ha-cloud-support libs Patch500: ha-cloud-support-aws.patch @@ -226,6 +227,7 @@ exit 1 %patch24 -p1 %patch25 -p1 %patch26 -p1 +%patch27 -p1 # bundled ha-cloud-support libs %patch500 -p1 @@ -547,7 +549,7 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents %{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm %changelog -* Thu Jul 14 2022 Oyvind Albrigtsen - 4.10.0-21 +* Thu Jul 14 2022 Oyvind Albrigtsen - 4.10.0-22 - ocf-tester: add testing tool Resolves: rhbz#2103374